From b930185bc48d5ff3c24eaf27c5ce7d07fcf9be24 Mon Sep 17 00:00:00 2001 From: Christiaan de Ridder Date: Thu, 12 Sep 2019 09:54:51 +0200 Subject: [PATCH] Generate version 2.8.5 --- .php_cs | 33 +- .swagger-codegen/VERSION | 2 +- composer.json | 4 +- lib/Api/CancellationApi.php | 2 +- lib/Api/NotificationApi.php | 462 +++++++++++ lib/Api/OfferApi.php | 2 +- lib/Api/OrderApi.php | 2 +- lib/Api/ProductApi.php | 2 +- lib/Api/ProductBundleApi.php | 2 +- lib/Api/ReturnApi.php | 12 +- lib/Api/ShipmentApi.php | 2 +- lib/Api/StockLocationApi.php | 2 +- lib/ApiException.php | 2 +- lib/Configuration.php | 6 +- lib/HeaderSelector.php | 3 +- lib/Model/ApiResponse.php | 5 +- ...llectionOfMerchantNotificationResponse.php | 541 ++++++++++++ ...lectionOfMerchantOfferGetStockResponse.php | 5 +- .../CollectionOfMerchantOrderResponse.php | 5 +- ...lectionOfMerchantProductBundleResponse.php | 5 +- .../CollectionOfMerchantProductResponse.php | 5 +- .../CollectionOfMerchantReturnResponse.php | 5 +- ...ionOfMerchantSingleOrderReturnResponse.php | 541 ++++++++++++ ...lectionOfMerchantStockLocationResponse.php | 5 +- lib/Model/MerchantAddressResponse.php | 153 +--- lib/Model/MerchantCancellationLineRequest.php | 11 +- lib/Model/MerchantCancellationRequest.php | 22 +- lib/Model/MerchantNotificationResponse.php | 451 ++++++++++ lib/Model/MerchantOfferGetStockResponse.php | 45 +- .../MerchantOrderAcknowledgementRequest.php | 25 +- lib/Model/MerchantOrderLineResponse.php | 44 +- lib/Model/MerchantOrderResponse.php | 124 +-- .../MerchantProductBundlePartResponse.php | 5 +- lib/Model/MerchantProductBundleResponse.php | 5 +- .../MerchantProductExtraDataItemRequest.php | 13 +- .../MerchantProductExtraDataItemResponse.php | 13 +- lib/Model/MerchantProductRequest.php | 13 +- lib/Model/MerchantProductResponse.php | 13 +- lib/Model/MerchantReturnLineRequest.php | 11 +- lib/Model/MerchantReturnLineResponse.php | 8 +- lib/Model/MerchantReturnLineUpdateRequest.php | 14 +- lib/Model/MerchantReturnRequest.php | 50 +- lib/Model/MerchantReturnResponse.php | 41 +- lib/Model/MerchantReturnUpdateRequest.php | 11 +- lib/Model/MerchantShipmentLineRequest.php | 11 +- lib/Model/MerchantShipmentRequest.php | 56 +- lib/Model/MerchantShipmentTrackingRequest.php | 53 +- .../MerchantSingleOrderReturnLineResponse.php | 394 +++++++++ .../MerchantSingleOrderReturnResponse.php | 773 ++++++++++++++++++ lib/Model/MerchantStockLocationResponse.php | 5 +- lib/Model/MerchantStockPriceUpdateRequest.php | 8 +- lib/Model/ModelInterface.php | 2 +- lib/Model/ProductCreationResult.php | 5 +- lib/Model/ProductMessage.php | 5 +- lib/Model/SingleOfDictionary2.php | 5 +- lib/Model/SingleOfMerchantProductResponse.php | 5 +- lib/Model/SingleOfProductCreationResult.php | 5 +- lib/ObjectSerializer.php | 13 +- 58 files changed, 3457 insertions(+), 610 deletions(-) create mode 100644 lib/Api/NotificationApi.php create mode 100644 lib/Model/CollectionOfMerchantNotificationResponse.php create mode 100644 lib/Model/CollectionOfMerchantSingleOrderReturnResponse.php create mode 100644 lib/Model/MerchantNotificationResponse.php create mode 100644 lib/Model/MerchantSingleOrderReturnLineResponse.php create mode 100644 lib/Model/MerchantSingleOrderReturnResponse.php diff --git a/.php_cs b/.php_cs index 6b8e23c..4fbe53e 100644 --- a/.php_cs +++ b/.php_cs @@ -1,18 +1,23 @@ level(Symfony\CS\FixerInterface::PSR2_LEVEL) +return PhpCsFixer\Config::create() ->setUsingCache(true) - ->fixers( - [ - 'ordered_use', - 'phpdoc_order', - 'short_array_syntax', - 'strict', - 'strict_param' - ] - ) - ->finder( - Symfony\CS\Finder\DefaultFinder::create() - ->in(__DIR__) + ->setRules([ + '@PSR2' => true, + 'ordered_imports' => true, + 'phpdoc_order' => true, + 'array_syntax' => [ 'syntax' => 'short' ], + 'strict_comparison' => true, + 'strict_param' => true, + 'no_trailing_whitespace' => false, + 'no_trailing_whitespace_in_comment' => false, + 'braces' => false, + 'single_blank_line_at_eof' => false, + 'blank_line_after_namespace' => false, + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->exclude('test') + ->exclude('tests') + ->in(__DIR__) ); diff --git a/.swagger-codegen/VERSION b/.swagger-codegen/VERSION index 855ff95..9bc1c54 100644 --- a/.swagger-codegen/VERSION +++ b/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +2.4.8-SNAPSHOT \ No newline at end of file diff --git a/composer.json b/composer.json index 28a49df..c65d5d4 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "channelengine/merchant-api-client-php", - "version": "2.8.2", + "version": "2.8.5", "description": "", "keywords": [ "swagger", @@ -26,7 +26,7 @@ "require-dev": { "phpunit/phpunit": "^4.8", "squizlabs/php_codesniffer": "~2.6", - "friendsofphp/php-cs-fixer": "~1.12" + "friendsofphp/php-cs-fixer": "~2.12" }, "autoload": { "psr-4": { "ChannelEngine\\Merchant\\ApiClient\\" : "lib/" } diff --git a/lib/Api/CancellationApi.php b/lib/Api/CancellationApi.php index 3d9171c..ee22a71 100644 --- a/lib/Api/CancellationApi.php +++ b/lib/Api/CancellationApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** diff --git a/lib/Api/NotificationApi.php b/lib/Api/NotificationApi.php new file mode 100644 index 0000000..50b869e --- /dev/null +++ b/lib/Api/NotificationApi.php @@ -0,0 +1,462 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation notificationIndex + * + * Get Notifications + * + * @param \DateTime $fromDate Filter on the notification date, starting from this date. This date is inclusive. (optional) + * @param \DateTime $toDate Filter on the notification date, until this date. This date is exclusive. (optional) + * @param string[] $types Notification type(s) to filter on (optional) + * @param string[] $merchantOrderNos Filter on unique order reference used by the merchant (optional) + * @param string[] $channelOrderNos Filter on unique order reference used by the channel (optional) + * @param string[] $merchantReturnNos Filter on unique return reference used by the merchant (optional) + * @param string[] $channelReturnNos Filter on unique return reference used by the channel (optional) + * @param string[] $merchantShipmentNos Filter on unique shipment reference used by the merchant (optional) + * @param int $page The page to filter on. Starts at 1. (optional) + * + * @throws \ChannelEngine\Merchant\ApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \ChannelEngine\Merchant\ApiClient\Model\CollectionOfMerchantNotificationResponse + */ + public function notificationIndex($fromDate = null, $toDate = null, $types = null, $merchantOrderNos = null, $channelOrderNos = null, $merchantReturnNos = null, $channelReturnNos = null, $merchantShipmentNos = null, $page = null) + { + list($response) = $this->notificationIndexWithHttpInfo($fromDate, $toDate, $types, $merchantOrderNos, $channelOrderNos, $merchantReturnNos, $channelReturnNos, $merchantShipmentNos, $page); + return $response; + } + + /** + * Operation notificationIndexWithHttpInfo + * + * Get Notifications + * + * @param \DateTime $fromDate Filter on the notification date, starting from this date. This date is inclusive. (optional) + * @param \DateTime $toDate Filter on the notification date, until this date. This date is exclusive. (optional) + * @param string[] $types Notification type(s) to filter on (optional) + * @param string[] $merchantOrderNos Filter on unique order reference used by the merchant (optional) + * @param string[] $channelOrderNos Filter on unique order reference used by the channel (optional) + * @param string[] $merchantReturnNos Filter on unique return reference used by the merchant (optional) + * @param string[] $channelReturnNos Filter on unique return reference used by the channel (optional) + * @param string[] $merchantShipmentNos Filter on unique shipment reference used by the merchant (optional) + * @param int $page The page to filter on. Starts at 1. (optional) + * + * @throws \ChannelEngine\Merchant\ApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \ChannelEngine\Merchant\ApiClient\Model\CollectionOfMerchantNotificationResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function notificationIndexWithHttpInfo($fromDate = null, $toDate = null, $types = null, $merchantOrderNos = null, $channelOrderNos = null, $merchantReturnNos = null, $channelReturnNos = null, $merchantShipmentNos = null, $page = null) + { + $returnType = '\ChannelEngine\Merchant\ApiClient\Model\CollectionOfMerchantNotificationResponse'; + $request = $this->notificationIndexRequest($fromDate, $toDate, $types, $merchantOrderNos, $channelOrderNos, $merchantReturnNos, $channelReturnNos, $merchantShipmentNos, $page); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\ChannelEngine\Merchant\ApiClient\Model\CollectionOfMerchantNotificationResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation notificationIndexAsync + * + * Get Notifications + * + * @param \DateTime $fromDate Filter on the notification date, starting from this date. This date is inclusive. (optional) + * @param \DateTime $toDate Filter on the notification date, until this date. This date is exclusive. (optional) + * @param string[] $types Notification type(s) to filter on (optional) + * @param string[] $merchantOrderNos Filter on unique order reference used by the merchant (optional) + * @param string[] $channelOrderNos Filter on unique order reference used by the channel (optional) + * @param string[] $merchantReturnNos Filter on unique return reference used by the merchant (optional) + * @param string[] $channelReturnNos Filter on unique return reference used by the channel (optional) + * @param string[] $merchantShipmentNos Filter on unique shipment reference used by the merchant (optional) + * @param int $page The page to filter on. Starts at 1. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function notificationIndexAsync($fromDate = null, $toDate = null, $types = null, $merchantOrderNos = null, $channelOrderNos = null, $merchantReturnNos = null, $channelReturnNos = null, $merchantShipmentNos = null, $page = null) + { + return $this->notificationIndexAsyncWithHttpInfo($fromDate, $toDate, $types, $merchantOrderNos, $channelOrderNos, $merchantReturnNos, $channelReturnNos, $merchantShipmentNos, $page) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation notificationIndexAsyncWithHttpInfo + * + * Get Notifications + * + * @param \DateTime $fromDate Filter on the notification date, starting from this date. This date is inclusive. (optional) + * @param \DateTime $toDate Filter on the notification date, until this date. This date is exclusive. (optional) + * @param string[] $types Notification type(s) to filter on (optional) + * @param string[] $merchantOrderNos Filter on unique order reference used by the merchant (optional) + * @param string[] $channelOrderNos Filter on unique order reference used by the channel (optional) + * @param string[] $merchantReturnNos Filter on unique return reference used by the merchant (optional) + * @param string[] $channelReturnNos Filter on unique return reference used by the channel (optional) + * @param string[] $merchantShipmentNos Filter on unique shipment reference used by the merchant (optional) + * @param int $page The page to filter on. Starts at 1. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function notificationIndexAsyncWithHttpInfo($fromDate = null, $toDate = null, $types = null, $merchantOrderNos = null, $channelOrderNos = null, $merchantReturnNos = null, $channelReturnNos = null, $merchantShipmentNos = null, $page = null) + { + $returnType = '\ChannelEngine\Merchant\ApiClient\Model\CollectionOfMerchantNotificationResponse'; + $request = $this->notificationIndexRequest($fromDate, $toDate, $types, $merchantOrderNos, $channelOrderNos, $merchantReturnNos, $channelReturnNos, $merchantShipmentNos, $page); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'notificationIndex' + * + * @param \DateTime $fromDate Filter on the notification date, starting from this date. This date is inclusive. (optional) + * @param \DateTime $toDate Filter on the notification date, until this date. This date is exclusive. (optional) + * @param string[] $types Notification type(s) to filter on (optional) + * @param string[] $merchantOrderNos Filter on unique order reference used by the merchant (optional) + * @param string[] $channelOrderNos Filter on unique order reference used by the channel (optional) + * @param string[] $merchantReturnNos Filter on unique return reference used by the merchant (optional) + * @param string[] $channelReturnNos Filter on unique return reference used by the channel (optional) + * @param string[] $merchantShipmentNos Filter on unique shipment reference used by the merchant (optional) + * @param int $page The page to filter on. Starts at 1. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function notificationIndexRequest($fromDate = null, $toDate = null, $types = null, $merchantOrderNos = null, $channelOrderNos = null, $merchantReturnNos = null, $channelReturnNos = null, $merchantShipmentNos = null, $page = null) + { + + $resourcePath = '/v2/notifications'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($fromDate !== null) { + $queryParams['fromDate'] = ObjectSerializer::toQueryValue($fromDate); + } + // query params + if ($toDate !== null) { + $queryParams['toDate'] = ObjectSerializer::toQueryValue($toDate); + } + // query params + if (is_array($types)) { + $queryParams['types'] = $types; + } else + if ($types !== null) { + $queryParams['types'] = ObjectSerializer::toQueryValue($types); + } + // query params + if (is_array($merchantOrderNos)) { + $queryParams['merchantOrderNos'] = $merchantOrderNos; + } else + if ($merchantOrderNos !== null) { + $queryParams['merchantOrderNos'] = ObjectSerializer::toQueryValue($merchantOrderNos); + } + // query params + if (is_array($channelOrderNos)) { + $queryParams['channelOrderNos'] = $channelOrderNos; + } else + if ($channelOrderNos !== null) { + $queryParams['channelOrderNos'] = ObjectSerializer::toQueryValue($channelOrderNos); + } + // query params + if (is_array($merchantReturnNos)) { + $queryParams['merchantReturnNos'] = $merchantReturnNos; + } else + if ($merchantReturnNos !== null) { + $queryParams['merchantReturnNos'] = ObjectSerializer::toQueryValue($merchantReturnNos); + } + // query params + if (is_array($channelReturnNos)) { + $queryParams['channelReturnNos'] = $channelReturnNos; + } else + if ($channelReturnNos !== null) { + $queryParams['channelReturnNos'] = ObjectSerializer::toQueryValue($channelReturnNos); + } + // query params + if (is_array($merchantShipmentNos)) { + $queryParams['merchantShipmentNos'] = $merchantShipmentNos; + } else + if ($merchantShipmentNos !== null) { + $queryParams['merchantShipmentNos'] = ObjectSerializer::toQueryValue($merchantShipmentNos); + } + // query params + if ($page !== null) { + $queryParams['page'] = ObjectSerializer::toQueryValue($page); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['text/plain', 'application/json', 'text/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + } + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apikey'); + if ($apiKey !== null) { + $queryParams['apikey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $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()); + } + } + + return $options; + } +} diff --git a/lib/Api/OfferApi.php b/lib/Api/OfferApi.php index 49f6eb7..f8f8290 100644 --- a/lib/Api/OfferApi.php +++ b/lib/Api/OfferApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** diff --git a/lib/Api/OrderApi.php b/lib/Api/OrderApi.php index 4249f12..80095fd 100644 --- a/lib/Api/OrderApi.php +++ b/lib/Api/OrderApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** diff --git a/lib/Api/ProductApi.php b/lib/Api/ProductApi.php index aeacbb1..4b97e56 100644 --- a/lib/Api/ProductApi.php +++ b/lib/Api/ProductApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** diff --git a/lib/Api/ProductBundleApi.php b/lib/Api/ProductBundleApi.php index e43fa02..e279425 100644 --- a/lib/Api/ProductBundleApi.php +++ b/lib/Api/ProductBundleApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** diff --git a/lib/Api/ReturnApi.php b/lib/Api/ReturnApi.php index 7230118..6e8d7d5 100644 --- a/lib/Api/ReturnApi.php +++ b/lib/Api/ReturnApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -389,7 +389,7 @@ protected function returnDeclareForMerchantRequest($model) * * @throws \ChannelEngine\Merchant\ApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \ChannelEngine\Merchant\ApiClient\Model\CollectionOfMerchantReturnResponse + * @return \ChannelEngine\Merchant\ApiClient\Model\CollectionOfMerchantSingleOrderReturnResponse */ public function returnGetByMerchantOrderNo($merchantOrderNo) { @@ -406,11 +406,11 @@ public function returnGetByMerchantOrderNo($merchantOrderNo) * * @throws \ChannelEngine\Merchant\ApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \ChannelEngine\Merchant\ApiClient\Model\CollectionOfMerchantReturnResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \ChannelEngine\Merchant\ApiClient\Model\CollectionOfMerchantSingleOrderReturnResponse, HTTP status code, HTTP response headers (array of strings) */ public function returnGetByMerchantOrderNoWithHttpInfo($merchantOrderNo) { - $returnType = '\ChannelEngine\Merchant\ApiClient\Model\CollectionOfMerchantReturnResponse'; + $returnType = '\ChannelEngine\Merchant\ApiClient\Model\CollectionOfMerchantSingleOrderReturnResponse'; $request = $this->returnGetByMerchantOrderNoRequest($merchantOrderNo); try { @@ -462,7 +462,7 @@ public function returnGetByMerchantOrderNoWithHttpInfo($merchantOrderNo) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\ChannelEngine\Merchant\ApiClient\Model\CollectionOfMerchantReturnResponse', + '\ChannelEngine\Merchant\ApiClient\Model\CollectionOfMerchantSingleOrderReturnResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -504,7 +504,7 @@ function ($response) { */ public function returnGetByMerchantOrderNoAsyncWithHttpInfo($merchantOrderNo) { - $returnType = '\ChannelEngine\Merchant\ApiClient\Model\CollectionOfMerchantReturnResponse'; + $returnType = '\ChannelEngine\Merchant\ApiClient\Model\CollectionOfMerchantSingleOrderReturnResponse'; $request = $this->returnGetByMerchantOrderNoRequest($merchantOrderNo); return $this->client diff --git a/lib/Api/ShipmentApi.php b/lib/Api/ShipmentApi.php index c2c39e5..3188702 100644 --- a/lib/Api/ShipmentApi.php +++ b/lib/Api/ShipmentApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** diff --git a/lib/Api/StockLocationApi.php b/lib/Api/StockLocationApi.php index 62f0be4..9caaec5 100644 --- a/lib/Api/StockLocationApi.php +++ b/lib/Api/StockLocationApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** diff --git a/lib/ApiException.php b/lib/ApiException.php index 87b61df..61be68e 100644 --- a/lib/ApiException.php +++ b/lib/ApiException.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** diff --git a/lib/Configuration.php b/lib/Configuration.php index 2acd324..ccad971 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -88,7 +88,7 @@ class Configuration * * @var string */ - protected $userAgent = 'Swagger-Codegen/2.8.2/php'; + protected $userAgent = 'Swagger-Codegen/2.8.5/php'; /** * Debug switch (default set to false) @@ -397,7 +397,7 @@ public static function toDebugReport() $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' OpenAPI Spec Version: 2.0.0' . PHP_EOL; - $report .= ' SDK Package Version: 2.8.2' . PHP_EOL; + $report .= ' SDK Package Version: 2.8.5' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php index 7e729ec..f6b2094 100644 --- a/lib/HeaderSelector.php +++ b/lib/HeaderSelector.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -107,4 +107,3 @@ private function selectContentTypeHeader($contentType) } } } - diff --git a/lib/Model/ApiResponse.php b/lib/Model/ApiResponse.php index 2dad0cb..1b44fd6 100644 --- a/lib/Model/ApiResponse.php +++ b/lib/Model/ApiResponse.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -224,8 +224,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/CollectionOfMerchantNotificationResponse.php b/lib/Model/CollectionOfMerchantNotificationResponse.php new file mode 100644 index 0000000..9a67ff9 --- /dev/null +++ b/lib/Model/CollectionOfMerchantNotificationResponse.php @@ -0,0 +1,541 @@ + '\ChannelEngine\Merchant\ApiClient\Model\MerchantNotificationResponse[]', + 'count' => 'int', + 'totalCount' => 'int', + 'itemsPerPage' => 'int', + 'statusCode' => 'int', + 'logId' => 'int', + 'success' => 'bool', + 'message' => 'string', + 'validationErrors' => 'map[string,string[]]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'content' => null, + 'count' => 'int32', + 'totalCount' => 'int32', + 'itemsPerPage' => 'int32', + 'statusCode' => 'int32', + 'logId' => 'int32', + 'success' => null, + 'message' => null, + 'validationErrors' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'content' => 'Content', + 'count' => 'Count', + 'totalCount' => 'TotalCount', + 'itemsPerPage' => 'ItemsPerPage', + 'statusCode' => 'StatusCode', + 'logId' => 'LogId', + 'success' => 'Success', + 'message' => 'Message', + 'validationErrors' => 'ValidationErrors' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent', + 'count' => 'setCount', + 'totalCount' => 'setTotalCount', + 'itemsPerPage' => 'setItemsPerPage', + 'statusCode' => 'setStatusCode', + 'logId' => 'setLogId', + 'success' => 'setSuccess', + 'message' => 'setMessage', + 'validationErrors' => 'setValidationErrors' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent', + 'count' => 'getCount', + 'totalCount' => 'getTotalCount', + 'itemsPerPage' => 'getItemsPerPage', + 'statusCode' => 'getStatusCode', + 'logId' => 'getLogId', + 'success' => 'getSuccess', + 'message' => 'getMessage', + 'validationErrors' => 'getValidationErrors' + ]; + + /** + * 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::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['content'] = isset($data['content']) ? $data['content'] : null; + $this->container['count'] = isset($data['count']) ? $data['count'] : null; + $this->container['totalCount'] = isset($data['totalCount']) ? $data['totalCount'] : null; + $this->container['itemsPerPage'] = isset($data['itemsPerPage']) ? $data['itemsPerPage'] : null; + $this->container['statusCode'] = isset($data['statusCode']) ? $data['statusCode'] : null; + $this->container['logId'] = isset($data['logId']) ? $data['logId'] : null; + $this->container['success'] = isset($data['success']) ? $data['success'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + $this->container['validationErrors'] = isset($data['validationErrors']) ? $data['validationErrors'] : null; + } + + /** + * 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 content + * + * @return \ChannelEngine\Merchant\ApiClient\Model\MerchantNotificationResponse[] + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param \ChannelEngine\Merchant\ApiClient\Model\MerchantNotificationResponse[] $content content + * + * @return $this + */ + public function setContent($content) + { + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count The number of items in the current response + * + * @return $this + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets totalCount + * + * @return int + */ + public function getTotalCount() + { + return $this->container['totalCount']; + } + + /** + * Sets totalCount + * + * @param int $totalCount The total number of items + * + * @return $this + */ + public function setTotalCount($totalCount) + { + $this->container['totalCount'] = $totalCount; + + return $this; + } + + /** + * Gets itemsPerPage + * + * @return int + */ + public function getItemsPerPage() + { + return $this->container['itemsPerPage']; + } + + /** + * Sets itemsPerPage + * + * @param int $itemsPerPage The number of items per page + * + * @return $this + */ + public function setItemsPerPage($itemsPerPage) + { + $this->container['itemsPerPage'] = $itemsPerPage; + + return $this; + } + + /** + * Gets statusCode + * + * @return int + */ + public function getStatusCode() + { + return $this->container['statusCode']; + } + + /** + * Sets statusCode + * + * @param int $statusCode statusCode + * + * @return $this + */ + public function setStatusCode($statusCode) + { + $this->container['statusCode'] = $statusCode; + + return $this; + } + + /** + * Gets logId + * + * @return int + */ + public function getLogId() + { + return $this->container['logId']; + } + + /** + * Sets logId + * + * @param int $logId logId + * + * @return $this + */ + public function setLogId($logId) + { + $this->container['logId'] = $logId; + + return $this; + } + + /** + * Gets success + * + * @return bool + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool $success success + * + * @return $this + */ + public function setSuccess($success) + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message message + * + * @return $this + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets validationErrors + * + * @return map[string,string[]] + */ + public function getValidationErrors() + { + return $this->container['validationErrors']; + } + + /** + * Sets validationErrors + * + * @param map[string,string[]] $validationErrors validationErrors + * + * @return $this + */ + public function setValidationErrors($validationErrors) + { + $this->container['validationErrors'] = $validationErrors; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CollectionOfMerchantOfferGetStockResponse.php b/lib/Model/CollectionOfMerchantOfferGetStockResponse.php index 2dd1a1d..24c5e26 100644 --- a/lib/Model/CollectionOfMerchantOfferGetStockResponse.php +++ b/lib/Model/CollectionOfMerchantOfferGetStockResponse.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -248,8 +248,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/CollectionOfMerchantOrderResponse.php b/lib/Model/CollectionOfMerchantOrderResponse.php index 2978087..e47c8aa 100644 --- a/lib/Model/CollectionOfMerchantOrderResponse.php +++ b/lib/Model/CollectionOfMerchantOrderResponse.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -248,8 +248,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/CollectionOfMerchantProductBundleResponse.php b/lib/Model/CollectionOfMerchantProductBundleResponse.php index adf96cf..3b47cf6 100644 --- a/lib/Model/CollectionOfMerchantProductBundleResponse.php +++ b/lib/Model/CollectionOfMerchantProductBundleResponse.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -248,8 +248,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/CollectionOfMerchantProductResponse.php b/lib/Model/CollectionOfMerchantProductResponse.php index 432f775..d037b44 100644 --- a/lib/Model/CollectionOfMerchantProductResponse.php +++ b/lib/Model/CollectionOfMerchantProductResponse.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -248,8 +248,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/CollectionOfMerchantReturnResponse.php b/lib/Model/CollectionOfMerchantReturnResponse.php index b9df0aa..086957f 100644 --- a/lib/Model/CollectionOfMerchantReturnResponse.php +++ b/lib/Model/CollectionOfMerchantReturnResponse.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -248,8 +248,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/CollectionOfMerchantSingleOrderReturnResponse.php b/lib/Model/CollectionOfMerchantSingleOrderReturnResponse.php new file mode 100644 index 0000000..ccc9b17 --- /dev/null +++ b/lib/Model/CollectionOfMerchantSingleOrderReturnResponse.php @@ -0,0 +1,541 @@ + '\ChannelEngine\Merchant\ApiClient\Model\MerchantSingleOrderReturnResponse[]', + 'count' => 'int', + 'totalCount' => 'int', + 'itemsPerPage' => 'int', + 'statusCode' => 'int', + 'logId' => 'int', + 'success' => 'bool', + 'message' => 'string', + 'validationErrors' => 'map[string,string[]]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'content' => null, + 'count' => 'int32', + 'totalCount' => 'int32', + 'itemsPerPage' => 'int32', + 'statusCode' => 'int32', + 'logId' => 'int32', + 'success' => null, + 'message' => null, + 'validationErrors' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'content' => 'Content', + 'count' => 'Count', + 'totalCount' => 'TotalCount', + 'itemsPerPage' => 'ItemsPerPage', + 'statusCode' => 'StatusCode', + 'logId' => 'LogId', + 'success' => 'Success', + 'message' => 'Message', + 'validationErrors' => 'ValidationErrors' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent', + 'count' => 'setCount', + 'totalCount' => 'setTotalCount', + 'itemsPerPage' => 'setItemsPerPage', + 'statusCode' => 'setStatusCode', + 'logId' => 'setLogId', + 'success' => 'setSuccess', + 'message' => 'setMessage', + 'validationErrors' => 'setValidationErrors' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent', + 'count' => 'getCount', + 'totalCount' => 'getTotalCount', + 'itemsPerPage' => 'getItemsPerPage', + 'statusCode' => 'getStatusCode', + 'logId' => 'getLogId', + 'success' => 'getSuccess', + 'message' => 'getMessage', + 'validationErrors' => 'getValidationErrors' + ]; + + /** + * 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::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['content'] = isset($data['content']) ? $data['content'] : null; + $this->container['count'] = isset($data['count']) ? $data['count'] : null; + $this->container['totalCount'] = isset($data['totalCount']) ? $data['totalCount'] : null; + $this->container['itemsPerPage'] = isset($data['itemsPerPage']) ? $data['itemsPerPage'] : null; + $this->container['statusCode'] = isset($data['statusCode']) ? $data['statusCode'] : null; + $this->container['logId'] = isset($data['logId']) ? $data['logId'] : null; + $this->container['success'] = isset($data['success']) ? $data['success'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + $this->container['validationErrors'] = isset($data['validationErrors']) ? $data['validationErrors'] : null; + } + + /** + * 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 content + * + * @return \ChannelEngine\Merchant\ApiClient\Model\MerchantSingleOrderReturnResponse[] + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param \ChannelEngine\Merchant\ApiClient\Model\MerchantSingleOrderReturnResponse[] $content content + * + * @return $this + */ + public function setContent($content) + { + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count The number of items in the current response + * + * @return $this + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets totalCount + * + * @return int + */ + public function getTotalCount() + { + return $this->container['totalCount']; + } + + /** + * Sets totalCount + * + * @param int $totalCount The total number of items + * + * @return $this + */ + public function setTotalCount($totalCount) + { + $this->container['totalCount'] = $totalCount; + + return $this; + } + + /** + * Gets itemsPerPage + * + * @return int + */ + public function getItemsPerPage() + { + return $this->container['itemsPerPage']; + } + + /** + * Sets itemsPerPage + * + * @param int $itemsPerPage The number of items per page + * + * @return $this + */ + public function setItemsPerPage($itemsPerPage) + { + $this->container['itemsPerPage'] = $itemsPerPage; + + return $this; + } + + /** + * Gets statusCode + * + * @return int + */ + public function getStatusCode() + { + return $this->container['statusCode']; + } + + /** + * Sets statusCode + * + * @param int $statusCode statusCode + * + * @return $this + */ + public function setStatusCode($statusCode) + { + $this->container['statusCode'] = $statusCode; + + return $this; + } + + /** + * Gets logId + * + * @return int + */ + public function getLogId() + { + return $this->container['logId']; + } + + /** + * Sets logId + * + * @param int $logId logId + * + * @return $this + */ + public function setLogId($logId) + { + $this->container['logId'] = $logId; + + return $this; + } + + /** + * Gets success + * + * @return bool + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool $success success + * + * @return $this + */ + public function setSuccess($success) + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message message + * + * @return $this + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets validationErrors + * + * @return map[string,string[]] + */ + public function getValidationErrors() + { + return $this->container['validationErrors']; + } + + /** + * Sets validationErrors + * + * @param map[string,string[]] $validationErrors validationErrors + * + * @return $this + */ + public function setValidationErrors($validationErrors) + { + $this->container['validationErrors'] = $validationErrors; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CollectionOfMerchantStockLocationResponse.php b/lib/Model/CollectionOfMerchantStockLocationResponse.php index debc0d2..a1f7184 100644 --- a/lib/Model/CollectionOfMerchantStockLocationResponse.php +++ b/lib/Model/CollectionOfMerchantStockLocationResponse.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -248,8 +248,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/MerchantAddressResponse.php b/lib/Model/MerchantAddressResponse.php index 424495b..8a554bb 100644 --- a/lib/Model/MerchantAddressResponse.php +++ b/lib/Model/MerchantAddressResponse.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -291,90 +291,90 @@ public function listInvalidProperties() $invalidProperties = []; $allowedValues = $this->getGenderAllowableValues(); - if (!in_array($this->container['gender'], $allowedValues)) { + if (!is_null($this->container['gender']) && !in_array($this->container['gender'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'gender', must be one of '%s'", implode("', '", $allowedValues) ); } - if (!is_null($this->container['companyName']) && (strlen($this->container['companyName']) > 50)) { + if (!is_null($this->container['companyName']) && (mb_strlen($this->container['companyName']) > 50)) { $invalidProperties[] = "invalid value for 'companyName', the character length must be smaller than or equal to 50."; } - if (!is_null($this->container['companyName']) && (strlen($this->container['companyName']) < 0)) { + if (!is_null($this->container['companyName']) && (mb_strlen($this->container['companyName']) < 0)) { $invalidProperties[] = "invalid value for 'companyName', the character length must be bigger than or equal to 0."; } - if (!is_null($this->container['firstName']) && (strlen($this->container['firstName']) > 50)) { + if (!is_null($this->container['firstName']) && (mb_strlen($this->container['firstName']) > 50)) { $invalidProperties[] = "invalid value for 'firstName', the character length must be smaller than or equal to 50."; } - if (!is_null($this->container['firstName']) && (strlen($this->container['firstName']) < 0)) { + if (!is_null($this->container['firstName']) && (mb_strlen($this->container['firstName']) < 0)) { $invalidProperties[] = "invalid value for 'firstName', the character length must be bigger than or equal to 0."; } - if (!is_null($this->container['lastName']) && (strlen($this->container['lastName']) > 50)) { + if (!is_null($this->container['lastName']) && (mb_strlen($this->container['lastName']) > 50)) { $invalidProperties[] = "invalid value for 'lastName', the character length must be smaller than or equal to 50."; } - if (!is_null($this->container['lastName']) && (strlen($this->container['lastName']) < 0)) { + if (!is_null($this->container['lastName']) && (mb_strlen($this->container['lastName']) < 0)) { $invalidProperties[] = "invalid value for 'lastName', the character length must be bigger than or equal to 0."; } - if (!is_null($this->container['streetName']) && (strlen($this->container['streetName']) > 50)) { + if (!is_null($this->container['streetName']) && (mb_strlen($this->container['streetName']) > 50)) { $invalidProperties[] = "invalid value for 'streetName', the character length must be smaller than or equal to 50."; } - if (!is_null($this->container['streetName']) && (strlen($this->container['streetName']) < 0)) { + if (!is_null($this->container['streetName']) && (mb_strlen($this->container['streetName']) < 0)) { $invalidProperties[] = "invalid value for 'streetName', the character length must be bigger than or equal to 0."; } - if (!is_null($this->container['houseNr']) && (strlen($this->container['houseNr']) > 50)) { + if (!is_null($this->container['houseNr']) && (mb_strlen($this->container['houseNr']) > 50)) { $invalidProperties[] = "invalid value for 'houseNr', the character length must be smaller than or equal to 50."; } - if (!is_null($this->container['houseNr']) && (strlen($this->container['houseNr']) < 0)) { + if (!is_null($this->container['houseNr']) && (mb_strlen($this->container['houseNr']) < 0)) { $invalidProperties[] = "invalid value for 'houseNr', the character length must be bigger than or equal to 0."; } - if (!is_null($this->container['houseNrAddition']) && (strlen($this->container['houseNrAddition']) > 50)) { + if (!is_null($this->container['houseNrAddition']) && (mb_strlen($this->container['houseNrAddition']) > 50)) { $invalidProperties[] = "invalid value for 'houseNrAddition', the character length must be smaller than or equal to 50."; } - if (!is_null($this->container['houseNrAddition']) && (strlen($this->container['houseNrAddition']) < 0)) { + if (!is_null($this->container['houseNrAddition']) && (mb_strlen($this->container['houseNrAddition']) < 0)) { $invalidProperties[] = "invalid value for 'houseNrAddition', the character length must be bigger than or equal to 0."; } - if (!is_null($this->container['city']) && (strlen($this->container['city']) > 50)) { + if (!is_null($this->container['city']) && (mb_strlen($this->container['city']) > 50)) { $invalidProperties[] = "invalid value for 'city', the character length must be smaller than or equal to 50."; } - if (!is_null($this->container['city']) && (strlen($this->container['city']) < 0)) { + if (!is_null($this->container['city']) && (mb_strlen($this->container['city']) < 0)) { $invalidProperties[] = "invalid value for 'city', the character length must be bigger than or equal to 0."; } - if (!is_null($this->container['region']) && (strlen($this->container['region']) > 50)) { + if (!is_null($this->container['region']) && (mb_strlen($this->container['region']) > 50)) { $invalidProperties[] = "invalid value for 'region', the character length must be smaller than or equal to 50."; } - if (!is_null($this->container['region']) && (strlen($this->container['region']) < 0)) { + if (!is_null($this->container['region']) && (mb_strlen($this->container['region']) < 0)) { $invalidProperties[] = "invalid value for 'region', the character length must be bigger than or equal to 0."; } - if (!is_null($this->container['countryIso']) && (strlen($this->container['countryIso']) > 2)) { + if (!is_null($this->container['countryIso']) && (mb_strlen($this->container['countryIso']) > 2)) { $invalidProperties[] = "invalid value for 'countryIso', the character length must be smaller than or equal to 2."; } - if (!is_null($this->container['countryIso']) && (strlen($this->container['countryIso']) < 0)) { + if (!is_null($this->container['countryIso']) && (mb_strlen($this->container['countryIso']) < 0)) { $invalidProperties[] = "invalid value for 'countryIso', the character length must be bigger than or equal to 0."; } - if (!is_null($this->container['original']) && (strlen($this->container['original']) > 256)) { + if (!is_null($this->container['original']) && (mb_strlen($this->container['original']) > 256)) { $invalidProperties[] = "invalid value for 'original', the character length must be smaller than or equal to 256."; } - if (!is_null($this->container['original']) && (strlen($this->container['original']) < 0)) { + if (!is_null($this->container['original']) && (mb_strlen($this->container['original']) < 0)) { $invalidProperties[] = "invalid value for 'original', the character length must be bigger than or equal to 0."; } @@ -389,72 +389,7 @@ public function listInvalidProperties() */ public function valid() { - - $allowedValues = $this->getGenderAllowableValues(); - if (!in_array($this->container['gender'], $allowedValues)) { - return false; - } - if (strlen($this->container['companyName']) > 50) { - return false; - } - if (strlen($this->container['companyName']) < 0) { - return false; - } - if (strlen($this->container['firstName']) > 50) { - return false; - } - if (strlen($this->container['firstName']) < 0) { - return false; - } - if (strlen($this->container['lastName']) > 50) { - return false; - } - if (strlen($this->container['lastName']) < 0) { - return false; - } - if (strlen($this->container['streetName']) > 50) { - return false; - } - if (strlen($this->container['streetName']) < 0) { - return false; - } - if (strlen($this->container['houseNr']) > 50) { - return false; - } - if (strlen($this->container['houseNr']) < 0) { - return false; - } - if (strlen($this->container['houseNrAddition']) > 50) { - return false; - } - if (strlen($this->container['houseNrAddition']) < 0) { - return false; - } - if (strlen($this->container['city']) > 50) { - return false; - } - if (strlen($this->container['city']) < 0) { - return false; - } - if (strlen($this->container['region']) > 50) { - return false; - } - if (strlen($this->container['region']) < 0) { - return false; - } - if (strlen($this->container['countryIso']) > 2) { - return false; - } - if (strlen($this->container['countryIso']) < 0) { - return false; - } - if (strlen($this->container['original']) > 256) { - return false; - } - if (strlen($this->container['original']) < 0) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -550,7 +485,7 @@ public function getGender() public function setGender($gender) { $allowedValues = $this->getGenderAllowableValues(); - if (!is_null($gender) && !in_array($gender, $allowedValues)) { + if (!is_null($gender) && !in_array($gender, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'gender', must be one of '%s'", @@ -582,10 +517,10 @@ public function getCompanyName() */ public function setCompanyName($companyName) { - if (!is_null($companyName) && (strlen($companyName) > 50)) { + if (!is_null($companyName) && (mb_strlen($companyName) > 50)) { throw new \InvalidArgumentException('invalid length for $companyName when calling MerchantAddressResponse., must be smaller than or equal to 50.'); } - if (!is_null($companyName) && (strlen($companyName) < 0)) { + if (!is_null($companyName) && (mb_strlen($companyName) < 0)) { throw new \InvalidArgumentException('invalid length for $companyName when calling MerchantAddressResponse., must be bigger than or equal to 0.'); } @@ -613,10 +548,10 @@ public function getFirstName() */ public function setFirstName($firstName) { - if (!is_null($firstName) && (strlen($firstName) > 50)) { + if (!is_null($firstName) && (mb_strlen($firstName) > 50)) { throw new \InvalidArgumentException('invalid length for $firstName when calling MerchantAddressResponse., must be smaller than or equal to 50.'); } - if (!is_null($firstName) && (strlen($firstName) < 0)) { + if (!is_null($firstName) && (mb_strlen($firstName) < 0)) { throw new \InvalidArgumentException('invalid length for $firstName when calling MerchantAddressResponse., must be bigger than or equal to 0.'); } @@ -644,10 +579,10 @@ public function getLastName() */ public function setLastName($lastName) { - if (!is_null($lastName) && (strlen($lastName) > 50)) { + if (!is_null($lastName) && (mb_strlen($lastName) > 50)) { throw new \InvalidArgumentException('invalid length for $lastName when calling MerchantAddressResponse., must be smaller than or equal to 50.'); } - if (!is_null($lastName) && (strlen($lastName) < 0)) { + if (!is_null($lastName) && (mb_strlen($lastName) < 0)) { throw new \InvalidArgumentException('invalid length for $lastName when calling MerchantAddressResponse., must be bigger than or equal to 0.'); } @@ -675,10 +610,10 @@ public function getStreetName() */ public function setStreetName($streetName) { - if (!is_null($streetName) && (strlen($streetName) > 50)) { + if (!is_null($streetName) && (mb_strlen($streetName) > 50)) { throw new \InvalidArgumentException('invalid length for $streetName when calling MerchantAddressResponse., must be smaller than or equal to 50.'); } - if (!is_null($streetName) && (strlen($streetName) < 0)) { + if (!is_null($streetName) && (mb_strlen($streetName) < 0)) { throw new \InvalidArgumentException('invalid length for $streetName when calling MerchantAddressResponse., must be bigger than or equal to 0.'); } @@ -706,10 +641,10 @@ public function getHouseNr() */ public function setHouseNr($houseNr) { - if (!is_null($houseNr) && (strlen($houseNr) > 50)) { + if (!is_null($houseNr) && (mb_strlen($houseNr) > 50)) { throw new \InvalidArgumentException('invalid length for $houseNr when calling MerchantAddressResponse., must be smaller than or equal to 50.'); } - if (!is_null($houseNr) && (strlen($houseNr) < 0)) { + if (!is_null($houseNr) && (mb_strlen($houseNr) < 0)) { throw new \InvalidArgumentException('invalid length for $houseNr when calling MerchantAddressResponse., must be bigger than or equal to 0.'); } @@ -737,10 +672,10 @@ public function getHouseNrAddition() */ public function setHouseNrAddition($houseNrAddition) { - if (!is_null($houseNrAddition) && (strlen($houseNrAddition) > 50)) { + if (!is_null($houseNrAddition) && (mb_strlen($houseNrAddition) > 50)) { throw new \InvalidArgumentException('invalid length for $houseNrAddition when calling MerchantAddressResponse., must be smaller than or equal to 50.'); } - if (!is_null($houseNrAddition) && (strlen($houseNrAddition) < 0)) { + if (!is_null($houseNrAddition) && (mb_strlen($houseNrAddition) < 0)) { throw new \InvalidArgumentException('invalid length for $houseNrAddition when calling MerchantAddressResponse., must be bigger than or equal to 0.'); } @@ -792,10 +727,10 @@ public function getCity() */ public function setCity($city) { - if (!is_null($city) && (strlen($city) > 50)) { + if (!is_null($city) && (mb_strlen($city) > 50)) { throw new \InvalidArgumentException('invalid length for $city when calling MerchantAddressResponse., must be smaller than or equal to 50.'); } - if (!is_null($city) && (strlen($city) < 0)) { + if (!is_null($city) && (mb_strlen($city) < 0)) { throw new \InvalidArgumentException('invalid length for $city when calling MerchantAddressResponse., must be bigger than or equal to 0.'); } @@ -823,10 +758,10 @@ public function getRegion() */ public function setRegion($region) { - if (!is_null($region) && (strlen($region) > 50)) { + if (!is_null($region) && (mb_strlen($region) > 50)) { throw new \InvalidArgumentException('invalid length for $region when calling MerchantAddressResponse., must be smaller than or equal to 50.'); } - if (!is_null($region) && (strlen($region) < 0)) { + if (!is_null($region) && (mb_strlen($region) < 0)) { throw new \InvalidArgumentException('invalid length for $region when calling MerchantAddressResponse., must be bigger than or equal to 0.'); } @@ -854,10 +789,10 @@ public function getCountryIso() */ public function setCountryIso($countryIso) { - if (!is_null($countryIso) && (strlen($countryIso) > 2)) { + if (!is_null($countryIso) && (mb_strlen($countryIso) > 2)) { throw new \InvalidArgumentException('invalid length for $countryIso when calling MerchantAddressResponse., must be smaller than or equal to 2.'); } - if (!is_null($countryIso) && (strlen($countryIso) < 0)) { + if (!is_null($countryIso) && (mb_strlen($countryIso) < 0)) { throw new \InvalidArgumentException('invalid length for $countryIso when calling MerchantAddressResponse., must be bigger than or equal to 0.'); } @@ -885,10 +820,10 @@ public function getOriginal() */ public function setOriginal($original) { - if (!is_null($original) && (strlen($original) > 256)) { + if (!is_null($original) && (mb_strlen($original) > 256)) { throw new \InvalidArgumentException('invalid length for $original when calling MerchantAddressResponse., must be smaller than or equal to 256.'); } - if (!is_null($original) && (strlen($original) < 0)) { + if (!is_null($original) && (mb_strlen($original) < 0)) { throw new \InvalidArgumentException('invalid length for $original when calling MerchantAddressResponse., must be bigger than or equal to 0.'); } diff --git a/lib/Model/MerchantCancellationLineRequest.php b/lib/Model/MerchantCancellationLineRequest.php index 0ab5de9..c482b19 100644 --- a/lib/Model/MerchantCancellationLineRequest.php +++ b/lib/Model/MerchantCancellationLineRequest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['merchantProductNo'] === null) { - return false; - } - if ($this->container['quantity'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/MerchantCancellationRequest.php b/lib/Model/MerchantCancellationRequest.php index f8fbdff..ec0a73f 100644 --- a/lib/Model/MerchantCancellationRequest.php +++ b/lib/Model/MerchantCancellationRequest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -246,7 +246,7 @@ public function listInvalidProperties() $invalidProperties[] = "'lines' can't be null"; } $allowedValues = $this->getReasonCodeAllowableValues(); - if (!in_array($this->container['reasonCode'], $allowedValues)) { + if (!is_null($this->container['reasonCode']) && !in_array($this->container['reasonCode'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'reasonCode', must be one of '%s'", implode("', '", $allowedValues) @@ -264,21 +264,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['merchantCancellationNo'] === null) { - return false; - } - if ($this->container['merchantOrderNo'] === null) { - return false; - } - if ($this->container['lines'] === null) { - return false; - } - $allowedValues = $this->getReasonCodeAllowableValues(); - if (!in_array($this->container['reasonCode'], $allowedValues)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -398,7 +384,7 @@ public function getReasonCode() public function setReasonCode($reasonCode) { $allowedValues = $this->getReasonCodeAllowableValues(); - if (!is_null($reasonCode) && !in_array($reasonCode, $allowedValues)) { + if (!is_null($reasonCode) && !in_array($reasonCode, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'reasonCode', must be one of '%s'", diff --git a/lib/Model/MerchantNotificationResponse.php b/lib/Model/MerchantNotificationResponse.php new file mode 100644 index 0000000..f1ff79b --- /dev/null +++ b/lib/Model/MerchantNotificationResponse.php @@ -0,0 +1,451 @@ + 'int', + 'read' => 'bool', + 'createdAt' => '\DateTime', + 'message' => 'string', + 'subject' => 'string', + 'count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int32', + 'read' => null, + 'createdAt' => 'date-time', + 'message' => null, + 'subject' => null, + 'count' => 'int32' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'Id', + 'read' => 'Read', + 'createdAt' => 'CreatedAt', + 'message' => 'Message', + 'subject' => 'Subject', + 'count' => 'Count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'read' => 'setRead', + 'createdAt' => 'setCreatedAt', + 'message' => 'setMessage', + 'subject' => 'setSubject', + 'count' => 'setCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'read' => 'getRead', + 'createdAt' => 'getCreatedAt', + 'message' => 'getMessage', + 'subject' => 'getSubject', + 'count' => 'getCount' + ]; + + /** + * 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::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['read'] = isset($data['read']) ? $data['read'] : null; + $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null; + $this->container['count'] = isset($data['count']) ? $data['count'] : null; + } + + /** + * 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 id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Unique identifier used by ChannelEngine + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets read + * + * @return bool + */ + public function getRead() + { + return $this->container['read']; + } + + /** + * Sets read + * + * @param bool $read Indicating whether the notification is already read using the backoffice + * + * @return $this + */ + public function setRead($read) + { + $this->container['read'] = $read; + + return $this; + } + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Get the created date time + * + * @return $this + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message message + * + * @return $this + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets subject + * + * @return string + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string $subject subject + * + * @return $this + */ + public function setSubject($subject) + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count count + * + * @return $this + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/MerchantOfferGetStockResponse.php b/lib/Model/MerchantOfferGetStockResponse.php index a353dfb..88c3174 100644 --- a/lib/Model/MerchantOfferGetStockResponse.php +++ b/lib/Model/MerchantOfferGetStockResponse.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -59,7 +59,8 @@ class MerchantOfferGetStockResponse implements ModelInterface, ArrayAccess protected static $swaggerTypes = [ 'merchantProductNo' => 'string', 'stockLocationId' => 'int', - 'stock' => 'int' + 'stock' => 'int', + 'updatedAt' => '\DateTime' ]; /** @@ -70,7 +71,8 @@ class MerchantOfferGetStockResponse implements ModelInterface, ArrayAccess protected static $swaggerFormats = [ 'merchantProductNo' => null, 'stockLocationId' => 'int32', - 'stock' => 'int32' + 'stock' => 'int32', + 'updatedAt' => 'date-time' ]; /** @@ -102,7 +104,8 @@ public static function swaggerFormats() protected static $attributeMap = [ 'merchantProductNo' => 'MerchantProductNo', 'stockLocationId' => 'StockLocationId', - 'stock' => 'Stock' + 'stock' => 'Stock', + 'updatedAt' => 'UpdatedAt' ]; /** @@ -113,7 +116,8 @@ public static function swaggerFormats() protected static $setters = [ 'merchantProductNo' => 'setMerchantProductNo', 'stockLocationId' => 'setStockLocationId', - 'stock' => 'setStock' + 'stock' => 'setStock', + 'updatedAt' => 'setUpdatedAt' ]; /** @@ -124,7 +128,8 @@ public static function swaggerFormats() protected static $getters = [ 'merchantProductNo' => 'getMerchantProductNo', 'stockLocationId' => 'getStockLocationId', - 'stock' => 'getStock' + 'stock' => 'getStock', + 'updatedAt' => 'getUpdatedAt' ]; /** @@ -190,6 +195,7 @@ public function __construct(array $data = null) $this->container['merchantProductNo'] = isset($data['merchantProductNo']) ? $data['merchantProductNo'] : null; $this->container['stockLocationId'] = isset($data['stockLocationId']) ? $data['stockLocationId'] : null; $this->container['stock'] = isset($data['stock']) ? $data['stock'] : null; + $this->container['updatedAt'] = isset($data['updatedAt']) ? $data['updatedAt'] : null; } /** @@ -212,8 +218,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -288,6 +293,30 @@ public function setStock($stock) return $this; } + + /** + * Gets updatedAt + * + * @return \DateTime + */ + public function getUpdatedAt() + { + return $this->container['updatedAt']; + } + + /** + * Sets updatedAt + * + * @param \DateTime $updatedAt The timestamp of the last stock update for the stock location + * + * @return $this + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/MerchantOrderAcknowledgementRequest.php b/lib/Model/MerchantOrderAcknowledgementRequest.php index d3aa56d..2d09f3c 100644 --- a/lib/Model/MerchantOrderAcknowledgementRequest.php +++ b/lib/Model/MerchantOrderAcknowledgementRequest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -198,11 +198,11 @@ public function listInvalidProperties() if ($this->container['merchantOrderNo'] === null) { $invalidProperties[] = "'merchantOrderNo' can't be null"; } - if ((strlen($this->container['merchantOrderNo']) > 50)) { + if ((mb_strlen($this->container['merchantOrderNo']) > 50)) { $invalidProperties[] = "invalid value for 'merchantOrderNo', the character length must be smaller than or equal to 50."; } - if ((strlen($this->container['merchantOrderNo']) < 0)) { + if ((mb_strlen($this->container['merchantOrderNo']) < 0)) { $invalidProperties[] = "invalid value for 'merchantOrderNo', the character length must be bigger than or equal to 0."; } @@ -220,20 +220,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['merchantOrderNo'] === null) { - return false; - } - if (strlen($this->container['merchantOrderNo']) > 50) { - return false; - } - if (strlen($this->container['merchantOrderNo']) < 0) { - return false; - } - if ($this->container['orderId'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -256,10 +243,10 @@ public function getMerchantOrderNo() */ public function setMerchantOrderNo($merchantOrderNo) { - if ((strlen($merchantOrderNo) > 50)) { + if ((mb_strlen($merchantOrderNo) > 50)) { throw new \InvalidArgumentException('invalid length for $merchantOrderNo when calling MerchantOrderAcknowledgementRequest., must be smaller than or equal to 50.'); } - if ((strlen($merchantOrderNo) < 0)) { + if ((mb_strlen($merchantOrderNo) < 0)) { throw new \InvalidArgumentException('invalid length for $merchantOrderNo when calling MerchantOrderAcknowledgementRequest., must be bigger than or equal to 0.'); } diff --git a/lib/Model/MerchantOrderLineResponse.php b/lib/Model/MerchantOrderLineResponse.php index 4331f1c..cba3ea1 100644 --- a/lib/Model/MerchantOrderLineResponse.php +++ b/lib/Model/MerchantOrderLineResponse.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -354,7 +354,7 @@ public function listInvalidProperties() $invalidProperties = []; $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowedValues)) { + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'status', must be one of '%s'", implode("', '", $allowedValues) @@ -364,11 +364,11 @@ public function listInvalidProperties() if ($this->container['channelProductNo'] === null) { $invalidProperties[] = "'channelProductNo' can't be null"; } - if ((strlen($this->container['channelProductNo']) > 50)) { + if ((mb_strlen($this->container['channelProductNo']) > 50)) { $invalidProperties[] = "invalid value for 'channelProductNo', the character length must be smaller than or equal to 50."; } - if ((strlen($this->container['channelProductNo']) < 0)) { + if ((mb_strlen($this->container['channelProductNo']) < 0)) { $invalidProperties[] = "invalid value for 'channelProductNo', the character length must be bigger than or equal to 0."; } @@ -379,7 +379,7 @@ public function listInvalidProperties() $invalidProperties[] = "'unitPriceInclVat' can't be null"; } $allowedValues = $this->getConditionAllowableValues(); - if (!in_array($this->container['condition'], $allowedValues)) { + if (!is_null($this->container['condition']) && !in_array($this->container['condition'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'condition', must be one of '%s'", implode("', '", $allowedValues) @@ -397,31 +397,7 @@ public function listInvalidProperties() */ public function valid() { - - $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowedValues)) { - return false; - } - if ($this->container['channelProductNo'] === null) { - return false; - } - if (strlen($this->container['channelProductNo']) > 50) { - return false; - } - if (strlen($this->container['channelProductNo']) < 0) { - return false; - } - if ($this->container['quantity'] === null) { - return false; - } - if ($this->container['unitPriceInclVat'] === null) { - return false; - } - $allowedValues = $this->getConditionAllowableValues(); - if (!in_array($this->container['condition'], $allowedValues)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -445,7 +421,7 @@ public function getStatus() public function setStatus($status) { $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($status) && !in_array($status, $allowedValues)) { + if (!is_null($status) && !in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'status', must be one of '%s'", @@ -741,10 +717,10 @@ public function getChannelProductNo() */ public function setChannelProductNo($channelProductNo) { - if ((strlen($channelProductNo) > 50)) { + if ((mb_strlen($channelProductNo) > 50)) { throw new \InvalidArgumentException('invalid length for $channelProductNo when calling MerchantOrderLineResponse., must be smaller than or equal to 50.'); } - if ((strlen($channelProductNo) < 0)) { + if ((mb_strlen($channelProductNo) < 0)) { throw new \InvalidArgumentException('invalid length for $channelProductNo when calling MerchantOrderLineResponse., must be bigger than or equal to 0.'); } @@ -893,7 +869,7 @@ public function getCondition() public function setCondition($condition) { $allowedValues = $this->getConditionAllowableValues(); - if (!is_null($condition) && !in_array($condition, $allowedValues)) { + if (!is_null($condition) && !in_array($condition, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'condition', must be one of '%s'", diff --git a/lib/Model/MerchantOrderResponse.php b/lib/Model/MerchantOrderResponse.php index 14fb2ee..b503e3d 100644 --- a/lib/Model/MerchantOrderResponse.php +++ b/lib/Model/MerchantOrderResponse.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -412,7 +412,7 @@ public function listInvalidProperties() $invalidProperties = []; $allowedValues = $this->getChannelOrderSupportAllowableValues(); - if (!in_array($this->container['channelOrderSupport'], $allowedValues)) { + if (!is_null($this->container['channelOrderSupport']) && !in_array($this->container['channelOrderSupport'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'channelOrderSupport', must be one of '%s'", implode("', '", $allowedValues) @@ -420,53 +420,53 @@ public function listInvalidProperties() } $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowedValues)) { + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'status', must be one of '%s'", implode("', '", $allowedValues) ); } - if (!is_null($this->container['phone']) && (strlen($this->container['phone']) > 20)) { + if (!is_null($this->container['phone']) && (mb_strlen($this->container['phone']) > 20)) { $invalidProperties[] = "invalid value for 'phone', the character length must be smaller than or equal to 20."; } - if (!is_null($this->container['phone']) && (strlen($this->container['phone']) < 0)) { + if (!is_null($this->container['phone']) && (mb_strlen($this->container['phone']) < 0)) { $invalidProperties[] = "invalid value for 'phone', the character length must be bigger than or equal to 0."; } if ($this->container['email'] === null) { $invalidProperties[] = "'email' can't be null"; } - if ((strlen($this->container['email']) > 250)) { + if ((mb_strlen($this->container['email']) > 250)) { $invalidProperties[] = "invalid value for 'email', the character length must be smaller than or equal to 250."; } - if ((strlen($this->container['email']) < 0)) { + if ((mb_strlen($this->container['email']) < 0)) { $invalidProperties[] = "invalid value for 'email', the character length must be bigger than or equal to 0."; } - if (!is_null($this->container['companyRegistrationNo']) && (strlen($this->container['companyRegistrationNo']) > 50)) { + if (!is_null($this->container['companyRegistrationNo']) && (mb_strlen($this->container['companyRegistrationNo']) > 50)) { $invalidProperties[] = "invalid value for 'companyRegistrationNo', the character length must be smaller than or equal to 50."; } - if (!is_null($this->container['companyRegistrationNo']) && (strlen($this->container['companyRegistrationNo']) < 0)) { + if (!is_null($this->container['companyRegistrationNo']) && (mb_strlen($this->container['companyRegistrationNo']) < 0)) { $invalidProperties[] = "invalid value for 'companyRegistrationNo', the character length must be bigger than or equal to 0."; } - if (!is_null($this->container['vatNo']) && (strlen($this->container['vatNo']) > 50)) { + if (!is_null($this->container['vatNo']) && (mb_strlen($this->container['vatNo']) > 50)) { $invalidProperties[] = "invalid value for 'vatNo', the character length must be smaller than or equal to 50."; } - if (!is_null($this->container['vatNo']) && (strlen($this->container['vatNo']) < 0)) { + if (!is_null($this->container['vatNo']) && (mb_strlen($this->container['vatNo']) < 0)) { $invalidProperties[] = "invalid value for 'vatNo', the character length must be bigger than or equal to 0."; } - if (!is_null($this->container['paymentMethod']) && (strlen($this->container['paymentMethod']) > 50)) { + if (!is_null($this->container['paymentMethod']) && (mb_strlen($this->container['paymentMethod']) > 50)) { $invalidProperties[] = "invalid value for 'paymentMethod', the character length must be smaller than or equal to 50."; } - if (!is_null($this->container['paymentMethod']) && (strlen($this->container['paymentMethod']) < 0)) { + if (!is_null($this->container['paymentMethod']) && (mb_strlen($this->container['paymentMethod']) < 0)) { $invalidProperties[] = "invalid value for 'paymentMethod', the character length must be bigger than or equal to 0."; } @@ -476,18 +476,18 @@ public function listInvalidProperties() if ($this->container['currencyCode'] === null) { $invalidProperties[] = "'currencyCode' can't be null"; } - if ((strlen($this->container['currencyCode']) > 3)) { + if ((mb_strlen($this->container['currencyCode']) > 3)) { $invalidProperties[] = "invalid value for 'currencyCode', the character length must be smaller than or equal to 3."; } if ($this->container['orderDate'] === null) { $invalidProperties[] = "'orderDate' can't be null"; } - if (!is_null($this->container['channelCustomerNo']) && (strlen($this->container['channelCustomerNo']) > 50)) { + if (!is_null($this->container['channelCustomerNo']) && (mb_strlen($this->container['channelCustomerNo']) > 50)) { $invalidProperties[] = "invalid value for 'channelCustomerNo', the character length must be smaller than or equal to 50."; } - if (!is_null($this->container['channelCustomerNo']) && (strlen($this->container['channelCustomerNo']) < 0)) { + if (!is_null($this->container['channelCustomerNo']) && (mb_strlen($this->container['channelCustomerNo']) < 0)) { $invalidProperties[] = "invalid value for 'channelCustomerNo', the character length must be bigger than or equal to 0."; } @@ -502,67 +502,7 @@ public function listInvalidProperties() */ public function valid() { - - $allowedValues = $this->getChannelOrderSupportAllowableValues(); - if (!in_array($this->container['channelOrderSupport'], $allowedValues)) { - return false; - } - $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowedValues)) { - return false; - } - if (strlen($this->container['phone']) > 20) { - return false; - } - if (strlen($this->container['phone']) < 0) { - return false; - } - if ($this->container['email'] === null) { - return false; - } - if (strlen($this->container['email']) > 250) { - return false; - } - if (strlen($this->container['email']) < 0) { - return false; - } - if (strlen($this->container['companyRegistrationNo']) > 50) { - return false; - } - if (strlen($this->container['companyRegistrationNo']) < 0) { - return false; - } - if (strlen($this->container['vatNo']) > 50) { - return false; - } - if (strlen($this->container['vatNo']) < 0) { - return false; - } - if (strlen($this->container['paymentMethod']) > 50) { - return false; - } - if (strlen($this->container['paymentMethod']) < 0) { - return false; - } - if ($this->container['shippingCostsInclVat'] === null) { - return false; - } - if ($this->container['currencyCode'] === null) { - return false; - } - if (strlen($this->container['currencyCode']) > 3) { - return false; - } - if ($this->container['orderDate'] === null) { - return false; - } - if (strlen($this->container['channelCustomerNo']) > 50) { - return false; - } - if (strlen($this->container['channelCustomerNo']) < 0) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -634,7 +574,7 @@ public function getChannelOrderSupport() public function setChannelOrderSupport($channelOrderSupport) { $allowedValues = $this->getChannelOrderSupportAllowableValues(); - if (!is_null($channelOrderSupport) && !in_array($channelOrderSupport, $allowedValues)) { + if (!is_null($channelOrderSupport) && !in_array($channelOrderSupport, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'channelOrderSupport', must be one of '%s'", @@ -691,7 +631,7 @@ public function getStatus() public function setStatus($status) { $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($status) && !in_array($status, $allowedValues)) { + if (!is_null($status) && !in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'status', must be one of '%s'", @@ -1083,10 +1023,10 @@ public function getPhone() */ public function setPhone($phone) { - if (!is_null($phone) && (strlen($phone) > 20)) { + if (!is_null($phone) && (mb_strlen($phone) > 20)) { throw new \InvalidArgumentException('invalid length for $phone when calling MerchantOrderResponse., must be smaller than or equal to 20.'); } - if (!is_null($phone) && (strlen($phone) < 0)) { + if (!is_null($phone) && (mb_strlen($phone) < 0)) { throw new \InvalidArgumentException('invalid length for $phone when calling MerchantOrderResponse., must be bigger than or equal to 0.'); } @@ -1114,10 +1054,10 @@ public function getEmail() */ public function setEmail($email) { - if ((strlen($email) > 250)) { + if ((mb_strlen($email) > 250)) { throw new \InvalidArgumentException('invalid length for $email when calling MerchantOrderResponse., must be smaller than or equal to 250.'); } - if ((strlen($email) < 0)) { + if ((mb_strlen($email) < 0)) { throw new \InvalidArgumentException('invalid length for $email when calling MerchantOrderResponse., must be bigger than or equal to 0.'); } @@ -1145,10 +1085,10 @@ public function getCompanyRegistrationNo() */ public function setCompanyRegistrationNo($companyRegistrationNo) { - if (!is_null($companyRegistrationNo) && (strlen($companyRegistrationNo) > 50)) { + if (!is_null($companyRegistrationNo) && (mb_strlen($companyRegistrationNo) > 50)) { throw new \InvalidArgumentException('invalid length for $companyRegistrationNo when calling MerchantOrderResponse., must be smaller than or equal to 50.'); } - if (!is_null($companyRegistrationNo) && (strlen($companyRegistrationNo) < 0)) { + if (!is_null($companyRegistrationNo) && (mb_strlen($companyRegistrationNo) < 0)) { throw new \InvalidArgumentException('invalid length for $companyRegistrationNo when calling MerchantOrderResponse., must be bigger than or equal to 0.'); } @@ -1176,10 +1116,10 @@ public function getVatNo() */ public function setVatNo($vatNo) { - if (!is_null($vatNo) && (strlen($vatNo) > 50)) { + if (!is_null($vatNo) && (mb_strlen($vatNo) > 50)) { throw new \InvalidArgumentException('invalid length for $vatNo when calling MerchantOrderResponse., must be smaller than or equal to 50.'); } - if (!is_null($vatNo) && (strlen($vatNo) < 0)) { + if (!is_null($vatNo) && (mb_strlen($vatNo) < 0)) { throw new \InvalidArgumentException('invalid length for $vatNo when calling MerchantOrderResponse., must be bigger than or equal to 0.'); } @@ -1207,10 +1147,10 @@ public function getPaymentMethod() */ public function setPaymentMethod($paymentMethod) { - if (!is_null($paymentMethod) && (strlen($paymentMethod) > 50)) { + if (!is_null($paymentMethod) && (mb_strlen($paymentMethod) > 50)) { throw new \InvalidArgumentException('invalid length for $paymentMethod when calling MerchantOrderResponse., must be smaller than or equal to 50.'); } - if (!is_null($paymentMethod) && (strlen($paymentMethod) < 0)) { + if (!is_null($paymentMethod) && (mb_strlen($paymentMethod) < 0)) { throw new \InvalidArgumentException('invalid length for $paymentMethod when calling MerchantOrderResponse., must be bigger than or equal to 0.'); } @@ -1262,7 +1202,7 @@ public function getCurrencyCode() */ public function setCurrencyCode($currencyCode) { - if ((strlen($currencyCode) > 3)) { + if ((mb_strlen($currencyCode) > 3)) { throw new \InvalidArgumentException('invalid length for $currencyCode when calling MerchantOrderResponse., must be smaller than or equal to 3.'); } @@ -1314,10 +1254,10 @@ public function getChannelCustomerNo() */ public function setChannelCustomerNo($channelCustomerNo) { - if (!is_null($channelCustomerNo) && (strlen($channelCustomerNo) > 50)) { + if (!is_null($channelCustomerNo) && (mb_strlen($channelCustomerNo) > 50)) { throw new \InvalidArgumentException('invalid length for $channelCustomerNo when calling MerchantOrderResponse., must be smaller than or equal to 50.'); } - if (!is_null($channelCustomerNo) && (strlen($channelCustomerNo) < 0)) { + if (!is_null($channelCustomerNo) && (mb_strlen($channelCustomerNo) < 0)) { throw new \InvalidArgumentException('invalid length for $channelCustomerNo when calling MerchantOrderResponse., must be bigger than or equal to 0.'); } diff --git a/lib/Model/MerchantProductBundlePartResponse.php b/lib/Model/MerchantProductBundlePartResponse.php index 2f3119e..a7e4c29 100644 --- a/lib/Model/MerchantProductBundlePartResponse.php +++ b/lib/Model/MerchantProductBundlePartResponse.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -224,8 +224,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/MerchantProductBundleResponse.php b/lib/Model/MerchantProductBundleResponse.php index 42e72ff..5f44e7c 100644 --- a/lib/Model/MerchantProductBundleResponse.php +++ b/lib/Model/MerchantProductBundleResponse.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -224,8 +224,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/MerchantProductExtraDataItemRequest.php b/lib/Model/MerchantProductExtraDataItemRequest.php index 46eeb9a..99dd8e8 100644 --- a/lib/Model/MerchantProductExtraDataItemRequest.php +++ b/lib/Model/MerchantProductExtraDataItemRequest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -227,7 +227,7 @@ public function listInvalidProperties() $invalidProperties = []; $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($this->container['type'], $allowedValues)) { + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'type', must be one of '%s'", implode("', '", $allowedValues) @@ -245,12 +245,7 @@ public function listInvalidProperties() */ public function valid() { - - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($this->container['type'], $allowedValues)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -322,7 +317,7 @@ public function getType() public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($type) && !in_array($type, $allowedValues)) { + if (!is_null($type) && !in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'type', must be one of '%s'", diff --git a/lib/Model/MerchantProductExtraDataItemResponse.php b/lib/Model/MerchantProductExtraDataItemResponse.php index ea826e0..1704641 100644 --- a/lib/Model/MerchantProductExtraDataItemResponse.php +++ b/lib/Model/MerchantProductExtraDataItemResponse.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -227,7 +227,7 @@ public function listInvalidProperties() $invalidProperties = []; $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($this->container['type'], $allowedValues)) { + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'type', must be one of '%s'", implode("', '", $allowedValues) @@ -245,12 +245,7 @@ public function listInvalidProperties() */ public function valid() { - - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($this->container['type'], $allowedValues)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -322,7 +317,7 @@ public function getType() public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($type) && !in_array($type, $allowedValues)) { + if (!is_null($type) && !in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'type', must be one of '%s'", diff --git a/lib/Model/MerchantProductRequest.php b/lib/Model/MerchantProductRequest.php index 63de3e6..f59e6b8 100644 --- a/lib/Model/MerchantProductRequest.php +++ b/lib/Model/MerchantProductRequest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -381,7 +381,7 @@ public function listInvalidProperties() $invalidProperties = []; $allowedValues = $this->getVatRateTypeAllowableValues(); - if (!in_array($this->container['vatRateType'], $allowedValues)) { + if (!is_null($this->container['vatRateType']) && !in_array($this->container['vatRateType'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'vatRateType', must be one of '%s'", implode("', '", $allowedValues) @@ -399,12 +399,7 @@ public function listInvalidProperties() */ public function valid() { - - $allowedValues = $this->getVatRateTypeAllowableValues(); - if (!in_array($this->container['vatRateType'], $allowedValues)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -788,7 +783,7 @@ public function getVatRateType() public function setVatRateType($vatRateType) { $allowedValues = $this->getVatRateTypeAllowableValues(); - if (!is_null($vatRateType) && !in_array($vatRateType, $allowedValues)) { + if (!is_null($vatRateType) && !in_array($vatRateType, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'vatRateType', must be one of '%s'", diff --git a/lib/Model/MerchantProductResponse.php b/lib/Model/MerchantProductResponse.php index 4a20e96..50a1543 100644 --- a/lib/Model/MerchantProductResponse.php +++ b/lib/Model/MerchantProductResponse.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -375,7 +375,7 @@ public function listInvalidProperties() $invalidProperties = []; $allowedValues = $this->getVatRateTypeAllowableValues(); - if (!in_array($this->container['vatRateType'], $allowedValues)) { + if (!is_null($this->container['vatRateType']) && !in_array($this->container['vatRateType'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'vatRateType', must be one of '%s'", implode("', '", $allowedValues) @@ -393,12 +393,7 @@ public function listInvalidProperties() */ public function valid() { - - $allowedValues = $this->getVatRateTypeAllowableValues(); - if (!in_array($this->container['vatRateType'], $allowedValues)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -758,7 +753,7 @@ public function getVatRateType() public function setVatRateType($vatRateType) { $allowedValues = $this->getVatRateTypeAllowableValues(); - if (!is_null($vatRateType) && !in_array($vatRateType, $allowedValues)) { + if (!is_null($vatRateType) && !in_array($vatRateType, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'vatRateType', must be one of '%s'", diff --git a/lib/Model/MerchantReturnLineRequest.php b/lib/Model/MerchantReturnLineRequest.php index 7f23f02..d189ed5 100644 --- a/lib/Model/MerchantReturnLineRequest.php +++ b/lib/Model/MerchantReturnLineRequest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['merchantProductNo'] === null) { - return false; - } - if ($this->container['quantity'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/MerchantReturnLineResponse.php b/lib/Model/MerchantReturnLineResponse.php index a1f4e30..a18118b 100644 --- a/lib/Model/MerchantReturnLineResponse.php +++ b/lib/Model/MerchantReturnLineResponse.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -209,11 +209,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['quantity'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/MerchantReturnLineUpdateRequest.php b/lib/Model/MerchantReturnLineUpdateRequest.php index 77d4984..e7e6d2d 100644 --- a/lib/Model/MerchantReturnLineUpdateRequest.php +++ b/lib/Model/MerchantReturnLineUpdateRequest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -221,17 +221,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['merchantProductNo'] === null) { - return false; - } - if ($this->container['acceptedQuantity'] === null) { - return false; - } - if ($this->container['rejectedQuantity'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/MerchantReturnRequest.php b/lib/Model/MerchantReturnRequest.php index 9040a93..0b8b217 100644 --- a/lib/Model/MerchantReturnRequest.php +++ b/lib/Model/MerchantReturnRequest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -278,26 +278,26 @@ public function listInvalidProperties() $invalidProperties[] = "'lines' can't be null"; } $allowedValues = $this->getReasonAllowableValues(); - if (!in_array($this->container['reason'], $allowedValues)) { + if (!is_null($this->container['reason']) && !in_array($this->container['reason'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'reason', must be one of '%s'", implode("', '", $allowedValues) ); } - if (!is_null($this->container['customerComment']) && (strlen($this->container['customerComment']) > 4001)) { + if (!is_null($this->container['customerComment']) && (mb_strlen($this->container['customerComment']) > 4001)) { $invalidProperties[] = "invalid value for 'customerComment', the character length must be smaller than or equal to 4001."; } - if (!is_null($this->container['customerComment']) && (strlen($this->container['customerComment']) < 0)) { + if (!is_null($this->container['customerComment']) && (mb_strlen($this->container['customerComment']) < 0)) { $invalidProperties[] = "invalid value for 'customerComment', the character length must be bigger than or equal to 0."; } - if (!is_null($this->container['merchantComment']) && (strlen($this->container['merchantComment']) > 4001)) { + if (!is_null($this->container['merchantComment']) && (mb_strlen($this->container['merchantComment']) > 4001)) { $invalidProperties[] = "invalid value for 'merchantComment', the character length must be smaller than or equal to 4001."; } - if (!is_null($this->container['merchantComment']) && (strlen($this->container['merchantComment']) < 0)) { + if (!is_null($this->container['merchantComment']) && (mb_strlen($this->container['merchantComment']) < 0)) { $invalidProperties[] = "invalid value for 'merchantComment', the character length must be bigger than or equal to 0."; } @@ -312,33 +312,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['merchantOrderNo'] === null) { - return false; - } - if ($this->container['merchantReturnNo'] === null) { - return false; - } - if ($this->container['lines'] === null) { - return false; - } - $allowedValues = $this->getReasonAllowableValues(); - if (!in_array($this->container['reason'], $allowedValues)) { - return false; - } - if (strlen($this->container['customerComment']) > 4001) { - return false; - } - if (strlen($this->container['customerComment']) < 0) { - return false; - } - if (strlen($this->container['merchantComment']) > 4001) { - return false; - } - if (strlen($this->container['merchantComment']) < 0) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -458,7 +432,7 @@ public function getReason() public function setReason($reason) { $allowedValues = $this->getReasonAllowableValues(); - if (!is_null($reason) && !in_array($reason, $allowedValues)) { + if (!is_null($reason) && !in_array($reason, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'reason', must be one of '%s'", @@ -490,10 +464,10 @@ public function getCustomerComment() */ public function setCustomerComment($customerComment) { - if (!is_null($customerComment) && (strlen($customerComment) > 4001)) { + if (!is_null($customerComment) && (mb_strlen($customerComment) > 4001)) { throw new \InvalidArgumentException('invalid length for $customerComment when calling MerchantReturnRequest., must be smaller than or equal to 4001.'); } - if (!is_null($customerComment) && (strlen($customerComment) < 0)) { + if (!is_null($customerComment) && (mb_strlen($customerComment) < 0)) { throw new \InvalidArgumentException('invalid length for $customerComment when calling MerchantReturnRequest., must be bigger than or equal to 0.'); } @@ -521,10 +495,10 @@ public function getMerchantComment() */ public function setMerchantComment($merchantComment) { - if (!is_null($merchantComment) && (strlen($merchantComment) > 4001)) { + if (!is_null($merchantComment) && (mb_strlen($merchantComment) > 4001)) { throw new \InvalidArgumentException('invalid length for $merchantComment when calling MerchantReturnRequest., must be smaller than or equal to 4001.'); } - if (!is_null($merchantComment) && (strlen($merchantComment) < 0)) { + if (!is_null($merchantComment) && (mb_strlen($merchantComment) < 0)) { throw new \InvalidArgumentException('invalid length for $merchantComment when calling MerchantReturnRequest., must be bigger than or equal to 0.'); } diff --git a/lib/Model/MerchantReturnResponse.php b/lib/Model/MerchantReturnResponse.php index 9da72e5..b4683d5 100644 --- a/lib/Model/MerchantReturnResponse.php +++ b/lib/Model/MerchantReturnResponse.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -287,26 +287,26 @@ public function listInvalidProperties() $invalidProperties = []; $allowedValues = $this->getReasonAllowableValues(); - if (!in_array($this->container['reason'], $allowedValues)) { + if (!is_null($this->container['reason']) && !in_array($this->container['reason'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'reason', must be one of '%s'", implode("', '", $allowedValues) ); } - if (!is_null($this->container['customerComment']) && (strlen($this->container['customerComment']) > 4001)) { + if (!is_null($this->container['customerComment']) && (mb_strlen($this->container['customerComment']) > 4001)) { $invalidProperties[] = "invalid value for 'customerComment', the character length must be smaller than or equal to 4001."; } - if (!is_null($this->container['customerComment']) && (strlen($this->container['customerComment']) < 0)) { + if (!is_null($this->container['customerComment']) && (mb_strlen($this->container['customerComment']) < 0)) { $invalidProperties[] = "invalid value for 'customerComment', the character length must be bigger than or equal to 0."; } - if (!is_null($this->container['merchantComment']) && (strlen($this->container['merchantComment']) > 4001)) { + if (!is_null($this->container['merchantComment']) && (mb_strlen($this->container['merchantComment']) > 4001)) { $invalidProperties[] = "invalid value for 'merchantComment', the character length must be smaller than or equal to 4001."; } - if (!is_null($this->container['merchantComment']) && (strlen($this->container['merchantComment']) < 0)) { + if (!is_null($this->container['merchantComment']) && (mb_strlen($this->container['merchantComment']) < 0)) { $invalidProperties[] = "invalid value for 'merchantComment', the character length must be bigger than or equal to 0."; } @@ -321,24 +321,7 @@ public function listInvalidProperties() */ public function valid() { - - $allowedValues = $this->getReasonAllowableValues(); - if (!in_array($this->container['reason'], $allowedValues)) { - return false; - } - if (strlen($this->container['customerComment']) > 4001) { - return false; - } - if (strlen($this->container['customerComment']) < 0) { - return false; - } - if (strlen($this->container['merchantComment']) > 4001) { - return false; - } - if (strlen($this->container['merchantComment']) < 0) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -530,7 +513,7 @@ public function getReason() public function setReason($reason) { $allowedValues = $this->getReasonAllowableValues(); - if (!is_null($reason) && !in_array($reason, $allowedValues)) { + if (!is_null($reason) && !in_array($reason, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'reason', must be one of '%s'", @@ -562,10 +545,10 @@ public function getCustomerComment() */ public function setCustomerComment($customerComment) { - if (!is_null($customerComment) && (strlen($customerComment) > 4001)) { + if (!is_null($customerComment) && (mb_strlen($customerComment) > 4001)) { throw new \InvalidArgumentException('invalid length for $customerComment when calling MerchantReturnResponse., must be smaller than or equal to 4001.'); } - if (!is_null($customerComment) && (strlen($customerComment) < 0)) { + if (!is_null($customerComment) && (mb_strlen($customerComment) < 0)) { throw new \InvalidArgumentException('invalid length for $customerComment when calling MerchantReturnResponse., must be bigger than or equal to 0.'); } @@ -593,10 +576,10 @@ public function getMerchantComment() */ public function setMerchantComment($merchantComment) { - if (!is_null($merchantComment) && (strlen($merchantComment) > 4001)) { + if (!is_null($merchantComment) && (mb_strlen($merchantComment) > 4001)) { throw new \InvalidArgumentException('invalid length for $merchantComment when calling MerchantReturnResponse., must be smaller than or equal to 4001.'); } - if (!is_null($merchantComment) && (strlen($merchantComment) < 0)) { + if (!is_null($merchantComment) && (mb_strlen($merchantComment) < 0)) { throw new \InvalidArgumentException('invalid length for $merchantComment when calling MerchantReturnResponse., must be bigger than or equal to 0.'); } diff --git a/lib/Model/MerchantReturnUpdateRequest.php b/lib/Model/MerchantReturnUpdateRequest.php index 200f101..a331fc2 100644 --- a/lib/Model/MerchantReturnUpdateRequest.php +++ b/lib/Model/MerchantReturnUpdateRequest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['returnId'] === null) { - return false; - } - if ($this->container['lines'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/MerchantShipmentLineRequest.php b/lib/Model/MerchantShipmentLineRequest.php index 12f0b2e..383475f 100644 --- a/lib/Model/MerchantShipmentLineRequest.php +++ b/lib/Model/MerchantShipmentLineRequest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['merchantProductNo'] === null) { - return false; - } - if ($this->container['quantity'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/MerchantShipmentRequest.php b/lib/Model/MerchantShipmentRequest.php index b9d9879..fe63db1 100644 --- a/lib/Model/MerchantShipmentRequest.php +++ b/lib/Model/MerchantShipmentRequest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -228,27 +228,27 @@ public function listInvalidProperties() if ($this->container['lines'] === null) { $invalidProperties[] = "'lines' can't be null"; } - if (!is_null($this->container['trackTraceNo']) && (strlen($this->container['trackTraceNo']) > 50)) { + if (!is_null($this->container['trackTraceNo']) && (mb_strlen($this->container['trackTraceNo']) > 50)) { $invalidProperties[] = "invalid value for 'trackTraceNo', the character length must be smaller than or equal to 50."; } - if (!is_null($this->container['trackTraceNo']) && (strlen($this->container['trackTraceNo']) < 0)) { + if (!is_null($this->container['trackTraceNo']) && (mb_strlen($this->container['trackTraceNo']) < 0)) { $invalidProperties[] = "invalid value for 'trackTraceNo', the character length must be bigger than or equal to 0."; } - if (!is_null($this->container['trackTraceUrl']) && (strlen($this->container['trackTraceUrl']) > 250)) { + if (!is_null($this->container['trackTraceUrl']) && (mb_strlen($this->container['trackTraceUrl']) > 250)) { $invalidProperties[] = "invalid value for 'trackTraceUrl', the character length must be smaller than or equal to 250."; } - if (!is_null($this->container['trackTraceUrl']) && (strlen($this->container['trackTraceUrl']) < 0)) { + if (!is_null($this->container['trackTraceUrl']) && (mb_strlen($this->container['trackTraceUrl']) < 0)) { $invalidProperties[] = "invalid value for 'trackTraceUrl', the character length must be bigger than or equal to 0."; } - if (!is_null($this->container['method']) && (strlen($this->container['method']) > 50)) { + if (!is_null($this->container['method']) && (mb_strlen($this->container['method']) > 50)) { $invalidProperties[] = "invalid value for 'method', the character length must be smaller than or equal to 50."; } - if (!is_null($this->container['method']) && (strlen($this->container['method']) < 0)) { + if (!is_null($this->container['method']) && (mb_strlen($this->container['method']) < 0)) { $invalidProperties[] = "invalid value for 'method', the character length must be bigger than or equal to 0."; } @@ -263,35 +263,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['merchantShipmentNo'] === null) { - return false; - } - if ($this->container['merchantOrderNo'] === null) { - return false; - } - if ($this->container['lines'] === null) { - return false; - } - if (strlen($this->container['trackTraceNo']) > 50) { - return false; - } - if (strlen($this->container['trackTraceNo']) < 0) { - return false; - } - if (strlen($this->container['trackTraceUrl']) > 250) { - return false; - } - if (strlen($this->container['trackTraceUrl']) < 0) { - return false; - } - if (strlen($this->container['method']) > 50) { - return false; - } - if (strlen($this->container['method']) < 0) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -386,10 +358,10 @@ public function getTrackTraceNo() */ public function setTrackTraceNo($trackTraceNo) { - if (!is_null($trackTraceNo) && (strlen($trackTraceNo) > 50)) { + if (!is_null($trackTraceNo) && (mb_strlen($trackTraceNo) > 50)) { throw new \InvalidArgumentException('invalid length for $trackTraceNo when calling MerchantShipmentRequest., must be smaller than or equal to 50.'); } - if (!is_null($trackTraceNo) && (strlen($trackTraceNo) < 0)) { + if (!is_null($trackTraceNo) && (mb_strlen($trackTraceNo) < 0)) { throw new \InvalidArgumentException('invalid length for $trackTraceNo when calling MerchantShipmentRequest., must be bigger than or equal to 0.'); } @@ -417,10 +389,10 @@ public function getTrackTraceUrl() */ public function setTrackTraceUrl($trackTraceUrl) { - if (!is_null($trackTraceUrl) && (strlen($trackTraceUrl) > 250)) { + if (!is_null($trackTraceUrl) && (mb_strlen($trackTraceUrl) > 250)) { throw new \InvalidArgumentException('invalid length for $trackTraceUrl when calling MerchantShipmentRequest., must be smaller than or equal to 250.'); } - if (!is_null($trackTraceUrl) && (strlen($trackTraceUrl) < 0)) { + if (!is_null($trackTraceUrl) && (mb_strlen($trackTraceUrl) < 0)) { throw new \InvalidArgumentException('invalid length for $trackTraceUrl when calling MerchantShipmentRequest., must be bigger than or equal to 0.'); } @@ -448,10 +420,10 @@ public function getMethod() */ public function setMethod($method) { - if (!is_null($method) && (strlen($method) > 50)) { + if (!is_null($method) && (mb_strlen($method) > 50)) { throw new \InvalidArgumentException('invalid length for $method when calling MerchantShipmentRequest., must be smaller than or equal to 50.'); } - if (!is_null($method) && (strlen($method) < 0)) { + if (!is_null($method) && (mb_strlen($method) < 0)) { throw new \InvalidArgumentException('invalid length for $method when calling MerchantShipmentRequest., must be bigger than or equal to 0.'); } diff --git a/lib/Model/MerchantShipmentTrackingRequest.php b/lib/Model/MerchantShipmentTrackingRequest.php index 766b515..3f93363 100644 --- a/lib/Model/MerchantShipmentTrackingRequest.php +++ b/lib/Model/MerchantShipmentTrackingRequest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -204,30 +204,30 @@ public function listInvalidProperties() if ($this->container['method'] === null) { $invalidProperties[] = "'method' can't be null"; } - if ((strlen($this->container['method']) > 50)) { + if ((mb_strlen($this->container['method']) > 50)) { $invalidProperties[] = "invalid value for 'method', the character length must be smaller than or equal to 50."; } - if ((strlen($this->container['method']) < 0)) { + if ((mb_strlen($this->container['method']) < 0)) { $invalidProperties[] = "invalid value for 'method', the character length must be bigger than or equal to 0."; } if ($this->container['trackTraceNo'] === null) { $invalidProperties[] = "'trackTraceNo' can't be null"; } - if ((strlen($this->container['trackTraceNo']) > 50)) { + if ((mb_strlen($this->container['trackTraceNo']) > 50)) { $invalidProperties[] = "invalid value for 'trackTraceNo', the character length must be smaller than or equal to 50."; } - if ((strlen($this->container['trackTraceNo']) < 0)) { + if ((mb_strlen($this->container['trackTraceNo']) < 0)) { $invalidProperties[] = "invalid value for 'trackTraceNo', the character length must be bigger than or equal to 0."; } - if (!is_null($this->container['trackTraceUrl']) && (strlen($this->container['trackTraceUrl']) > 250)) { + if (!is_null($this->container['trackTraceUrl']) && (mb_strlen($this->container['trackTraceUrl']) > 250)) { $invalidProperties[] = "invalid value for 'trackTraceUrl', the character length must be smaller than or equal to 250."; } - if (!is_null($this->container['trackTraceUrl']) && (strlen($this->container['trackTraceUrl']) < 0)) { + if (!is_null($this->container['trackTraceUrl']) && (mb_strlen($this->container['trackTraceUrl']) < 0)) { $invalidProperties[] = "invalid value for 'trackTraceUrl', the character length must be bigger than or equal to 0."; } @@ -242,32 +242,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['method'] === null) { - return false; - } - if (strlen($this->container['method']) > 50) { - return false; - } - if (strlen($this->container['method']) < 0) { - return false; - } - if ($this->container['trackTraceNo'] === null) { - return false; - } - if (strlen($this->container['trackTraceNo']) > 50) { - return false; - } - if (strlen($this->container['trackTraceNo']) < 0) { - return false; - } - if (strlen($this->container['trackTraceUrl']) > 250) { - return false; - } - if (strlen($this->container['trackTraceUrl']) < 0) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -290,10 +265,10 @@ public function getMethod() */ public function setMethod($method) { - if ((strlen($method) > 50)) { + if ((mb_strlen($method) > 50)) { throw new \InvalidArgumentException('invalid length for $method when calling MerchantShipmentTrackingRequest., must be smaller than or equal to 50.'); } - if ((strlen($method) < 0)) { + if ((mb_strlen($method) < 0)) { throw new \InvalidArgumentException('invalid length for $method when calling MerchantShipmentTrackingRequest., must be bigger than or equal to 0.'); } @@ -321,10 +296,10 @@ public function getTrackTraceNo() */ public function setTrackTraceNo($trackTraceNo) { - if ((strlen($trackTraceNo) > 50)) { + if ((mb_strlen($trackTraceNo) > 50)) { throw new \InvalidArgumentException('invalid length for $trackTraceNo when calling MerchantShipmentTrackingRequest., must be smaller than or equal to 50.'); } - if ((strlen($trackTraceNo) < 0)) { + if ((mb_strlen($trackTraceNo) < 0)) { throw new \InvalidArgumentException('invalid length for $trackTraceNo when calling MerchantShipmentTrackingRequest., must be bigger than or equal to 0.'); } @@ -352,10 +327,10 @@ public function getTrackTraceUrl() */ public function setTrackTraceUrl($trackTraceUrl) { - if (!is_null($trackTraceUrl) && (strlen($trackTraceUrl) > 250)) { + if (!is_null($trackTraceUrl) && (mb_strlen($trackTraceUrl) > 250)) { throw new \InvalidArgumentException('invalid length for $trackTraceUrl when calling MerchantShipmentTrackingRequest., must be smaller than or equal to 250.'); } - if (!is_null($trackTraceUrl) && (strlen($trackTraceUrl) < 0)) { + if (!is_null($trackTraceUrl) && (mb_strlen($trackTraceUrl) < 0)) { throw new \InvalidArgumentException('invalid length for $trackTraceUrl when calling MerchantShipmentTrackingRequest., must be bigger than or equal to 0.'); } diff --git a/lib/Model/MerchantSingleOrderReturnLineResponse.php b/lib/Model/MerchantSingleOrderReturnLineResponse.php new file mode 100644 index 0000000..ea243a1 --- /dev/null +++ b/lib/Model/MerchantSingleOrderReturnLineResponse.php @@ -0,0 +1,394 @@ + 'string', + 'acceptedQuantity' => 'int', + 'rejectedQuantity' => 'int', + 'quantity' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'merchantProductNo' => null, + 'acceptedQuantity' => 'int32', + 'rejectedQuantity' => 'int32', + 'quantity' => 'int32' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'merchantProductNo' => 'MerchantProductNo', + 'acceptedQuantity' => 'AcceptedQuantity', + 'rejectedQuantity' => 'RejectedQuantity', + 'quantity' => 'Quantity' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merchantProductNo' => 'setMerchantProductNo', + 'acceptedQuantity' => 'setAcceptedQuantity', + 'rejectedQuantity' => 'setRejectedQuantity', + 'quantity' => 'setQuantity' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merchantProductNo' => 'getMerchantProductNo', + 'acceptedQuantity' => 'getAcceptedQuantity', + 'rejectedQuantity' => 'getRejectedQuantity', + 'quantity' => 'getQuantity' + ]; + + /** + * 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::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['merchantProductNo'] = isset($data['merchantProductNo']) ? $data['merchantProductNo'] : null; + $this->container['acceptedQuantity'] = isset($data['acceptedQuantity']) ? $data['acceptedQuantity'] : null; + $this->container['rejectedQuantity'] = isset($data['rejectedQuantity']) ? $data['rejectedQuantity'] : null; + $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['quantity'] === null) { + $invalidProperties[] = "'quantity' 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 merchantProductNo + * + * @return string + */ + public function getMerchantProductNo() + { + return $this->container['merchantProductNo']; + } + + /** + * Sets merchantProductNo + * + * @param string $merchantProductNo The unique product reference used by the Merchant (sku) + * + * @return $this + */ + public function setMerchantProductNo($merchantProductNo) + { + $this->container['merchantProductNo'] = $merchantProductNo; + + return $this; + } + + /** + * Gets acceptedQuantity + * + * @return int + */ + public function getAcceptedQuantity() + { + return $this->container['acceptedQuantity']; + } + + /** + * Sets acceptedQuantity + * + * @param int $acceptedQuantity The accepted quantity of returned products in this orderline + * + * @return $this + */ + public function setAcceptedQuantity($acceptedQuantity) + { + $this->container['acceptedQuantity'] = $acceptedQuantity; + + return $this; + } + + /** + * Gets rejectedQuantity + * + * @return int + */ + public function getRejectedQuantity() + { + return $this->container['rejectedQuantity']; + } + + /** + * Sets rejectedQuantity + * + * @param int $rejectedQuantity The rejected quantity of returned products in this orderline + * + * @return $this + */ + public function setRejectedQuantity($rejectedQuantity) + { + $this->container['rejectedQuantity'] = $rejectedQuantity; + + return $this; + } + + /** + * Gets quantity + * + * @return int + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param int $quantity Number of items of the product in this return + * + * @return $this + */ + public function setQuantity($quantity) + { + $this->container['quantity'] = $quantity; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/MerchantSingleOrderReturnResponse.php b/lib/Model/MerchantSingleOrderReturnResponse.php new file mode 100644 index 0000000..878e5da --- /dev/null +++ b/lib/Model/MerchantSingleOrderReturnResponse.php @@ -0,0 +1,773 @@ + 'string', + 'lines' => '\ChannelEngine\Merchant\ApiClient\Model\MerchantSingleOrderReturnLineResponse[]', + 'createdAt' => '\DateTime', + 'updatedAt' => '\DateTime', + 'merchantReturnNo' => 'string', + 'channelReturnNo' => 'string', + 'status' => 'string', + 'id' => 'int', + 'reason' => 'string', + 'customerComment' => 'string', + 'merchantComment' => 'string', + 'refundInclVat' => 'float', + 'refundExclVat' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'merchantOrderNo' => null, + 'lines' => null, + 'createdAt' => 'date-time', + 'updatedAt' => 'date-time', + 'merchantReturnNo' => null, + 'channelReturnNo' => null, + 'status' => null, + 'id' => 'int32', + 'reason' => null, + 'customerComment' => null, + 'merchantComment' => null, + 'refundInclVat' => 'decimal', + 'refundExclVat' => 'decimal' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'merchantOrderNo' => 'MerchantOrderNo', + 'lines' => 'Lines', + 'createdAt' => 'CreatedAt', + 'updatedAt' => 'UpdatedAt', + 'merchantReturnNo' => 'MerchantReturnNo', + 'channelReturnNo' => 'ChannelReturnNo', + 'status' => 'Status', + 'id' => 'Id', + 'reason' => 'Reason', + 'customerComment' => 'CustomerComment', + 'merchantComment' => 'MerchantComment', + 'refundInclVat' => 'RefundInclVat', + 'refundExclVat' => 'RefundExclVat' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merchantOrderNo' => 'setMerchantOrderNo', + 'lines' => 'setLines', + 'createdAt' => 'setCreatedAt', + 'updatedAt' => 'setUpdatedAt', + 'merchantReturnNo' => 'setMerchantReturnNo', + 'channelReturnNo' => 'setChannelReturnNo', + 'status' => 'setStatus', + 'id' => 'setId', + 'reason' => 'setReason', + 'customerComment' => 'setCustomerComment', + 'merchantComment' => 'setMerchantComment', + 'refundInclVat' => 'setRefundInclVat', + 'refundExclVat' => 'setRefundExclVat' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merchantOrderNo' => 'getMerchantOrderNo', + 'lines' => 'getLines', + 'createdAt' => 'getCreatedAt', + 'updatedAt' => 'getUpdatedAt', + 'merchantReturnNo' => 'getMerchantReturnNo', + 'channelReturnNo' => 'getChannelReturnNo', + 'status' => 'getStatus', + 'id' => 'getId', + 'reason' => 'getReason', + 'customerComment' => 'getCustomerComment', + 'merchantComment' => 'getMerchantComment', + 'refundInclVat' => 'getRefundInclVat', + 'refundExclVat' => 'getRefundExclVat' + ]; + + /** + * 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::$swaggerModelName; + } + + const STATUS_IN_PROGRESS = 'IN_PROGRESS'; + const STATUS_RECEIVED = 'RECEIVED'; + const STATUS_CANCELLED = 'CANCELLED'; + const REASON_PRODUCT_DEFECT = 'PRODUCT_DEFECT'; + const REASON_PRODUCT_UNSATISFACTORY = 'PRODUCT_UNSATISFACTORY'; + const REASON_WRONG_PRODUCT = 'WRONG_PRODUCT'; + const REASON_TOO_MANY_PRODUCTS = 'TOO_MANY_PRODUCTS'; + const REASON_REFUSED = 'REFUSED'; + const REASON_REFUSED_DAMAGED = 'REFUSED_DAMAGED'; + const REASON_WRONG_ADDRESS = 'WRONG_ADDRESS'; + const REASON_NOT_COLLECTED = 'NOT_COLLECTED'; + const REASON_WRONG_SIZE = 'WRONG_SIZE'; + const REASON_OTHER = 'OTHER'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_IN_PROGRESS, + self::STATUS_RECEIVED, + self::STATUS_CANCELLED, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getReasonAllowableValues() + { + return [ + self::REASON_PRODUCT_DEFECT, + self::REASON_PRODUCT_UNSATISFACTORY, + self::REASON_WRONG_PRODUCT, + self::REASON_TOO_MANY_PRODUCTS, + self::REASON_REFUSED, + self::REASON_REFUSED_DAMAGED, + self::REASON_WRONG_ADDRESS, + self::REASON_NOT_COLLECTED, + self::REASON_WRONG_SIZE, + self::REASON_OTHER, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['merchantOrderNo'] = isset($data['merchantOrderNo']) ? $data['merchantOrderNo'] : null; + $this->container['lines'] = isset($data['lines']) ? $data['lines'] : null; + $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; + $this->container['updatedAt'] = isset($data['updatedAt']) ? $data['updatedAt'] : null; + $this->container['merchantReturnNo'] = isset($data['merchantReturnNo']) ? $data['merchantReturnNo'] : null; + $this->container['channelReturnNo'] = isset($data['channelReturnNo']) ? $data['channelReturnNo'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['reason'] = isset($data['reason']) ? $data['reason'] : null; + $this->container['customerComment'] = isset($data['customerComment']) ? $data['customerComment'] : null; + $this->container['merchantComment'] = isset($data['merchantComment']) ? $data['merchantComment'] : null; + $this->container['refundInclVat'] = isset($data['refundInclVat']) ? $data['refundInclVat'] : null; + $this->container['refundExclVat'] = isset($data['refundExclVat']) ? $data['refundExclVat'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getReasonAllowableValues(); + if (!is_null($this->container['reason']) && !in_array($this->container['reason'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'reason', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['customerComment']) && (mb_strlen($this->container['customerComment']) > 4001)) { + $invalidProperties[] = "invalid value for 'customerComment', the character length must be smaller than or equal to 4001."; + } + + if (!is_null($this->container['customerComment']) && (mb_strlen($this->container['customerComment']) < 0)) { + $invalidProperties[] = "invalid value for 'customerComment', the character length must be bigger than or equal to 0."; + } + + if (!is_null($this->container['merchantComment']) && (mb_strlen($this->container['merchantComment']) > 4001)) { + $invalidProperties[] = "invalid value for 'merchantComment', the character length must be smaller than or equal to 4001."; + } + + if (!is_null($this->container['merchantComment']) && (mb_strlen($this->container['merchantComment']) < 0)) { + $invalidProperties[] = "invalid value for 'merchantComment', the character length 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 merchantOrderNo + * + * @return string + */ + public function getMerchantOrderNo() + { + return $this->container['merchantOrderNo']; + } + + /** + * Sets merchantOrderNo + * + * @param string $merchantOrderNo The unique order reference used by the Merchant + * + * @return $this + */ + public function setMerchantOrderNo($merchantOrderNo) + { + $this->container['merchantOrderNo'] = $merchantOrderNo; + + return $this; + } + + /** + * Gets lines + * + * @return \ChannelEngine\Merchant\ApiClient\Model\MerchantSingleOrderReturnLineResponse[] + */ + public function getLines() + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \ChannelEngine\Merchant\ApiClient\Model\MerchantSingleOrderReturnLineResponse[] $lines lines + * + * @return $this + */ + public function setLines($lines) + { + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt The date at which the return was created in ChannelEngine + * + * @return $this + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets updatedAt + * + * @return \DateTime + */ + public function getUpdatedAt() + { + return $this->container['updatedAt']; + } + + /** + * Sets updatedAt + * + * @param \DateTime $updatedAt The date at which the return was last modified in ChannelEngine + * + * @return $this + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } + + /** + * Gets merchantReturnNo + * + * @return string + */ + public function getMerchantReturnNo() + { + return $this->container['merchantReturnNo']; + } + + /** + * Sets merchantReturnNo + * + * @param string $merchantReturnNo The unique return reference used by the Merchant, will be empty in case of a channel or unacknowledged return + * + * @return $this + */ + public function setMerchantReturnNo($merchantReturnNo) + { + $this->container['merchantReturnNo'] = $merchantReturnNo; + + return $this; + } + + /** + * Gets channelReturnNo + * + * @return string + */ + public function getChannelReturnNo() + { + return $this->container['channelReturnNo']; + } + + /** + * Sets channelReturnNo + * + * @param string $channelReturnNo The unique return reference used by the Channel, will be empty in case of a merchant return + * + * @return $this + */ + public function setChannelReturnNo($channelReturnNo) + { + $this->container['channelReturnNo'] = $channelReturnNo; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The current status of the return + * + * @return $this + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($status) && !in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The unique return reference used by ChannelEngine + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets reason + * + * @return string + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string $reason The reason code of the return + * + * @return $this + */ + public function setReason($reason) + { + $allowedValues = $this->getReasonAllowableValues(); + if (!is_null($reason) && !in_array($reason, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'reason', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets customerComment + * + * @return string + */ + public function getCustomerComment() + { + return $this->container['customerComment']; + } + + /** + * Sets customerComment + * + * @param string $customerComment Optional. Comment of customer on the (reason of) the return + * + * @return $this + */ + public function setCustomerComment($customerComment) + { + if (!is_null($customerComment) && (mb_strlen($customerComment) > 4001)) { + throw new \InvalidArgumentException('invalid length for $customerComment when calling MerchantSingleOrderReturnResponse., must be smaller than or equal to 4001.'); + } + if (!is_null($customerComment) && (mb_strlen($customerComment) < 0)) { + throw new \InvalidArgumentException('invalid length for $customerComment when calling MerchantSingleOrderReturnResponse., must be bigger than or equal to 0.'); + } + + $this->container['customerComment'] = $customerComment; + + return $this; + } + + /** + * Gets merchantComment + * + * @return string + */ + public function getMerchantComment() + { + return $this->container['merchantComment']; + } + + /** + * Sets merchantComment + * + * @param string $merchantComment Optional. Comment of merchant on the return. + * + * @return $this + */ + public function setMerchantComment($merchantComment) + { + if (!is_null($merchantComment) && (mb_strlen($merchantComment) > 4001)) { + throw new \InvalidArgumentException('invalid length for $merchantComment when calling MerchantSingleOrderReturnResponse., must be smaller than or equal to 4001.'); + } + if (!is_null($merchantComment) && (mb_strlen($merchantComment) < 0)) { + throw new \InvalidArgumentException('invalid length for $merchantComment when calling MerchantSingleOrderReturnResponse., must be bigger than or equal to 0.'); + } + + $this->container['merchantComment'] = $merchantComment; + + return $this; + } + + /** + * Gets refundInclVat + * + * @return float + */ + public function getRefundInclVat() + { + return $this->container['refundInclVat']; + } + + /** + * Sets refundInclVat + * + * @param float $refundInclVat Refund amount incl. VAT + * + * @return $this + */ + public function setRefundInclVat($refundInclVat) + { + $this->container['refundInclVat'] = $refundInclVat; + + return $this; + } + + /** + * Gets refundExclVat + * + * @return float + */ + public function getRefundExclVat() + { + return $this->container['refundExclVat']; + } + + /** + * Sets refundExclVat + * + * @param float $refundExclVat Refund amount excl. VAT + * + * @return $this + */ + public function setRefundExclVat($refundExclVat) + { + $this->container['refundExclVat'] = $refundExclVat; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/MerchantStockLocationResponse.php b/lib/Model/MerchantStockLocationResponse.php index e45284e..48ff664 100644 --- a/lib/Model/MerchantStockLocationResponse.php +++ b/lib/Model/MerchantStockLocationResponse.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -206,8 +206,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/MerchantStockPriceUpdateRequest.php b/lib/Model/MerchantStockPriceUpdateRequest.php index ffaa181..fb7c6b9 100644 --- a/lib/Model/MerchantStockPriceUpdateRequest.php +++ b/lib/Model/MerchantStockPriceUpdateRequest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -215,11 +215,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['merchantProductNo'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php index 7fbf792..c760f59 100644 --- a/lib/Model/ModelInterface.php +++ b/lib/Model/ModelInterface.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** diff --git a/lib/Model/ProductCreationResult.php b/lib/Model/ProductCreationResult.php index a7b94a8..6ffcaac 100644 --- a/lib/Model/ProductCreationResult.php +++ b/lib/Model/ProductCreationResult.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -212,8 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/ProductMessage.php b/lib/Model/ProductMessage.php index f8d2a78..4b2c3d8 100644 --- a/lib/Model/ProductMessage.php +++ b/lib/Model/ProductMessage.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -218,8 +218,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/SingleOfDictionary2.php b/lib/Model/SingleOfDictionary2.php index 4c93010..dddd4c9 100644 --- a/lib/Model/SingleOfDictionary2.php +++ b/lib/Model/SingleOfDictionary2.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -230,8 +230,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/SingleOfMerchantProductResponse.php b/lib/Model/SingleOfMerchantProductResponse.php index a223175..da12b84 100644 --- a/lib/Model/SingleOfMerchantProductResponse.php +++ b/lib/Model/SingleOfMerchantProductResponse.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -230,8 +230,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/SingleOfProductCreationResult.php b/lib/Model/SingleOfProductCreationResult.php index 9cc7948..586402d 100644 --- a/lib/Model/SingleOfProductCreationResult.php +++ b/lib/Model/SingleOfProductCreationResult.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -230,8 +230,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index 5a84753..3088263 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.8-SNAPSHOT */ /** @@ -59,6 +59,11 @@ public static function sanitizeForSerialization($data, $type = null, $format = n $data[$property] = self::sanitizeForSerialization($value); } return $data; + } elseif ($data instanceof \stdClass) { + foreach ($data as $property => $value) { + $data->$property = self::sanitizeForSerialization($value); + } + return $data; } elseif (is_object($data)) { $values = []; $formats = $data::swaggerFormats(); @@ -68,7 +73,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n if ($value !== null && !in_array($swaggerType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) && method_exists($swaggerType, 'getAllowableEnumValues') - && !in_array($value, $swaggerType::getAllowableEnumValues())) { + && !in_array($value, $swaggerType::getAllowableEnumValues(), true)) { $imploded = implode("', '", $swaggerType::getAllowableEnumValues()); throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'"); } @@ -271,7 +276,7 @@ public static function deserialize($data, $class, $httpHeaders = null) // determine file name if (array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { - $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . self::sanitizeFilename($match[1]); + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); } else { $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); } @@ -284,7 +289,7 @@ public static function deserialize($data, $class, $httpHeaders = null) return new \SplFileObject($filename, 'r'); } elseif (method_exists($class, 'getAllowableEnumValues')) { - if (!in_array($data, $class::getAllowableEnumValues())) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { $imploded = implode("', '", $class::getAllowableEnumValues()); throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); }