diff --git a/README.md b/README.md index bf13a85..f70a2a2 100644 --- a/README.md +++ b/README.md @@ -13,11 +13,11 @@ This repository contains the PrestaShop wallee payment module that enables the s ## Documentation -* [English](https://plugin-documentation.wallee.com/wallee-payment/prestashop-1.6/1.1.8/docs/en/documentation.html) +* [English](https://plugin-documentation.wallee.com/wallee-payment/prestashop-1.6/1.1.9/docs/en/documentation.html) ## License -Please see the [license file](https://github.com/wallee-payment/prestashop-1.6/blob/1.1.8/LICENSE) for more information. +Please see the [license file](https://github.com/wallee-payment/prestashop-1.6/blob/1.1.9/LICENSE) for more information. ## Other PrestaShop Versions diff --git a/docs/en/documentation.html b/docs/en/documentation.html index 95351a7..5c49ae3 100644 --- a/docs/en/documentation.html +++ b/docs/en/documentation.html @@ -21,7 +21,7 @@

Documentation

  • - + Source
  • @@ -50,7 +50,7 @@

    1. -

      Download the module.

      +

      Download the module.

    2. Login to the backend of your PrestsShop store.

      diff --git a/inc/Service/Transaction.php b/inc/Service/Transaction.php index 9488460..c17bb27 100644 --- a/inc/Service/Transaction.php +++ b/inc/Service/Transaction.php @@ -35,6 +35,20 @@ class WalleeServiceTransaction extends WalleeServiceAbstract * @var \Wallee\Sdk\Service\TransactionService */ private $transactionService; + + /** + * The transaction iframe API service to retrieve js url. + * + * @var \Wallee\Sdk\Service\TransactionIframeService + */ + private $transactionIframeService; + + /** + * The transaction payment page API service to retrieve redirection url. + * + * @var \Wallee\Sdk\Service\TransactionPaymentPageService + */ + private $transactionPaymentPageService; /** * The charge attempt API service. @@ -57,6 +71,36 @@ protected function getTransactionService() } return $this->transactionService; } + + /** + * Returns the transaction iframe API service. + * + * @return \Wallee\Sdk\Service\TransactionIframeService + */ + protected function getTransactionIframeService() + { + if ($this->transactionIframeService === null) { + $this->transactionIframeService = new \Wallee\Sdk\Service\TransactionIframeService( + WalleeHelper::getApiClient() + ); + } + return $this->transactionIframeService; + } + + /** + * Returns the transaction API payment page service. + * + * @return \Wallee\Sdk\Service\TransactionPaymentPageService + */ + protected function getTransactionPaymentPageService() + { + if ($this->transactionPaymentPageService === null) { + $this->transactionPaymentPageService = new \Wallee\Sdk\Service\TransactionPaymentPageService( + WalleeHelper::getApiClient() + ); + } + return $this->transactionPaymentPageService; + } /** * Returns the charge attempt API service. @@ -106,7 +150,7 @@ public function waitForTransactionState(Order $order, array $states, $maxWaitTim public function getJavascriptUrl(Cart $cart) { $transaction = $this->getTransactionFromCart($cart); - return $this->getTransactionService()->buildJavaScriptUrl( + return $this->getTransactionIframeService()->javascriptUrl( $transaction->getLinkedSpaceId(), $transaction->getId() ); @@ -120,7 +164,7 @@ public function getJavascriptUrl(Cart $cart) */ public function getPaymentPageUrl($spaceId, $transactionId) { - return $this->getTransactionService()->buildPaymentPageUrl($spaceId, $transactionId); + return $this->getTransactionPaymentPageService()->paymentPageUrl($spaceId, $transactionId); } /** diff --git a/views/templates/admin/admin_help_buttons.tpl b/views/templates/admin/admin_help_buttons.tpl index e6ff25e..bd52da6 100644 --- a/views/templates/admin/admin_help_buttons.tpl +++ b/views/templates/admin/admin_help_buttons.tpl @@ -10,5 +10,5 @@ \ No newline at end of file diff --git a/wallee-sdk/.php_cs b/wallee-sdk/.php_cs new file mode 100644 index 0000000..4fbe53e --- /dev/null +++ b/wallee-sdk/.php_cs @@ -0,0 +1,23 @@ +setUsingCache(true) + ->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/wallee-sdk/.travis.yml b/wallee-sdk/.travis.yml index 030ffa5..f973385 100644 --- a/wallee-sdk/.travis.yml +++ b/wallee-sdk/.travis.yml @@ -1,9 +1,6 @@ language: php sudo: false php: - - 5.4 - 5.6 - - 7.0 - - 7.1 before_install: "composer install" -script: "phpunit --bootstrap autoload.php test/" \ No newline at end of file +script: "phpunit --bootstrap autoload.php test/" diff --git a/wallee-sdk/LICENSE b/wallee-sdk/LICENSE index 8dada3e..ac77bc9 100644 --- a/wallee-sdk/LICENSE +++ b/wallee-sdk/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright {yyyy} {name of copyright owner} + Copyright 2019 customweb GmbH Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -198,4 +198,4 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - limitations under the License. + limitations under the License. \ No newline at end of file diff --git a/wallee-sdk/README.md b/wallee-sdk/README.md index 345ce9e..33553a7 100644 --- a/wallee-sdk/README.md +++ b/wallee-sdk/README.md @@ -1,16 +1,17 @@ [![Build Status](https://travis-ci.org/wallee-payment/php-sdk.svg?branch=master)](https://travis-ci.org/wallee-payment/php-sdk) -# wallee SDK for PHP +# wallee PHP Library -This repository contains the open source PHP SDK that allows you to access wallee from your PHP app. +The wallee PHP library wraps around the wallee API. This library facilitates your interaction with various services such as transactions, accounts, and subscriptions. -## Requirements - -* [PHP 5.6.0 and later](http://www.php.net/) ## Documentation -https://app-wallee.com/doc/api/web-service +[wallee Web Service API](https://app-wallee.com/doc/api/web-service) + +## Requirements + +- PHP 5.6.0 and above ## Installation @@ -39,24 +40,44 @@ require_once '/path/to/php-sdk/autoload.php'; ``` ## Usage +The library needs to be configured with your account's space id, user id, and secret key which are available in your [wallee +account dashboard](https://app-wallee.com/account/select). Set `space_id`, `user_id`, and `api_secret` to their values. -### Basic Example +### Configuring a Service ```php -setType(\Wallee\Sdk\Model\LineItemType::PRODUCT); $transaction = new \Wallee\Sdk\Model\TransactionCreate(); -$transaction->setCurrency("EUR"); +$transaction->setCurrency('EUR'); $transaction->setLineItems(array($lineItem)); $transaction->setAutoConfirmationEnabled(true); $createdTransaction = $transactionService->create($spaceId, $transaction); // Create Payment Page URL: -$redirectionUrl = $transactionService->buildPaymentPageUrl($spaceId, $createdTransaction->getId()); +$redirectionUrl = $transactionPaymentPageService->paymentPageUrl($spaceId, $createdTransaction->getId()); header('Location: ' . $redirectionUrl); +``` +### HTTP Client +You can either use `php curl` or `php socket` extentions. It is recommend you install the necessary extentions and enable them on your system. + +You have to ways two specify which HTTP client you prefer. + +```php +$userId = 512; +$secret = 'FKrO76r5VwJtBrqZawBspljbBNOxp5veKQQkOnZxucQ='; + +// Setup API client +$client = new \Wallee\Sdk\Sdk\ApiClient($userId, $secret); + +$httpClientType = \Wallee\Sdk\Sdk\Http\HttpClientFactory::TYPE_CURL; // or \Wallee\Sdk\Sdk\Http\HttpClientFactory::TYPE_SOCKET + +$client->setHttpClientType($httpClientType); +``` + +You can also specify the HTTP client via the `WLE_HTTP_CLIENT` environment variable. The possible string values are `curl` or `socket`. + + +```php + ``` ## License -Please see the [license file](LICENSE) for more information. \ No newline at end of file +Please see the [license file](https://github.com/wallee-payment/php-sdk/blob/master/LICENSE) for more information. diff --git a/wallee-sdk/composer.json b/wallee-sdk/composer.json index 7ed7964..6eabb85 100644 --- a/wallee-sdk/composer.json +++ b/wallee-sdk/composer.json @@ -1,5 +1,6 @@ { - "name": "wallee/sdk", + "name": "wallee/sdk", + "version": "2.0.5", "description": "wallee SDK for PHP", "keywords": [ "wallee", @@ -8,7 +9,7 @@ "sdk", "api" ], - "homepage": "https://www.wallee.com", + "homepage": "http://github.com/wallee-payment/php-sdk", "license": "Apache-2.0", "authors": [ { @@ -17,7 +18,7 @@ } ], "require": { - "php": ">=5.4", + "php": ">=5.6", "ext-json": "*", "ext-mbstring": "*" }, @@ -30,4 +31,4 @@ "autoload-dev": { "psr-4": { "Wallee\\Sdk\\" : "test/" } } -} \ No newline at end of file +} diff --git a/wallee-sdk/lib/ApiClient.php b/wallee-sdk/lib/ApiClient.php index d758e62..0ca7a40 100644 --- a/wallee-sdk/lib/ApiClient.php +++ b/wallee-sdk/lib/ApiClient.php @@ -1,10 +1,8 @@ userId = $userId; + $this->applicationKey = $applicationKey; + $this->certificateAuthority = dirname(__FILE__) . '/ca-bundle.crt'; $this->serializer = new ObjectSerializer(); $this->isDebuggingEnabled() ? $this->serializer->enableDebugging() : $this->serializer->disableDebugging(); $this->serializer->setDebugFile($this->getDebugFile()); - - $this->userId = $userId; - $this->applicationKey = $applicationKey; } /** @@ -183,7 +182,7 @@ public function setCertificateAuthority($certificateAuthorityFile) { throw new \InvalidArgumentException('The certificate authority file does not exist.'); } - $this->certificateAuthority = $certificateAuthority; + $this->certificateAuthority = $certificateAuthorityFile; return $this; } @@ -353,7 +352,7 @@ public function getDebugFile() { */ public function setDebugFile($debugFile) { $this->debugFile = $debugFile; - $this->serializer->setDebugFile($debugFile); + //$this->serializer->setDebugFile($debugFile); return $this; } @@ -394,9 +393,9 @@ public function setTempFolderPath($tempFolderPath) { * @return string */ public function selectHeaderAccept($accept) { - if (count($accept) === 0 or (count($accept) === 1 and $accept[0] === '')) { + if (empty($accept[0])) { return null; - } elseif (preg_grep("/application\/json/i", $accept)) { + } elseif (preg_grep('/application\/json/i', $accept)) { return 'application/json'; } else { return implode(',', $accept); @@ -410,9 +409,9 @@ public function selectHeaderAccept($accept) { * @return string */ public function selectHeaderContentType($contentType) { - if (count($contentType) === 0 or (count($contentType) === 1 and $contentType[0] === '')) { + if (empty($contentType[0])) { return 'application/json'; - } elseif (preg_grep("/application\/json/i", $contentType)) { + } elseif (preg_grep('/application\/json/i', $contentType)) { return 'application/json'; } else { return implode(',', $contentType); @@ -447,7 +446,7 @@ public function callApi($resourcePath, $method, $queryParams, $postData, $header if ($response->getStatusCode() >= 200 && $response->getStatusCode() <= 299) { // return raw body if response is a file - if ($responseType === '\SplFileObject' || $responseType === 'string') { + if (in_array($responseType, ['\SplFileObject', 'string'])) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $response->getBody()); } @@ -459,19 +458,17 @@ public function callApi($resourcePath, $method, $queryParams, $postData, $header if ($response->getStatusCode() == 409) { throw new VersioningException(); } - + $data = json_decode($response->getBody()); if (json_last_error() > 0) { // if response is a string $data = $response->getBody(); } - - throw new ApiException( - $request->getLogToken(), - 'Error ' . $response->getStatusCode() . ' connecting to the API (' . $request->getUrl() . ')', - $response->getStatusCode(), - $response->getHeaders(), - $data - ); + throw new ApiException( + 'Error ' . $response->getStatusCode() . ' connecting to the API (' . $request->getUrl() . ') : ' . $response->getBody(), + $response->getStatusCode(), + $response->getHeaders(), + $data + ); } return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $data); } @@ -486,7 +483,7 @@ public function callApi($resourcePath, $method, $queryParams, $postData, $header private function buildRequestUrl($path, $queryParams) { $url = $this->getBasePath() . $path; if (!empty($queryParams)) { - $url = ($url . '?' . http_build_query($queryParams)); + $url = ($url . '?' . http_build_query($queryParams, '', '&')); } return $url; } @@ -499,11 +496,11 @@ private function buildRequestUrl($path, $queryParams) { */ private function getAuthenticationHeaders(HttpRequest $request) { $timestamp = time(); - $version = '1'; + $version = 1; $path = $request->getPath(); - $securedData = $version . '|' . $this->userId . '|' . $timestamp . '|' . $request->getMethod() . '|' . $path; + $securedData = implode('|', [$version, $this->userId, $timestamp, $request->getMethod(), $path]); - $headers = array(); + $headers = []; $headers['x-mac-version'] = $version; $headers['x-mac-userid'] = $this->userId; $headers['x-mac-timestamp'] = $timestamp; @@ -519,21 +516,21 @@ private function getAuthenticationHeaders(HttpRequest $request) { */ private function calculateHmac($securedData) { $decodedSecret = base64_decode($this->applicationKey); - return base64_encode(hash_hmac("sha512", $securedData, $decodedSecret, true)); + return base64_encode(hash_hmac('sha512', $securedData, $decodedSecret, true)); } - + /** * Generates a unique token to assign to the request. * * @return string */ private function generateUniqueToken() { - $s = strtoupper(md5(uniqid(rand(),true))); - return substr($s,0,8) . '-' . - substr($s,8,4) . '-' . - substr($s,12,4). '-' . - substr($s,16,4). '-' . - substr($s,20); + $s = strtoupper(md5(uniqid(rand(),true))); + return substr($s,0,8) . '-' . + substr($s,8,4) . '-' . + substr($s,12,4). '-' . + substr($s,16,4). '-' . + substr($s,20); } } diff --git a/wallee-sdk/lib/ApiException.php b/wallee-sdk/lib/ApiException.php index 40af81d..dd5fe99 100644 --- a/wallee-sdk/lib/ApiException.php +++ b/wallee-sdk/lib/ApiException.php @@ -1,10 +1,8 @@ responseHeaders = $responseHeaders; - $this->responseBody = $responseBody; - $this->responseObject = $responseObject; - $this->logToken = $logToken; - } + /** + * Constructor + * + * @param string $message Error message + * @param int $code HTTP status code + * @param string[]|null $responseHeaders HTTP response header + * @param mixed $responseBody HTTP decoded body of the server response either as \stdClass or string + */ + public function __construct($message = '', $code = 0, $responseHeaders = [], $responseBody = null) + { + parent::__construct($message, $code); + $this->responseHeaders = $responseHeaders; + $this->responseBody = $responseBody; + } - /** - * Returns the HTTP response header. - * - * @return string - */ - public function getResponseHeaders() { - return $this->responseHeaders; - } + /** + * Gets the HTTP response header + * + * @return string[]|null HTTP response header + */ + public function getResponseHeaders() + { + return $this->responseHeaders; + } - /** - * Returns the HTTP body of the server response either as Json or string. - * - * @return string - */ - public function getResponseBody() { - return $this->responseBody; - } + /** + * Gets the HTTP body of the server response either as Json or string + * + * @return mixed HTTP body of the server response either as \stdClass or string + */ + public function getResponseBody() + { + return $this->responseBody; + } - /** - * Returns the deseralized response object. - * - * @return mixed - */ - public function getResponseObject() { - return $this->responseObject; - } - - /** - * Return the log token. - * - * @return string - */ - public function getLogToken() { - return $this->logToken; - } + /** + * Sets the deseralized response object (during deserialization) + * + * @param mixed $obj Deserialized response object + * + * @return void + */ + public function setResponseObject($obj) + { + $this->responseObject = $obj; + } -} \ No newline at end of file + /** + * Gets the deseralized response object (during deserialization) + * + * @return mixed the deserialized response object + */ + public function getResponseObject() + { + return $this->responseObject; + } +} diff --git a/wallee-sdk/lib/ApiResponse.php b/wallee-sdk/lib/ApiResponse.php index 671e0f3..0c9dad0 100644 --- a/wallee-sdk/lib/ApiResponse.php +++ b/wallee-sdk/lib/ApiResponse.php @@ -1,10 +1,8 @@ tempFolderPath = sys_get_temp_dir(); + } + + /** + * Sets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $key API key or token + * + * @return $this + */ + public function setApiKey($apiKeyIdentifier, $key) + { + $this->apiKeys[$apiKeyIdentifier] = $key; + return $this; + } + + /** + * Gets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return string API key or token + */ + public function getApiKey($apiKeyIdentifier) + { + return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; + } + + /** + * Sets the prefix for API key (e.g. Bearer) + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $prefix API key prefix, e.g. Bearer + * + * @return $this + */ + public function setApiKeyPrefix($apiKeyIdentifier, $prefix) + { + $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; + return $this; + } + + /** + * Gets API key prefix + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return string + */ + public function getApiKeyPrefix($apiKeyIdentifier) + { + return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; + } + + /** + * Sets the access token for OAuth + * + * @param string $accessToken Token for OAuth + * + * @return $this + */ + public function setAccessToken($accessToken) + { + $this->accessToken = $accessToken; + return $this; + } + + /** + * Gets the access token for OAuth + * + * @return string Access token for OAuth + */ + public function getAccessToken() + { + return $this->accessToken; + } + + /** + * Sets the username for HTTP basic authentication + * + * @param string $username Username for HTTP basic authentication + * + * @return $this + */ + public function setUsername($username) + { + $this->username = $username; + return $this; + } + + /** + * Gets the username for HTTP basic authentication + * + * @return string Username for HTTP basic authentication + */ + public function getUsername() + { + return $this->username; + } + + /** + * Sets the password for HTTP basic authentication + * + * @param string $password Password for HTTP basic authentication + * + * @return $this + */ + public function setPassword($password) + { + $this->password = $password; + return $this; + } + + /** + * Gets the password for HTTP basic authentication + * + * @return string Password for HTTP basic authentication + */ + public function getPassword() + { + return $this->password; + } + + /** + * Sets the host + * + * @param string $host Host + * + * @return $this + */ + public function setHost($host) + { + $this->host = $host; + return $this; + } + + /** + * Gets the host + * + * @return string Host + */ + public function getHost() + { + return $this->host; + } + + /** + * Sets the user agent of the api client + * + * @param string $userAgent the user agent of the api client + * + * @throws \InvalidArgumentException + * @return $this + */ + public function setUserAgent($userAgent) + { + if (!is_string($userAgent)) { + throw new \InvalidArgumentException('User-agent must be a string.'); + } + + $this->userAgent = $userAgent; + return $this; + } + + /** + * Gets the user agent of the api client + * + * @return string user agent + */ + public function getUserAgent() + { + return $this->userAgent; + } + + /** + * Sets debug flag + * + * @param bool $debug Debug flag + * + * @return $this + */ + public function setDebug($debug) + { + $this->debug = $debug; + return $this; + } + + /** + * Gets the debug flag + * + * @return bool + */ + public function getDebug() + { + return $this->debug; + } + + /** + * Sets the debug file + * + * @param string $debugFile Debug file + * + * @return $this + */ + public function setDebugFile($debugFile) + { + $this->debugFile = $debugFile; + return $this; + } + + /** + * Gets the debug file + * + * @return string + */ + public function getDebugFile() + { + return $this->debugFile; + } + + /** + * Sets the temp folder path + * + * @param string $tempFolderPath Temp folder path + * + * @return $this + */ + public function setTempFolderPath($tempFolderPath) + { + $this->tempFolderPath = $tempFolderPath; + return $this; + } + + /** + * Gets the temp folder path + * + * @return string Temp folder path + */ + public function getTempFolderPath() + { + return $this->tempFolderPath; + } + + /** + * Gets the default configuration instance + * + * @return Configuration + */ + public static function getDefaultConfiguration() + { + if (self::$defaultConfiguration === null) { + self::$defaultConfiguration = new Configuration(); + } + + return self::$defaultConfiguration; + } + + /** + * Sets the detault configuration instance + * + * @param Configuration $config An instance of the Configuration Object + * + * @return void + */ + public static function setDefaultConfiguration(Configuration $config) + { + self::$defaultConfiguration = $config; + } + + /** + * Gets the essential information for debugging + * + * @return string The report for debugging + */ + public static function toDebugReport() + { + $report = 'PHP SDK (Wallee\Sdk) Debug Report:' . PHP_EOL; + $report .= ' OS: ' . php_uname() . PHP_EOL; + $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; + $report .= ' OpenAPI Spec Version: 2.0.5' . PHP_EOL; + $report .= ' SDK Package Version: 2.0.5' . PHP_EOL; + $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; + + return $report; + } + + /** + * Get API key (with prefix if set) + * + * @param string $apiKeyIdentifier name of apikey + * + * @return string API key with the prefix + */ + public function getApiKeyWithPrefix($apiKeyIdentifier) + { + $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); + $apiKey = $this->getApiKey($apiKeyIdentifier); + + if ($apiKey === null) { + return null; + } + + if ($prefix === null) { + $keyWithPrefix = $apiKey; + } else { + $keyWithPrefix = $prefix . ' ' . $apiKey; + } + + return $keyWithPrefix; + } +} diff --git a/wallee-sdk/lib/HeaderSelector.php b/wallee-sdk/lib/HeaderSelector.php new file mode 100644 index 0000000..7ba89e7 --- /dev/null +++ b/wallee-sdk/lib/HeaderSelector.php @@ -0,0 +1,100 @@ +selectAcceptHeader($accept); + if ($accept !== null) { + $headers['Accept'] = $accept; + } + + $headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes); + return $headers; + } + + /** + * @param string[] $accept + * @return array + */ + public function selectHeadersForMultipart($accept) + { + $headers = $this->selectHeaders($accept, []); + + unset($headers['Content-Type']); + return $headers; + } + + /** + * Return the header 'Accept' based on an array of Accept provided + * + * @param string[] $accept Array of header + * + * @return string Accept (e.g. application/json) + */ + private function selectAcceptHeader($accept) + { + if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { + return null; + } elseif (preg_grep("/application\/json/i", $accept)) { + return 'application/json'; + } else { + return implode(',', $accept); + } + } + + /** + * Return the content type based on an array of content-type provided + * + * @param string[] $contentType Array fo content-type + * + * @return string Content-Type (e.g. application/json) + */ + private function selectContentTypeHeader($contentType) + { + if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { + return 'application/json'; + } elseif (preg_grep("/application\/json/i", $contentType)) { + return 'application/json'; + } else { + return implode(',', $contentType); + } + } +} diff --git a/wallee-sdk/lib/Http/ConnectionException.php b/wallee-sdk/lib/Http/ConnectionException.php index 8d37d19..5950e78 100644 --- a/wallee-sdk/lib/Http/ConnectionException.php +++ b/wallee-sdk/lib/Http/ConnectionException.php @@ -1,10 +1,8 @@ url = $url; $this->requestToken = $requestToken; @@ -77,7 +76,7 @@ public function __construct($url = null, $requestToken = "", $message = "", $cod public function getUrl() { return $this->url; } - + /** * Returns the log token of the request. * @@ -86,7 +85,7 @@ public function getUrl() { public function getRequestToken() { return $this->requestToken; } - + /** * Returns the error message without prefixed log token. * @@ -96,4 +95,4 @@ public function getErrorMessage() { return $this->errorMessage; } -} \ No newline at end of file +} diff --git a/wallee-sdk/lib/Http/CurlHttpClient.php b/wallee-sdk/lib/Http/CurlHttpClient.php index 68a1da4..cde126e 100644 --- a/wallee-sdk/lib/Http/CurlHttpClient.php +++ b/wallee-sdk/lib/Http/CurlHttpClient.php @@ -1,10 +1,8 @@ getConnectionTimeout() !== 0) { curl_setopt($curl, CURLOPT_TIMEOUT, $apiClient->getConnectionTimeout()); } + + // set life-time for DNS cache entries + curl_setopt($curl, CURLOPT_DNS_CACHE_TIMEOUT, 30); // return the result on success, rather than just true curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); diff --git a/wallee-sdk/lib/Http/HttpClientFactory.php b/wallee-sdk/lib/Http/HttpClientFactory.php index 0746ec4..c5b870b 100644 --- a/wallee-sdk/lib/Http/HttpClientFactory.php +++ b/wallee-sdk/lib/Http/HttpClientFactory.php @@ -1,10 +1,8 @@ clients[$type])) { - return $this->clients[$type]; - } else { - throw new \Exception("No http client with type '$type' found."); - } - } else { - foreach ($this->clients as $client) { - if ($client->isSupported()) { - return $client; - } - } - throw new \Exception('No supported http client found.'); - } + $type = empty($type) ? getenv('WLE_HTTP_CLIENT') : $type; + if(empty($type)){ + foreach ($this->clients as $client) { + if ($client->isSupported()) { + return $client; + } + } + throw new \Exception('No supported http client found.'); + } elseif (isset($this->clients[$type]) && $this->clients[$type]->isSupported()) { + return $this->clients[$type]; + } + throw new \Exception("No http client with type '$type' found."); } -} \ No newline at end of file +} diff --git a/wallee-sdk/lib/Http/HttpRequest.php b/wallee-sdk/lib/Http/HttpRequest.php index 845ac70..8a1d7e7 100644 --- a/wallee-sdk/lib/Http/HttpRequest.php +++ b/wallee-sdk/lib/Http/HttpRequest.php @@ -1,10 +1,8 @@ headers as $name => $values) { foreach ($values as $value) { $headers[] = strtolower($name) . ': ' . $value; @@ -351,7 +350,7 @@ public function getQuery() { */ public function getBody() { if ($this->body && isset($this->headers[self::HEADER_KEY_CONTENT_TYPE]) && $this->headers[self::HEADER_KEY_CONTENT_TYPE] == 'application/x-www-form-urlencoded') { - return http_build_query($this->body); + return http_build_query($this->body, '', '&'); } elseif ((is_object($this->body) || is_array($this->body)) && (!isset($this->headers[self::HEADER_KEY_CONTENT_TYPE]) || $this->headers[self::HEADER_KEY_CONTENT_TYPE] != 'multipart/form-data')) { return json_encode($this->serializer->sanitizeForSerialization($this->body)); diff --git a/wallee-sdk/lib/Http/HttpResponse.php b/wallee-sdk/lib/Http/HttpResponse.php index cee9b76..8a021b9 100644 --- a/wallee-sdk/lib/Http/HttpResponse.php +++ b/wallee-sdk/lib/Http/HttpResponse.php @@ -1,10 +1,8 @@ array(), - 'ssl' => array() - ); + $options = [ + 'http' => [], + 'ssl' => [], + ]; if ($request->isSecureConnection()) { $options['ssl']['verify_host'] = true; $options['ssl']['allow_self_signed'] = false; @@ -390,15 +389,11 @@ private function buildStreamContextOptions(ApiClient $apiClient, HttpRequest $re } } $ipVersion = $this->readEnvironmentVariable(self::ENVIRONMENT_VARIABLE_IP_ADDRESS_VERSION); - if ($ipVersion !== null) { + if (!is_null($ipVersion)) { if ($ipVersion == self::IP_ADDRESS_VERSION_V4) { - $options['socket'] = array( - 'bindto' => '0.0.0.0:0' - ); + $options['socket'] = [ 'bindto' => '0.0.0.0:0' ]; } elseif ($ipVersion == self::IP_ADDRESS_VERSION_V6) { - $options['socket'] = array( - 'bindto' => '[::]:0' - ); + $options['socket'] = [ 'bindto' => '[::]:0' ]; } } return $options; diff --git a/wallee-sdk/lib/Model/AbstractAccountUpdate.php b/wallee-sdk/lib/Model/AbstractAccountUpdate.php index 46687a8..f4a26dd 100644 --- a/wallee-sdk/lib/Model/AbstractAccountUpdate.php +++ b/wallee-sdk/lib/Model/AbstractAccountUpdate.php @@ -1,10 +1,8 @@ 'string', - 'subaccountLimit' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The name of the account identifies the account within the administrative interface. - * - * @var string - */ - private $name; - - /** - * This property restricts the number of subaccounts which can be created within this account. - * - * @var int - */ - private $subaccountLimit; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['subaccountLimit'])) { - $this->setSubaccountLimit($data['subaccountLimit']); - } - } - - - /** - * Returns name. - * - * The name of the account identifies the account within the administrative interface. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return AbstractAccountUpdate - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns subaccountLimit. - * - * This property restricts the number of subaccounts which can be created within this account. - * - * @return int - */ - public function getSubaccountLimit() { - return $this->subaccountLimit; - } - - /** - * Sets subaccountLimit. - * - * @param int $subaccountLimit - * @return AbstractAccountUpdate - */ - public function setSubaccountLimit($subaccountLimit) { - $this->subaccountLimit = $subaccountLimit; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class AbstractAccountUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Abstract.Account.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'name' => 'string', + 'subaccount_limit' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'subaccount_limit' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'subaccount_limit' => 'subaccountLimit' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'subaccount_limit' => 'setSubaccountLimit' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'subaccount_limit' => 'getSubaccountLimit' + ]; + + + + /** + * 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['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['subaccount_limit'] = isset($data['subaccount_limit']) ? $data['subaccount_limit'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the account identifies the account within the administrative interface. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets subaccount_limit + * + * @return int + */ + public function getSubaccountLimit() + { + return $this->container['subaccount_limit']; + } + + /** + * Sets subaccount_limit + * + * @param int $subaccount_limit This property restricts the number of subaccounts which can be created within this account. + * + * @return $this + */ + public function setSubaccountLimit($subaccount_limit) + { + $this->container['subaccount_limit'] = $subaccount_limit; + + 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/wallee-sdk/lib/Model/AbstractApplicationUserUpdate.php b/wallee-sdk/lib/Model/AbstractApplicationUserUpdate.php index 05ff352..4706284 100644 --- a/wallee-sdk/lib/Model/AbstractApplicationUserUpdate.php +++ b/wallee-sdk/lib/Model/AbstractApplicationUserUpdate.php @@ -1,10 +1,8 @@ 'string', - 'requestLimit' => 'int', - 'state' => '\Wallee\Sdk\Model\CreationEntityState' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The user name is used to identify the application user in administrative interfaces. - * - * @var string - */ - private $name; - - /** - * The request limit defines the maximum number of API request accepted within 2 minutes. This limit can only be changed with special privileges. - * - * @var int - */ - private $requestLimit; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['requestLimit'])) { - $this->setRequestLimit($data['requestLimit']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - } - - - /** - * Returns name. - * - * The user name is used to identify the application user in administrative interfaces. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return AbstractApplicationUserUpdate - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns requestLimit. - * - * The request limit defines the maximum number of API request accepted within 2 minutes. This limit can only be changed with special privileges. - * - * @return int - */ - public function getRequestLimit() { - return $this->requestLimit; - } - - /** - * Sets requestLimit. - * - * @param int $requestLimit - * @return AbstractApplicationUserUpdate - */ - public function setRequestLimit($requestLimit) { - $this->requestLimit = $requestLimit; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return AbstractApplicationUserUpdate - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class AbstractApplicationUserUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Abstract.ApplicationUser.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'name' => 'string', + 'request_limit' => 'int', + 'state' => '\Wallee\Sdk\Model\CreationEntityState' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'request_limit' => 'int64', + 'state' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'request_limit' => 'requestLimit', + 'state' => 'state' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'request_limit' => 'setRequestLimit', + 'state' => 'setState' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'request_limit' => 'getRequestLimit', + 'state' => 'getState' + ]; + + + + /** + * 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['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['request_limit'] = isset($data['request_limit']) ? $data['request_limit'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The user name is used to identify the application user in administrative interfaces. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets request_limit + * + * @return int + */ + public function getRequestLimit() + { + return $this->container['request_limit']; + } + + /** + * Sets request_limit + * + * @param int $request_limit The request limit defines the maximum number of API request accepted within 2 minutes. This limit can only be changed with special privileges. + * + * @return $this + */ + public function setRequestLimit($request_limit) + { + $this->container['request_limit'] = $request_limit; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + 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/wallee-sdk/lib/Model/AbstractCustomerActive.php b/wallee-sdk/lib/Model/AbstractCustomerActive.php new file mode 100644 index 0000000..7207361 --- /dev/null +++ b/wallee-sdk/lib/Model/AbstractCustomerActive.php @@ -0,0 +1,489 @@ + 'string', + 'email_address' => 'string', + 'family_name' => 'string', + 'given_name' => 'string', + 'language' => 'string', + 'meta_data' => 'map[string,string]', + 'preferred_currency' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'customer_id' => null, + 'email_address' => null, + 'family_name' => null, + 'given_name' => null, + 'language' => null, + 'meta_data' => null, + 'preferred_currency' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'customer_id' => 'customerId', + 'email_address' => 'emailAddress', + 'family_name' => 'familyName', + 'given_name' => 'givenName', + 'language' => 'language', + 'meta_data' => 'metaData', + 'preferred_currency' => 'preferredCurrency' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'customer_id' => 'setCustomerId', + 'email_address' => 'setEmailAddress', + 'family_name' => 'setFamilyName', + 'given_name' => 'setGivenName', + 'language' => 'setLanguage', + 'meta_data' => 'setMetaData', + 'preferred_currency' => 'setPreferredCurrency' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'customer_id' => 'getCustomerId', + 'email_address' => 'getEmailAddress', + 'family_name' => 'getFamilyName', + 'given_name' => 'getGivenName', + 'language' => 'getLanguage', + 'meta_data' => 'getMetaData', + 'preferred_currency' => 'getPreferredCurrency' + ]; + + + + /** + * 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['customer_id'] = isset($data['customer_id']) ? $data['customer_id'] : null; + + $this->container['email_address'] = isset($data['email_address']) ? $data['email_address'] : null; + + $this->container['family_name'] = isset($data['family_name']) ? $data['family_name'] : null; + + $this->container['given_name'] = isset($data['given_name']) ? $data['given_name'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['meta_data'] = isset($data['meta_data']) ? $data['meta_data'] : null; + + $this->container['preferred_currency'] = isset($data['preferred_currency']) ? $data['preferred_currency'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 customer_id + * + * @return string + */ + public function getCustomerId() + { + return $this->container['customer_id']; + } + + /** + * Sets customer_id + * + * @param string $customer_id + * + * @return $this + */ + public function setCustomerId($customer_id) + { + $this->container['customer_id'] = $customer_id; + + return $this; + } + + + /** + * Gets email_address + * + * @return string + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string $email_address + * + * @return $this + */ + public function setEmailAddress($email_address) + { + $this->container['email_address'] = $email_address; + + return $this; + } + + + /** + * Gets family_name + * + * @return string + */ + public function getFamilyName() + { + return $this->container['family_name']; + } + + /** + * Sets family_name + * + * @param string $family_name + * + * @return $this + */ + public function setFamilyName($family_name) + { + $this->container['family_name'] = $family_name; + + return $this; + } + + + /** + * Gets given_name + * + * @return string + */ + public function getGivenName() + { + return $this->container['given_name']; + } + + /** + * Sets given_name + * + * @param string $given_name + * + * @return $this + */ + public function setGivenName($given_name) + { + $this->container['given_name'] = $given_name; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets meta_data + * + * @return map[string,string] + */ + public function getMetaData() + { + return $this->container['meta_data']; + } + + /** + * Sets meta_data + * + * @param map[string,string] $meta_data Meta data allow to store additional data along the object. + * + * @return $this + */ + public function setMetaData($meta_data) + { + $this->container['meta_data'] = $meta_data; + + return $this; + } + + + /** + * Gets preferred_currency + * + * @return string + */ + public function getPreferredCurrency() + { + return $this->container['preferred_currency']; + } + + /** + * Sets preferred_currency + * + * @param string $preferred_currency + * + * @return $this + */ + public function setPreferredCurrency($preferred_currency) + { + $this->container['preferred_currency'] = $preferred_currency; + + 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/wallee-sdk/lib/Model/AbstractCustomerAddressActive.php b/wallee-sdk/lib/Model/AbstractCustomerAddressActive.php new file mode 100644 index 0000000..e2e16e2 --- /dev/null +++ b/wallee-sdk/lib/Model/AbstractCustomerAddressActive.php @@ -0,0 +1,329 @@ + '\Wallee\Sdk\Model\CustomerPostalAddressCreate', + 'address_type' => '\Wallee\Sdk\Model\CustomerAddressType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'address' => null, + 'address_type' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'address_type' => 'addressType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'address_type' => 'setAddressType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'address_type' => 'getAddressType' + ]; + + + + /** + * 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['address'] = isset($data['address']) ? $data['address'] : null; + + $this->container['address_type'] = isset($data['address_type']) ? $data['address_type'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets address + * + * @return \Wallee\Sdk\Model\CustomerPostalAddressCreate + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Wallee\Sdk\Model\CustomerPostalAddressCreate $address + * + * @return $this + */ + public function setAddress($address) + { + $this->container['address'] = $address; + + return $this; + } + + + /** + * Gets address_type + * + * @return \Wallee\Sdk\Model\CustomerAddressType + */ + public function getAddressType() + { + return $this->container['address_type']; + } + + /** + * Sets address_type + * + * @param \Wallee\Sdk\Model\CustomerAddressType $address_type + * + * @return $this + */ + public function setAddressType($address_type) + { + $this->container['address_type'] = $address_type; + + 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/wallee-sdk/lib/Model/AbstractCustomerCommentActive.php b/wallee-sdk/lib/Model/AbstractCustomerCommentActive.php new file mode 100644 index 0000000..1eee360 --- /dev/null +++ b/wallee-sdk/lib/Model/AbstractCustomerCommentActive.php @@ -0,0 +1,297 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'content' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'content' => 'content' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent' + ]; + + + + /** + * 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; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content + * + * @return $this + */ + public function setContent($content) + { + $this->container['content'] = $content; + + 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/wallee-sdk/lib/Model/AbstractDebtCollectionCaseUpdate.php b/wallee-sdk/lib/Model/AbstractDebtCollectionCaseUpdate.php index 7ae1d36..b6c5a28 100644 --- a/wallee-sdk/lib/Model/AbstractDebtCollectionCaseUpdate.php +++ b/wallee-sdk/lib/Model/AbstractDebtCollectionCaseUpdate.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\AddressCreate', - 'contractDate' => '\DateTime', - 'currency' => 'string', - 'dueDate' => '\DateTime', - 'environment' => '\Wallee\Sdk\Model\DebtCollectionEnvironment', - 'language' => 'string', - 'lineItems' => '\Wallee\Sdk\Model\LineItemCreate[]', - 'spaceViewId' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The billing address of the case identifies the debtor. - * - * @var \Wallee\Sdk\Model\AddressCreate - */ - private $billingAddress; - - /** - * The contract date is the date on which the contract with the debtor was signed on. - * - * @var \DateTime - */ - private $contractDate; - - /** - * The currency defines the billing currency of the debt collection case. - * - * @var string - */ - private $currency; - - /** - * The due date indicates the date on which the amount receivable was due. This date has to be always in the past. - * - * @var \DateTime - */ - private $dueDate; - - /** - * The environment in which this case will be processed. There must be a debt collector configuration present which supports the chosen environment. - * - * @var \Wallee\Sdk\Model\DebtCollectionEnvironment - */ - private $environment; - - /** - * The language indicates the language to be used in the communication with the debtor. - * - * @var string - */ - private $language; - - /** - * The line items of the debt collection case will be shown on documents sent to the debtor and the total of them makes up total amount to collect. - * - * @var \Wallee\Sdk\Model\LineItemCreate[] - */ - private $lineItems; - - /** - * - * - * @var int - */ - private $spaceViewId; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['billingAddress'])) { - $this->setBillingAddress($data['billingAddress']); - } - if (isset($data['contractDate'])) { - $this->setContractDate($data['contractDate']); - } - if (isset($data['currency'])) { - $this->setCurrency($data['currency']); - } - if (isset($data['dueDate'])) { - $this->setDueDate($data['dueDate']); - } - if (isset($data['environment'])) { - $this->setEnvironment($data['environment']); - } - if (isset($data['language'])) { - $this->setLanguage($data['language']); - } - if (isset($data['lineItems'])) { - $this->setLineItems($data['lineItems']); - } - if (isset($data['spaceViewId'])) { - $this->setSpaceViewId($data['spaceViewId']); - } - } - - - /** - * Returns billingAddress. - * - * The billing address of the case identifies the debtor. - * - * @return \Wallee\Sdk\Model\AddressCreate - */ - public function getBillingAddress() { - return $this->billingAddress; - } - - /** - * Sets billingAddress. - * - * @param \Wallee\Sdk\Model\AddressCreate $billingAddress - * @return AbstractDebtCollectionCaseUpdate - */ - public function setBillingAddress($billingAddress) { - $this->billingAddress = $billingAddress; - - return $this; - } - - /** - * Returns contractDate. - * - * The contract date is the date on which the contract with the debtor was signed on. - * - * @return \DateTime - */ - public function getContractDate() { - return $this->contractDate; - } - - /** - * Sets contractDate. - * - * @param \DateTime $contractDate - * @return AbstractDebtCollectionCaseUpdate - */ - public function setContractDate($contractDate) { - $this->contractDate = $contractDate; - - return $this; - } - - /** - * Returns currency. - * - * The currency defines the billing currency of the debt collection case. - * - * @return string - */ - public function getCurrency() { - return $this->currency; - } - - /** - * Sets currency. - * - * @param string $currency - * @return AbstractDebtCollectionCaseUpdate - */ - public function setCurrency($currency) { - $this->currency = $currency; - - return $this; - } - - /** - * Returns dueDate. - * - * The due date indicates the date on which the amount receivable was due. This date has to be always in the past. - * - * @return \DateTime - */ - public function getDueDate() { - return $this->dueDate; - } - - /** - * Sets dueDate. - * - * @param \DateTime $dueDate - * @return AbstractDebtCollectionCaseUpdate - */ - public function setDueDate($dueDate) { - $this->dueDate = $dueDate; - - return $this; - } - - /** - * Returns environment. - * - * The environment in which this case will be processed. There must be a debt collector configuration present which supports the chosen environment. - * - * @return \Wallee\Sdk\Model\DebtCollectionEnvironment - */ - public function getEnvironment() { - return $this->environment; - } - - /** - * Sets environment. - * - * @param \Wallee\Sdk\Model\DebtCollectionEnvironment $environment - * @return AbstractDebtCollectionCaseUpdate - */ - public function setEnvironment($environment) { - $this->environment = $environment; - - return $this; - } - - /** - * Returns language. - * - * The language indicates the language to be used in the communication with the debtor. - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return AbstractDebtCollectionCaseUpdate - */ - public function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns lineItems. - * - * The line items of the debt collection case will be shown on documents sent to the debtor and the total of them makes up total amount to collect. - * - * @return \Wallee\Sdk\Model\LineItemCreate[] - */ - public function getLineItems() { - return $this->lineItems; - } - - /** - * Sets lineItems. - * - * @param \Wallee\Sdk\Model\LineItemCreate[] $lineItems - * @return AbstractDebtCollectionCaseUpdate - */ - public function setLineItems($lineItems) { - $this->lineItems = $lineItems; - - return $this; - } - - /** - * Returns spaceViewId. - * - * - * - * @return int - */ - public function getSpaceViewId() { - return $this->spaceViewId; - } - - /** - * Sets spaceViewId. - * - * @param int $spaceViewId - * @return AbstractDebtCollectionCaseUpdate - */ - public function setSpaceViewId($spaceViewId) { - $this->spaceViewId = $spaceViewId; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class AbstractDebtCollectionCaseUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Abstract.DebtCollectionCase.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'billing_address' => '\Wallee\Sdk\Model\AddressCreate', + 'contract_date' => '\DateTime', + 'currency' => 'string', + 'due_date' => '\DateTime', + 'environment' => '\Wallee\Sdk\Model\DebtCollectionEnvironment', + 'language' => 'string', + 'line_items' => '\Wallee\Sdk\Model\LineItemCreate[]', + 'space_view_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'billing_address' => null, + 'contract_date' => 'date-time', + 'currency' => null, + 'due_date' => 'date-time', + 'environment' => null, + 'language' => null, + 'line_items' => null, + 'space_view_id' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'billing_address' => 'billingAddress', + 'contract_date' => 'contractDate', + 'currency' => 'currency', + 'due_date' => 'dueDate', + 'environment' => 'environment', + 'language' => 'language', + 'line_items' => 'lineItems', + 'space_view_id' => 'spaceViewId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'billing_address' => 'setBillingAddress', + 'contract_date' => 'setContractDate', + 'currency' => 'setCurrency', + 'due_date' => 'setDueDate', + 'environment' => 'setEnvironment', + 'language' => 'setLanguage', + 'line_items' => 'setLineItems', + 'space_view_id' => 'setSpaceViewId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'billing_address' => 'getBillingAddress', + 'contract_date' => 'getContractDate', + 'currency' => 'getCurrency', + 'due_date' => 'getDueDate', + 'environment' => 'getEnvironment', + 'language' => 'getLanguage', + 'line_items' => 'getLineItems', + 'space_view_id' => 'getSpaceViewId' + ]; + + + + /** + * 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['billing_address'] = isset($data['billing_address']) ? $data['billing_address'] : null; + + $this->container['contract_date'] = isset($data['contract_date']) ? $data['contract_date'] : null; + + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + + $this->container['due_date'] = isset($data['due_date']) ? $data['due_date'] : null; + + $this->container['environment'] = isset($data['environment']) ? $data['environment'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['line_items'] = isset($data['line_items']) ? $data['line_items'] : null; + + $this->container['space_view_id'] = isset($data['space_view_id']) ? $data['space_view_id'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 billing_address + * + * @return \Wallee\Sdk\Model\AddressCreate + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Wallee\Sdk\Model\AddressCreate $billing_address The billing address of the case identifies the debtor. + * + * @return $this + */ + public function setBillingAddress($billing_address) + { + $this->container['billing_address'] = $billing_address; + + return $this; + } + + + /** + * Gets contract_date + * + * @return \DateTime + */ + public function getContractDate() + { + return $this->container['contract_date']; + } + + /** + * Sets contract_date + * + * @param \DateTime $contract_date The contract date is the date on which the contract with the debtor was signed on. + * + * @return $this + */ + public function setContractDate($contract_date) + { + $this->container['contract_date'] = $contract_date; + + return $this; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The currency defines the billing currency of the debt collection case. + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + + /** + * Gets due_date + * + * @return \DateTime + */ + public function getDueDate() + { + return $this->container['due_date']; + } + + /** + * Sets due_date + * + * @param \DateTime $due_date The due date indicates the date on which the amount receivable was due. This date has to be always in the past. + * + * @return $this + */ + public function setDueDate($due_date) + { + $this->container['due_date'] = $due_date; + + return $this; + } + + + /** + * Gets environment + * + * @return \Wallee\Sdk\Model\DebtCollectionEnvironment + */ + public function getEnvironment() + { + return $this->container['environment']; + } + + /** + * Sets environment + * + * @param \Wallee\Sdk\Model\DebtCollectionEnvironment $environment The environment in which this case will be processed. There must be a debt collector configuration present which supports the chosen environment. + * + * @return $this + */ + public function setEnvironment($environment) + { + $this->container['environment'] = $environment; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language The language indicates the language to be used in the communication with the debtor. + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets line_items + * + * @return \Wallee\Sdk\Model\LineItemCreate[] + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Wallee\Sdk\Model\LineItemCreate[] $line_items The line items of the debt collection case will be shown on documents sent to the debtor and the total of them makes up total amount to collect. + * + * @return $this + */ + public function setLineItems($line_items) + { + $this->container['line_items'] = $line_items; + + return $this; + } + + + /** + * Gets space_view_id + * + * @return int + */ + public function getSpaceViewId() + { + return $this->container['space_view_id']; + } + + /** + * Sets space_view_id + * + * @param int $space_view_id + * + * @return $this + */ + public function setSpaceViewId($space_view_id) + { + $this->container['space_view_id'] = $space_view_id; + + 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/wallee-sdk/lib/Model/AbstractHumanUserUpdate.php b/wallee-sdk/lib/Model/AbstractHumanUserUpdate.php index 14c75fb..9fa8dbd 100644 --- a/wallee-sdk/lib/Model/AbstractHumanUserUpdate.php +++ b/wallee-sdk/lib/Model/AbstractHumanUserUpdate.php @@ -1,10 +1,8 @@ 'string', - 'firstname' => 'string', - 'language' => 'string', - 'lastname' => 'string', - 'mobilePhoneNumber' => 'string', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'timeZone' => 'string', - 'twoFactorEnabled' => 'bool' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The email address of the user. - * - * @var string - */ - private $emailAddress; - - /** - * The first name of the user. - * - * @var string - */ - private $firstname; - - /** - * The preferred language of the user. - * - * @var string - */ - private $language; - - /** - * The last name of the user. - * - * @var string - */ - private $lastname; - - /** - * - * - * @var string - */ - private $mobilePhoneNumber; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The time zone which is applied for the user. If no timezone is specified the browser is used to determine an appropriate time zone. - * - * @var string - */ - private $timeZone; - - /** - * Defines whether two-factor authentication is enabled for this user. - * - * @var bool - */ - private $twoFactorEnabled; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['emailAddress'])) { - $this->setEmailAddress($data['emailAddress']); - } - if (isset($data['firstname'])) { - $this->setFirstname($data['firstname']); - } - if (isset($data['language'])) { - $this->setLanguage($data['language']); - } - if (isset($data['lastname'])) { - $this->setLastname($data['lastname']); - } - if (isset($data['mobilePhoneNumber'])) { - $this->setMobilePhoneNumber($data['mobilePhoneNumber']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['timeZone'])) { - $this->setTimeZone($data['timeZone']); - } - if (isset($data['twoFactorEnabled'])) { - $this->setTwoFactorEnabled($data['twoFactorEnabled']); - } - } - - - /** - * Returns emailAddress. - * - * The email address of the user. - * - * @return string - */ - public function getEmailAddress() { - return $this->emailAddress; - } - - /** - * Sets emailAddress. - * - * @param string $emailAddress - * @return AbstractHumanUserUpdate - */ - public function setEmailAddress($emailAddress) { - $this->emailAddress = $emailAddress; - - return $this; - } - - /** - * Returns firstname. - * - * The first name of the user. - * - * @return string - */ - public function getFirstname() { - return $this->firstname; - } - - /** - * Sets firstname. - * - * @param string $firstname - * @return AbstractHumanUserUpdate - */ - public function setFirstname($firstname) { - $this->firstname = $firstname; - - return $this; - } - - /** - * Returns language. - * - * The preferred language of the user. - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return AbstractHumanUserUpdate - */ - public function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns lastname. - * - * The last name of the user. - * - * @return string - */ - public function getLastname() { - return $this->lastname; - } - - /** - * Sets lastname. - * - * @param string $lastname - * @return AbstractHumanUserUpdate - */ - public function setLastname($lastname) { - $this->lastname = $lastname; - - return $this; - } - - /** - * Returns mobilePhoneNumber. - * - * - * - * @return string - */ - public function getMobilePhoneNumber() { - return $this->mobilePhoneNumber; - } - - /** - * Sets mobilePhoneNumber. - * - * @param string $mobilePhoneNumber - * @return AbstractHumanUserUpdate - */ - public function setMobilePhoneNumber($mobilePhoneNumber) { - $this->mobilePhoneNumber = $mobilePhoneNumber; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return AbstractHumanUserUpdate - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns timeZone. - * - * The time zone which is applied for the user. If no timezone is specified the browser is used to determine an appropriate time zone. - * - * @return string - */ - public function getTimeZone() { - return $this->timeZone; - } - - /** - * Sets timeZone. - * - * @param string $timeZone - * @return AbstractHumanUserUpdate - */ - public function setTimeZone($timeZone) { - $this->timeZone = $timeZone; - - return $this; - } - - /** - * Returns twoFactorEnabled. - * - * Defines whether two-factor authentication is enabled for this user. - * - * @return bool - */ - public function getTwoFactorEnabled() { - return $this->twoFactorEnabled; - } - - /** - * Sets twoFactorEnabled. - * - * @param bool $twoFactorEnabled - * @return AbstractHumanUserUpdate - */ - public function setTwoFactorEnabled($twoFactorEnabled) { - $this->twoFactorEnabled = $twoFactorEnabled; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class AbstractHumanUserUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Abstract.HumanUser.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'email_address' => 'string', + 'firstname' => 'string', + 'language' => 'string', + 'lastname' => 'string', + 'mobile_phone_number' => 'string', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'time_zone' => 'string', + 'two_factor_enabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'email_address' => null, + 'firstname' => null, + 'language' => null, + 'lastname' => null, + 'mobile_phone_number' => null, + 'state' => null, + 'time_zone' => null, + 'two_factor_enabled' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email_address' => 'emailAddress', + 'firstname' => 'firstname', + 'language' => 'language', + 'lastname' => 'lastname', + 'mobile_phone_number' => 'mobilePhoneNumber', + 'state' => 'state', + 'time_zone' => 'timeZone', + 'two_factor_enabled' => 'twoFactorEnabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email_address' => 'setEmailAddress', + 'firstname' => 'setFirstname', + 'language' => 'setLanguage', + 'lastname' => 'setLastname', + 'mobile_phone_number' => 'setMobilePhoneNumber', + 'state' => 'setState', + 'time_zone' => 'setTimeZone', + 'two_factor_enabled' => 'setTwoFactorEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email_address' => 'getEmailAddress', + 'firstname' => 'getFirstname', + 'language' => 'getLanguage', + 'lastname' => 'getLastname', + 'mobile_phone_number' => 'getMobilePhoneNumber', + 'state' => 'getState', + 'time_zone' => 'getTimeZone', + 'two_factor_enabled' => 'getTwoFactorEnabled' + ]; + + + + /** + * 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['email_address'] = isset($data['email_address']) ? $data['email_address'] : null; + + $this->container['firstname'] = isset($data['firstname']) ? $data['firstname'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['lastname'] = isset($data['lastname']) ? $data['lastname'] : null; + + $this->container['mobile_phone_number'] = isset($data['mobile_phone_number']) ? $data['mobile_phone_number'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['time_zone'] = isset($data['time_zone']) ? $data['time_zone'] : null; + + $this->container['two_factor_enabled'] = isset($data['two_factor_enabled']) ? $data['two_factor_enabled'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 email_address + * + * @return string + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string $email_address The email address of the user. + * + * @return $this + */ + public function setEmailAddress($email_address) + { + $this->container['email_address'] = $email_address; + + return $this; + } + + + /** + * Gets firstname + * + * @return string + */ + public function getFirstname() + { + return $this->container['firstname']; + } + + /** + * Sets firstname + * + * @param string $firstname The first name of the user. + * + * @return $this + */ + public function setFirstname($firstname) + { + $this->container['firstname'] = $firstname; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language The preferred language of the user. + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets lastname + * + * @return string + */ + public function getLastname() + { + return $this->container['lastname']; + } + + /** + * Sets lastname + * + * @param string $lastname The last name of the user. + * + * @return $this + */ + public function setLastname($lastname) + { + $this->container['lastname'] = $lastname; + + return $this; + } + + + /** + * Gets mobile_phone_number + * + * @return string + */ + public function getMobilePhoneNumber() + { + return $this->container['mobile_phone_number']; + } + + /** + * Sets mobile_phone_number + * + * @param string $mobile_phone_number + * + * @return $this + */ + public function setMobilePhoneNumber($mobile_phone_number) + { + $this->container['mobile_phone_number'] = $mobile_phone_number; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets time_zone + * + * @return string + */ + public function getTimeZone() + { + return $this->container['time_zone']; + } + + /** + * Sets time_zone + * + * @param string $time_zone The time zone which is applied for the user. If no timezone is specified the browser is used to determine an appropriate time zone. + * + * @return $this + */ + public function setTimeZone($time_zone) + { + $this->container['time_zone'] = $time_zone; + + return $this; + } + + + /** + * Gets two_factor_enabled + * + * @return bool + */ + public function getTwoFactorEnabled() + { + return $this->container['two_factor_enabled']; + } + + /** + * Sets two_factor_enabled + * + * @param bool $two_factor_enabled Defines whether two-factor authentication is enabled for this user. + * + * @return $this + */ + public function setTwoFactorEnabled($two_factor_enabled) + { + $this->container['two_factor_enabled'] = $two_factor_enabled; + + 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/wallee-sdk/lib/Model/AbstractPaymentLinkUpdate.php b/wallee-sdk/lib/Model/AbstractPaymentLinkUpdate.php index 07e85a7..94e7ce5 100644 --- a/wallee-sdk/lib/Model/AbstractPaymentLinkUpdate.php +++ b/wallee-sdk/lib/Model/AbstractPaymentLinkUpdate.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\PaymentMethodConfiguration[]', - 'appliedSpaceView' => 'int', - 'availableFrom' => '\DateTime', - 'availableUntil' => '\DateTime', - 'billingAddressRequired' => 'bool', - 'currency' => 'string', - 'language' => 'string', - 'lineItems' => '\Wallee\Sdk\Model\LineItemCreate[]', - 'maximalNumberOfTransactions' => 'int', - 'name' => 'string', - 'shippingAddressRequired' => 'bool' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The allowed payment method configurations restrict the payment methods which can be used with this payment link. - * - * @var \Wallee\Sdk\Model\PaymentMethodConfiguration[] - */ - private $allowedPaymentMethodConfigurations; - - /** - * The payment link can be conducted in a specific space view. The space view may apply a specific design to the payment page. - * - * @var int - */ - private $appliedSpaceView; - - /** - * The available from date defines the earliest date on which the payment link can be used. When no date is specified there will be no restriction. - * - * @var \DateTime - */ - private $availableFrom; - - /** - * The available from date defines the latest date on which the payment link can be used to initialize a transaction. When no date is specified there will be no restriction. - * - * @var \DateTime - */ - private $availableUntil; - - /** - * By making the billing address required the transaction can only be created when a billing address is provided within the request. - * - * @var bool - */ - private $billingAddressRequired; - - /** - * The currency defines in which currency the payment is executed in. If no currency is defined it has to be specified within the request parameter 'currency'. - * - * @var string - */ - private $currency; - - /** - * The language defines the language of the payment page. If no language is provided it can be provided through the request parameter. - * - * @var string - */ - private $language; - - /** - * The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters. - * - * @var \Wallee\Sdk\Model\LineItemCreate[] - */ - private $lineItems; - - /** - * The maximal number of transactions limits the number of transactions which can be created with this payment link. - * - * @var int - */ - private $maximalNumberOfTransactions; - - /** - * The payment link name is used internally to identify the payment link. For example the name is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * By making the shipping address required the transaction can only be created when a shipping address is provided within the request. - * - * @var bool - */ - private $shippingAddressRequired; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['allowedPaymentMethodConfigurations'])) { - $this->setAllowedPaymentMethodConfigurations($data['allowedPaymentMethodConfigurations']); - } - if (isset($data['appliedSpaceView'])) { - $this->setAppliedSpaceView($data['appliedSpaceView']); - } - if (isset($data['availableFrom'])) { - $this->setAvailableFrom($data['availableFrom']); - } - if (isset($data['availableUntil'])) { - $this->setAvailableUntil($data['availableUntil']); - } - if (isset($data['billingAddressRequired'])) { - $this->setBillingAddressRequired($data['billingAddressRequired']); - } - if (isset($data['currency'])) { - $this->setCurrency($data['currency']); - } - if (isset($data['language'])) { - $this->setLanguage($data['language']); - } - if (isset($data['lineItems'])) { - $this->setLineItems($data['lineItems']); - } - if (isset($data['maximalNumberOfTransactions'])) { - $this->setMaximalNumberOfTransactions($data['maximalNumberOfTransactions']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['shippingAddressRequired'])) { - $this->setShippingAddressRequired($data['shippingAddressRequired']); - } - } - - - /** - * Returns allowedPaymentMethodConfigurations. - * - * The allowed payment method configurations restrict the payment methods which can be used with this payment link. - * - * @return \Wallee\Sdk\Model\PaymentMethodConfiguration[] - */ - public function getAllowedPaymentMethodConfigurations() { - return $this->allowedPaymentMethodConfigurations; - } - - /** - * Sets allowedPaymentMethodConfigurations. - * - * @param \Wallee\Sdk\Model\PaymentMethodConfiguration[] $allowedPaymentMethodConfigurations - * @return AbstractPaymentLinkUpdate - */ - public function setAllowedPaymentMethodConfigurations($allowedPaymentMethodConfigurations) { - $this->allowedPaymentMethodConfigurations = $allowedPaymentMethodConfigurations; - - return $this; - } - - /** - * Returns appliedSpaceView. - * - * The payment link can be conducted in a specific space view. The space view may apply a specific design to the payment page. - * - * @return int - */ - public function getAppliedSpaceView() { - return $this->appliedSpaceView; - } - - /** - * Sets appliedSpaceView. - * - * @param int $appliedSpaceView - * @return AbstractPaymentLinkUpdate - */ - public function setAppliedSpaceView($appliedSpaceView) { - $this->appliedSpaceView = $appliedSpaceView; - - return $this; - } - - /** - * Returns availableFrom. - * - * The available from date defines the earliest date on which the payment link can be used. When no date is specified there will be no restriction. - * - * @return \DateTime - */ - public function getAvailableFrom() { - return $this->availableFrom; - } - - /** - * Sets availableFrom. - * - * @param \DateTime $availableFrom - * @return AbstractPaymentLinkUpdate - */ - public function setAvailableFrom($availableFrom) { - $this->availableFrom = $availableFrom; - - return $this; - } - - /** - * Returns availableUntil. - * - * The available from date defines the latest date on which the payment link can be used to initialize a transaction. When no date is specified there will be no restriction. - * - * @return \DateTime - */ - public function getAvailableUntil() { - return $this->availableUntil; - } - - /** - * Sets availableUntil. - * - * @param \DateTime $availableUntil - * @return AbstractPaymentLinkUpdate - */ - public function setAvailableUntil($availableUntil) { - $this->availableUntil = $availableUntil; - - return $this; - } - - /** - * Returns billingAddressRequired. - * - * By making the billing address required the transaction can only be created when a billing address is provided within the request. - * - * @return bool - */ - public function getBillingAddressRequired() { - return $this->billingAddressRequired; - } - - /** - * Sets billingAddressRequired. - * - * @param bool $billingAddressRequired - * @return AbstractPaymentLinkUpdate - */ - public function setBillingAddressRequired($billingAddressRequired) { - $this->billingAddressRequired = $billingAddressRequired; - - return $this; - } - - /** - * Returns currency. - * - * The currency defines in which currency the payment is executed in. If no currency is defined it has to be specified within the request parameter 'currency'. - * - * @return string - */ - public function getCurrency() { - return $this->currency; - } - - /** - * Sets currency. - * - * @param string $currency - * @return AbstractPaymentLinkUpdate - */ - public function setCurrency($currency) { - $this->currency = $currency; - - return $this; - } - - /** - * Returns language. - * - * The language defines the language of the payment page. If no language is provided it can be provided through the request parameter. - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return AbstractPaymentLinkUpdate - */ - public function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns lineItems. - * - * The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters. - * - * @return \Wallee\Sdk\Model\LineItemCreate[] - */ - public function getLineItems() { - return $this->lineItems; - } - - /** - * Sets lineItems. - * - * @param \Wallee\Sdk\Model\LineItemCreate[] $lineItems - * @return AbstractPaymentLinkUpdate - */ - public function setLineItems($lineItems) { - $this->lineItems = $lineItems; - - return $this; - } - - /** - * Returns maximalNumberOfTransactions. - * - * The maximal number of transactions limits the number of transactions which can be created with this payment link. - * - * @return int - */ - public function getMaximalNumberOfTransactions() { - return $this->maximalNumberOfTransactions; - } - - /** - * Sets maximalNumberOfTransactions. - * - * @param int $maximalNumberOfTransactions - * @return AbstractPaymentLinkUpdate - */ - public function setMaximalNumberOfTransactions($maximalNumberOfTransactions) { - $this->maximalNumberOfTransactions = $maximalNumberOfTransactions; - - return $this; - } - - /** - * Returns name. - * - * The payment link name is used internally to identify the payment link. For example the name is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return AbstractPaymentLinkUpdate - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns shippingAddressRequired. - * - * By making the shipping address required the transaction can only be created when a shipping address is provided within the request. - * - * @return bool - */ - public function getShippingAddressRequired() { - return $this->shippingAddressRequired; - } - - /** - * Sets shippingAddressRequired. - * - * @param bool $shippingAddressRequired - * @return AbstractPaymentLinkUpdate - */ - public function setShippingAddressRequired($shippingAddressRequired) { - $this->shippingAddressRequired = $shippingAddressRequired; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class AbstractPaymentLinkUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Abstract.PaymentLink.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'allowed_payment_method_configurations' => '\Wallee\Sdk\Model\PaymentMethodConfiguration[]', + 'applied_space_view' => 'int', + 'available_from' => '\DateTime', + 'available_until' => '\DateTime', + 'billing_address_required' => 'bool', + 'currency' => 'string', + 'language' => 'string', + 'line_items' => '\Wallee\Sdk\Model\LineItemCreate[]', + 'maximal_number_of_transactions' => 'int', + 'name' => 'string', + 'shipping_address_required' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'allowed_payment_method_configurations' => null, + 'applied_space_view' => 'int64', + 'available_from' => 'date-time', + 'available_until' => 'date-time', + 'billing_address_required' => null, + 'currency' => null, + 'language' => null, + 'line_items' => null, + 'maximal_number_of_transactions' => 'int32', + 'name' => null, + 'shipping_address_required' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'allowed_payment_method_configurations' => 'allowedPaymentMethodConfigurations', + 'applied_space_view' => 'appliedSpaceView', + 'available_from' => 'availableFrom', + 'available_until' => 'availableUntil', + 'billing_address_required' => 'billingAddressRequired', + 'currency' => 'currency', + 'language' => 'language', + 'line_items' => 'lineItems', + 'maximal_number_of_transactions' => 'maximalNumberOfTransactions', + 'name' => 'name', + 'shipping_address_required' => 'shippingAddressRequired' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'allowed_payment_method_configurations' => 'setAllowedPaymentMethodConfigurations', + 'applied_space_view' => 'setAppliedSpaceView', + 'available_from' => 'setAvailableFrom', + 'available_until' => 'setAvailableUntil', + 'billing_address_required' => 'setBillingAddressRequired', + 'currency' => 'setCurrency', + 'language' => 'setLanguage', + 'line_items' => 'setLineItems', + 'maximal_number_of_transactions' => 'setMaximalNumberOfTransactions', + 'name' => 'setName', + 'shipping_address_required' => 'setShippingAddressRequired' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'allowed_payment_method_configurations' => 'getAllowedPaymentMethodConfigurations', + 'applied_space_view' => 'getAppliedSpaceView', + 'available_from' => 'getAvailableFrom', + 'available_until' => 'getAvailableUntil', + 'billing_address_required' => 'getBillingAddressRequired', + 'currency' => 'getCurrency', + 'language' => 'getLanguage', + 'line_items' => 'getLineItems', + 'maximal_number_of_transactions' => 'getMaximalNumberOfTransactions', + 'name' => 'getName', + 'shipping_address_required' => 'getShippingAddressRequired' + ]; + + + + /** + * 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['allowed_payment_method_configurations'] = isset($data['allowed_payment_method_configurations']) ? $data['allowed_payment_method_configurations'] : null; + + $this->container['applied_space_view'] = isset($data['applied_space_view']) ? $data['applied_space_view'] : null; + + $this->container['available_from'] = isset($data['available_from']) ? $data['available_from'] : null; + + $this->container['available_until'] = isset($data['available_until']) ? $data['available_until'] : null; + + $this->container['billing_address_required'] = isset($data['billing_address_required']) ? $data['billing_address_required'] : null; + + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['line_items'] = isset($data['line_items']) ? $data['line_items'] : null; + + $this->container['maximal_number_of_transactions'] = isset($data['maximal_number_of_transactions']) ? $data['maximal_number_of_transactions'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['shipping_address_required'] = isset($data['shipping_address_required']) ? $data['shipping_address_required'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 allowed_payment_method_configurations + * + * @return \Wallee\Sdk\Model\PaymentMethodConfiguration[] + */ + public function getAllowedPaymentMethodConfigurations() + { + return $this->container['allowed_payment_method_configurations']; + } + + /** + * Sets allowed_payment_method_configurations + * + * @param \Wallee\Sdk\Model\PaymentMethodConfiguration[] $allowed_payment_method_configurations The allowed payment method configurations restrict the payment methods which can be used with this payment link. + * + * @return $this + */ + public function setAllowedPaymentMethodConfigurations($allowed_payment_method_configurations) + { + $this->container['allowed_payment_method_configurations'] = $allowed_payment_method_configurations; + + return $this; + } + + + /** + * Gets applied_space_view + * + * @return int + */ + public function getAppliedSpaceView() + { + return $this->container['applied_space_view']; + } + + /** + * Sets applied_space_view + * + * @param int $applied_space_view The payment link can be conducted in a specific space view. The space view may apply a specific design to the payment page. + * + * @return $this + */ + public function setAppliedSpaceView($applied_space_view) + { + $this->container['applied_space_view'] = $applied_space_view; + + return $this; + } + + + /** + * Gets available_from + * + * @return \DateTime + */ + public function getAvailableFrom() + { + return $this->container['available_from']; + } + + /** + * Sets available_from + * + * @param \DateTime $available_from The available from date defines the earliest date on which the payment link can be used. When no date is specified there will be no restriction. + * + * @return $this + */ + public function setAvailableFrom($available_from) + { + $this->container['available_from'] = $available_from; + + return $this; + } + + + /** + * Gets available_until + * + * @return \DateTime + */ + public function getAvailableUntil() + { + return $this->container['available_until']; + } + + /** + * Sets available_until + * + * @param \DateTime $available_until The available from date defines the latest date on which the payment link can be used to initialize a transaction. When no date is specified there will be no restriction. + * + * @return $this + */ + public function setAvailableUntil($available_until) + { + $this->container['available_until'] = $available_until; + + return $this; + } + + + /** + * Gets billing_address_required + * + * @return bool + */ + public function getBillingAddressRequired() + { + return $this->container['billing_address_required']; + } + + /** + * Sets billing_address_required + * + * @param bool $billing_address_required By making the billing address required the transaction can only be created when a billing address is provided within the request. + * + * @return $this + */ + public function setBillingAddressRequired($billing_address_required) + { + $this->container['billing_address_required'] = $billing_address_required; + + return $this; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The currency defines in which currency the payment is executed in. If no currency is defined it has to be specified within the request parameter 'currency'. + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language The language defines the language of the payment page. If no language is provided it can be provided through the request parameter. + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets line_items + * + * @return \Wallee\Sdk\Model\LineItemCreate[] + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Wallee\Sdk\Model\LineItemCreate[] $line_items The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters. + * + * @return $this + */ + public function setLineItems($line_items) + { + $this->container['line_items'] = $line_items; + + return $this; + } + + + /** + * Gets maximal_number_of_transactions + * + * @return int + */ + public function getMaximalNumberOfTransactions() + { + return $this->container['maximal_number_of_transactions']; + } + + /** + * Sets maximal_number_of_transactions + * + * @param int $maximal_number_of_transactions The maximal number of transactions limits the number of transactions which can be created with this payment link. + * + * @return $this + */ + public function setMaximalNumberOfTransactions($maximal_number_of_transactions) + { + $this->container['maximal_number_of_transactions'] = $maximal_number_of_transactions; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The payment link name is used internally to identify the payment link. For example the name is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets shipping_address_required + * + * @return bool + */ + public function getShippingAddressRequired() + { + return $this->container['shipping_address_required']; + } + + /** + * Sets shipping_address_required + * + * @param bool $shipping_address_required By making the shipping address required the transaction can only be created when a shipping address is provided within the request. + * + * @return $this + */ + public function setShippingAddressRequired($shipping_address_required) + { + $this->container['shipping_address_required'] = $shipping_address_required; + + 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/wallee-sdk/lib/Model/AbstractRefundCommentActive.php b/wallee-sdk/lib/Model/AbstractRefundCommentActive.php new file mode 100644 index 0000000..9ccc1a5 --- /dev/null +++ b/wallee-sdk/lib/Model/AbstractRefundCommentActive.php @@ -0,0 +1,297 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'content' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'content' => 'content' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent' + ]; + + + + /** + * 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; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content + * + * @return $this + */ + public function setContent($content) + { + $this->container['content'] = $content; + + 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/wallee-sdk/lib/Model/AbstractSpaceUpdate.php b/wallee-sdk/lib/Model/AbstractSpaceUpdate.php index 11a3348..62b8f07 100644 --- a/wallee-sdk/lib/Model/AbstractSpaceUpdate.php +++ b/wallee-sdk/lib/Model/AbstractSpaceUpdate.php @@ -1,10 +1,8 @@ 'string', - 'postalAddress' => '\Wallee\Sdk\Model\SpaceAddressCreate', - 'requestLimit' => 'int', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'technicalContactAddresses' => 'string[]', - 'timeZone' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The space name is used internally to identify the space in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * The address to use in communication with clients for example in email, documents etc. - * - * @var \Wallee\Sdk\Model\SpaceAddressCreate - */ - private $postalAddress; - - /** - * The request limit defines the maximum number of API request accepted within 2 minutes for this space. This limit can only be changed with special privileges. - * - * @var int - */ - private $requestLimit; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The email address provided as contact addresses will be informed about technical issues or errors triggered by the space. - * - * @var string[] - */ - private $technicalContactAddresses; - - /** - * The time zone assigned to the space determines the time offset for calculating dates within the space. This is typically used for background processed which needs to be triggered on a specific hour within the day. Changing the space time zone will not change the display of dates. - * - * @var string - */ - private $timeZone; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['postalAddress'])) { - $this->setPostalAddress($data['postalAddress']); - } - if (isset($data['requestLimit'])) { - $this->setRequestLimit($data['requestLimit']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['technicalContactAddresses'])) { - $this->setTechnicalContactAddresses($data['technicalContactAddresses']); - } - if (isset($data['timeZone'])) { - $this->setTimeZone($data['timeZone']); - } - } - - - /** - * Returns name. - * - * The space name is used internally to identify the space in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return AbstractSpaceUpdate - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns postalAddress. - * - * The address to use in communication with clients for example in email, documents etc. - * - * @return \Wallee\Sdk\Model\SpaceAddressCreate - */ - public function getPostalAddress() { - return $this->postalAddress; - } - - /** - * Sets postalAddress. - * - * @param \Wallee\Sdk\Model\SpaceAddressCreate $postalAddress - * @return AbstractSpaceUpdate - */ - public function setPostalAddress($postalAddress) { - $this->postalAddress = $postalAddress; - - return $this; - } - - /** - * Returns requestLimit. - * - * The request limit defines the maximum number of API request accepted within 2 minutes for this space. This limit can only be changed with special privileges. - * - * @return int - */ - public function getRequestLimit() { - return $this->requestLimit; - } - - /** - * Sets requestLimit. - * - * @param int $requestLimit - * @return AbstractSpaceUpdate - */ - public function setRequestLimit($requestLimit) { - $this->requestLimit = $requestLimit; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return AbstractSpaceUpdate - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns technicalContactAddresses. - * - * The email address provided as contact addresses will be informed about technical issues or errors triggered by the space. - * - * @return string[] - */ - public function getTechnicalContactAddresses() { - return $this->technicalContactAddresses; - } - - /** - * Sets technicalContactAddresses. - * - * @param string[] $technicalContactAddresses - * @return AbstractSpaceUpdate - */ - public function setTechnicalContactAddresses($technicalContactAddresses) { - $this->technicalContactAddresses = $technicalContactAddresses; - - return $this; - } - - /** - * Returns timeZone. - * - * The time zone assigned to the space determines the time offset for calculating dates within the space. This is typically used for background processed which needs to be triggered on a specific hour within the day. Changing the space time zone will not change the display of dates. - * - * @return string - */ - public function getTimeZone() { - return $this->timeZone; - } - - /** - * Sets timeZone. - * - * @param string $timeZone - * @return AbstractSpaceUpdate - */ - public function setTimeZone($timeZone) { - $this->timeZone = $timeZone; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class AbstractSpaceUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Abstract.Space.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'name' => 'string', + 'postal_address' => '\Wallee\Sdk\Model\SpaceAddressCreate', + 'primary_currency' => 'string', + 'request_limit' => 'int', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'technical_contact_addresses' => 'string[]', + 'time_zone' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'postal_address' => null, + 'primary_currency' => null, + 'request_limit' => 'int64', + 'state' => null, + 'technical_contact_addresses' => null, + 'time_zone' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'postal_address' => 'postalAddress', + 'primary_currency' => 'primaryCurrency', + 'request_limit' => 'requestLimit', + 'state' => 'state', + 'technical_contact_addresses' => 'technicalContactAddresses', + 'time_zone' => 'timeZone' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'postal_address' => 'setPostalAddress', + 'primary_currency' => 'setPrimaryCurrency', + 'request_limit' => 'setRequestLimit', + 'state' => 'setState', + 'technical_contact_addresses' => 'setTechnicalContactAddresses', + 'time_zone' => 'setTimeZone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'postal_address' => 'getPostalAddress', + 'primary_currency' => 'getPrimaryCurrency', + 'request_limit' => 'getRequestLimit', + 'state' => 'getState', + 'technical_contact_addresses' => 'getTechnicalContactAddresses', + 'time_zone' => 'getTimeZone' + ]; + + + + /** + * 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['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['postal_address'] = isset($data['postal_address']) ? $data['postal_address'] : null; + + $this->container['primary_currency'] = isset($data['primary_currency']) ? $data['primary_currency'] : null; + + $this->container['request_limit'] = isset($data['request_limit']) ? $data['request_limit'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['technical_contact_addresses'] = isset($data['technical_contact_addresses']) ? $data['technical_contact_addresses'] : null; + + $this->container['time_zone'] = isset($data['time_zone']) ? $data['time_zone'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The space name is used internally to identify the space in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets postal_address + * + * @return \Wallee\Sdk\Model\SpaceAddressCreate + */ + public function getPostalAddress() + { + return $this->container['postal_address']; + } + + /** + * Sets postal_address + * + * @param \Wallee\Sdk\Model\SpaceAddressCreate $postal_address The address to use in communication with clients for example in email, documents etc. + * + * @return $this + */ + public function setPostalAddress($postal_address) + { + $this->container['postal_address'] = $postal_address; + + return $this; + } + + + /** + * Gets primary_currency + * + * @return string + */ + public function getPrimaryCurrency() + { + return $this->container['primary_currency']; + } + + /** + * Sets primary_currency + * + * @param string $primary_currency This is the currency that is used to display aggregated amounts in the space. + * + * @return $this + */ + public function setPrimaryCurrency($primary_currency) + { + $this->container['primary_currency'] = $primary_currency; + + return $this; + } + + + /** + * Gets request_limit + * + * @return int + */ + public function getRequestLimit() + { + return $this->container['request_limit']; + } + + /** + * Sets request_limit + * + * @param int $request_limit The request limit defines the maximum number of API request accepted within 2 minutes for this space. This limit can only be changed with special privileges. + * + * @return $this + */ + public function setRequestLimit($request_limit) + { + $this->container['request_limit'] = $request_limit; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets technical_contact_addresses + * + * @return string[] + */ + public function getTechnicalContactAddresses() + { + return $this->container['technical_contact_addresses']; + } + + /** + * Sets technical_contact_addresses + * + * @param string[] $technical_contact_addresses The email address provided as contact addresses will be informed about technical issues or errors triggered by the space. + * + * @return $this + */ + public function setTechnicalContactAddresses($technical_contact_addresses) + { + $this->container['technical_contact_addresses'] = $technical_contact_addresses; + + return $this; + } + + + /** + * Gets time_zone + * + * @return string + */ + public function getTimeZone() + { + return $this->container['time_zone']; + } + + /** + * Sets time_zone + * + * @param string $time_zone The time zone assigned to the space determines the time offset for calculating dates within the space. This is typically used for background processed which needs to be triggered on a specific hour within the day. Changing the space time zone will not change the display of dates. + * + * @return $this + */ + public function setTimeZone($time_zone) + { + $this->container['time_zone'] = $time_zone; + + 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/wallee-sdk/lib/Model/AbstractSubscriberUpdate.php b/wallee-sdk/lib/Model/AbstractSubscriberUpdate.php index 89ad854..2b5fb74 100644 --- a/wallee-sdk/lib/Model/AbstractSubscriberUpdate.php +++ b/wallee-sdk/lib/Model/AbstractSubscriberUpdate.php @@ -1,10 +1,8 @@ 'int[]', - 'billingAddress' => '\Wallee\Sdk\Model\AddressCreate', - 'description' => 'string', - 'disallowedPaymentMethodConfigurations' => 'int[]', - 'emailAddress' => 'string', - 'language' => 'string', - 'metaData' => 'map[string,string]', - 'reference' => 'string', - 'shippingAddress' => '\Wallee\Sdk\Model\AddressCreate' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * Those payment methods which are allowed additionally will be available even when the product does not allow those methods. - * - * @var int[] - */ - private $additionalAllowedPaymentMethodConfigurations; - - /** - * - * - * @var \Wallee\Sdk\Model\AddressCreate - */ - private $billingAddress; - - /** - * The subscriber description can be used to add a description to the subscriber. This is used in the back office to identify the subscriber. - * - * @var string - */ - private $description; - - /** - * Those payment methods which are disallowed will not be available to the subscriber even if the product allows those methods. - * - * @var int[] - */ - private $disallowedPaymentMethodConfigurations; - - /** - * The email address is used to communicate with the subscriber. There can be only one subscriber per space with the same email address. - * - * @var string - */ - private $emailAddress; - - /** - * The subscriber language determines the language which is used to communicate with the subscriber in emails and documents (e.g. invoices). - * - * @var string - */ - private $language; - - /** - * Meta data allow to store additional data along the object. - * - * @var map[string,string] - */ - private $metaData; - - /** - * The subscriber reference identifies the subscriber in administrative interfaces (e.g. customer id). - * - * @var string - */ - private $reference; - - /** - * - * - * @var \Wallee\Sdk\Model\AddressCreate - */ - private $shippingAddress; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['additionalAllowedPaymentMethodConfigurations'])) { - $this->setAdditionalAllowedPaymentMethodConfigurations($data['additionalAllowedPaymentMethodConfigurations']); - } - if (isset($data['billingAddress'])) { - $this->setBillingAddress($data['billingAddress']); - } - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['disallowedPaymentMethodConfigurations'])) { - $this->setDisallowedPaymentMethodConfigurations($data['disallowedPaymentMethodConfigurations']); - } - if (isset($data['emailAddress'])) { - $this->setEmailAddress($data['emailAddress']); - } - if (isset($data['language'])) { - $this->setLanguage($data['language']); - } - if (isset($data['metaData'])) { - $this->setMetaData($data['metaData']); - } - if (isset($data['reference'])) { - $this->setReference($data['reference']); - } - if (isset($data['shippingAddress'])) { - $this->setShippingAddress($data['shippingAddress']); - } - } - - - /** - * Returns additionalAllowedPaymentMethodConfigurations. - * - * Those payment methods which are allowed additionally will be available even when the product does not allow those methods. - * - * @return int[] - */ - public function getAdditionalAllowedPaymentMethodConfigurations() { - return $this->additionalAllowedPaymentMethodConfigurations; - } - - /** - * Sets additionalAllowedPaymentMethodConfigurations. - * - * @param int[] $additionalAllowedPaymentMethodConfigurations - * @return AbstractSubscriberUpdate - */ - public function setAdditionalAllowedPaymentMethodConfigurations($additionalAllowedPaymentMethodConfigurations) { - $this->additionalAllowedPaymentMethodConfigurations = $additionalAllowedPaymentMethodConfigurations; - - return $this; - } - - /** - * Returns billingAddress. - * - * - * - * @return \Wallee\Sdk\Model\AddressCreate - */ - public function getBillingAddress() { - return $this->billingAddress; - } - - /** - * Sets billingAddress. - * - * @param \Wallee\Sdk\Model\AddressCreate $billingAddress - * @return AbstractSubscriberUpdate - */ - public function setBillingAddress($billingAddress) { - $this->billingAddress = $billingAddress; - - return $this; - } - - /** - * Returns description. - * - * The subscriber description can be used to add a description to the subscriber. This is used in the back office to identify the subscriber. - * - * @return string - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param string $description - * @return AbstractSubscriberUpdate - */ - public function setDescription($description) { - $this->description = $description; - - return $this; - } - - /** - * Returns disallowedPaymentMethodConfigurations. - * - * Those payment methods which are disallowed will not be available to the subscriber even if the product allows those methods. - * - * @return int[] - */ - public function getDisallowedPaymentMethodConfigurations() { - return $this->disallowedPaymentMethodConfigurations; - } - - /** - * Sets disallowedPaymentMethodConfigurations. - * - * @param int[] $disallowedPaymentMethodConfigurations - * @return AbstractSubscriberUpdate - */ - public function setDisallowedPaymentMethodConfigurations($disallowedPaymentMethodConfigurations) { - $this->disallowedPaymentMethodConfigurations = $disallowedPaymentMethodConfigurations; - - return $this; - } - - /** - * Returns emailAddress. - * - * The email address is used to communicate with the subscriber. There can be only one subscriber per space with the same email address. - * - * @return string - */ - public function getEmailAddress() { - return $this->emailAddress; - } - - /** - * Sets emailAddress. - * - * @param string $emailAddress - * @return AbstractSubscriberUpdate - */ - public function setEmailAddress($emailAddress) { - $this->emailAddress = $emailAddress; - - return $this; - } - - /** - * Returns language. - * - * The subscriber language determines the language which is used to communicate with the subscriber in emails and documents (e.g. invoices). - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return AbstractSubscriberUpdate - */ - public function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns metaData. - * - * Meta data allow to store additional data along the object. - * - * @return map[string,string] - */ - public function getMetaData() { - return $this->metaData; - } - - /** - * Sets metaData. - * - * @param map[string,string] $metaData - * @return AbstractSubscriberUpdate - */ - public function setMetaData($metaData) { - if (is_array($metaData) && empty($metaData)) { - $this->metaData = new \stdClass; - } else { - $this->metaData = $metaData; - } - - return $this; - } - - /** - * Returns reference. - * - * The subscriber reference identifies the subscriber in administrative interfaces (e.g. customer id). - * - * @return string - */ - public function getReference() { - return $this->reference; - } - - /** - * Sets reference. - * - * @param string $reference - * @return AbstractSubscriberUpdate - */ - public function setReference($reference) { - $this->reference = $reference; - - return $this; - } - - /** - * Returns shippingAddress. - * - * - * - * @return \Wallee\Sdk\Model\AddressCreate - */ - public function getShippingAddress() { - return $this->shippingAddress; - } - - /** - * Sets shippingAddress. - * - * @param \Wallee\Sdk\Model\AddressCreate $shippingAddress - * @return AbstractSubscriberUpdate - */ - public function setShippingAddress($shippingAddress) { - $this->shippingAddress = $shippingAddress; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class AbstractSubscriberUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Abstract.Subscriber.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'additional_allowed_payment_method_configurations' => 'int[]', + 'billing_address' => '\Wallee\Sdk\Model\AddressCreate', + 'description' => 'string', + 'disallowed_payment_method_configurations' => 'int[]', + 'email_address' => 'string', + 'language' => 'string', + 'meta_data' => 'map[string,string]', + 'reference' => 'string', + 'shipping_address' => '\Wallee\Sdk\Model\AddressCreate' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'additional_allowed_payment_method_configurations' => 'int64', + 'billing_address' => null, + 'description' => null, + 'disallowed_payment_method_configurations' => 'int64', + 'email_address' => null, + 'language' => null, + 'meta_data' => null, + 'reference' => null, + 'shipping_address' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'additional_allowed_payment_method_configurations' => 'additionalAllowedPaymentMethodConfigurations', + 'billing_address' => 'billingAddress', + 'description' => 'description', + 'disallowed_payment_method_configurations' => 'disallowedPaymentMethodConfigurations', + 'email_address' => 'emailAddress', + 'language' => 'language', + 'meta_data' => 'metaData', + 'reference' => 'reference', + 'shipping_address' => 'shippingAddress' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additional_allowed_payment_method_configurations' => 'setAdditionalAllowedPaymentMethodConfigurations', + 'billing_address' => 'setBillingAddress', + 'description' => 'setDescription', + 'disallowed_payment_method_configurations' => 'setDisallowedPaymentMethodConfigurations', + 'email_address' => 'setEmailAddress', + 'language' => 'setLanguage', + 'meta_data' => 'setMetaData', + 'reference' => 'setReference', + 'shipping_address' => 'setShippingAddress' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additional_allowed_payment_method_configurations' => 'getAdditionalAllowedPaymentMethodConfigurations', + 'billing_address' => 'getBillingAddress', + 'description' => 'getDescription', + 'disallowed_payment_method_configurations' => 'getDisallowedPaymentMethodConfigurations', + 'email_address' => 'getEmailAddress', + 'language' => 'getLanguage', + 'meta_data' => 'getMetaData', + 'reference' => 'getReference', + 'shipping_address' => 'getShippingAddress' + ]; + + + + /** + * 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['additional_allowed_payment_method_configurations'] = isset($data['additional_allowed_payment_method_configurations']) ? $data['additional_allowed_payment_method_configurations'] : null; + + $this->container['billing_address'] = isset($data['billing_address']) ? $data['billing_address'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['disallowed_payment_method_configurations'] = isset($data['disallowed_payment_method_configurations']) ? $data['disallowed_payment_method_configurations'] : null; + + $this->container['email_address'] = isset($data['email_address']) ? $data['email_address'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['meta_data'] = isset($data['meta_data']) ? $data['meta_data'] : null; + + $this->container['reference'] = isset($data['reference']) ? $data['reference'] : null; + + $this->container['shipping_address'] = isset($data['shipping_address']) ? $data['shipping_address'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 additional_allowed_payment_method_configurations + * + * @return int[] + */ + public function getAdditionalAllowedPaymentMethodConfigurations() + { + return $this->container['additional_allowed_payment_method_configurations']; + } + + /** + * Sets additional_allowed_payment_method_configurations + * + * @param int[] $additional_allowed_payment_method_configurations Those payment methods which are allowed additionally will be available even when the product does not allow those methods. + * + * @return $this + */ + public function setAdditionalAllowedPaymentMethodConfigurations($additional_allowed_payment_method_configurations) + { + $this->container['additional_allowed_payment_method_configurations'] = $additional_allowed_payment_method_configurations; + + return $this; + } + + + /** + * Gets billing_address + * + * @return \Wallee\Sdk\Model\AddressCreate + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Wallee\Sdk\Model\AddressCreate $billing_address + * + * @return $this + */ + public function setBillingAddress($billing_address) + { + $this->container['billing_address'] = $billing_address; + + return $this; + } + + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description The subscriber description can be used to add a description to the subscriber. This is used in the back office to identify the subscriber. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets disallowed_payment_method_configurations + * + * @return int[] + */ + public function getDisallowedPaymentMethodConfigurations() + { + return $this->container['disallowed_payment_method_configurations']; + } + + /** + * Sets disallowed_payment_method_configurations + * + * @param int[] $disallowed_payment_method_configurations Those payment methods which are disallowed will not be available to the subscriber even if the product allows those methods. + * + * @return $this + */ + public function setDisallowedPaymentMethodConfigurations($disallowed_payment_method_configurations) + { + $this->container['disallowed_payment_method_configurations'] = $disallowed_payment_method_configurations; + + return $this; + } + + + /** + * Gets email_address + * + * @return string + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string $email_address The email address is used to communicate with the subscriber. There can be only one subscriber per space with the same email address. + * + * @return $this + */ + public function setEmailAddress($email_address) + { + $this->container['email_address'] = $email_address; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language The subscriber language determines the language which is used to communicate with the subscriber in emails and documents (e.g. invoices). + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets meta_data + * + * @return map[string,string] + */ + public function getMetaData() + { + return $this->container['meta_data']; + } + + /** + * Sets meta_data + * + * @param map[string,string] $meta_data Meta data allow to store additional data along the object. + * + * @return $this + */ + public function setMetaData($meta_data) + { + $this->container['meta_data'] = $meta_data; + + return $this; + } + + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference The subscriber reference identifies the subscriber in administrative interfaces (e.g. customer id). + * + * @return $this + */ + public function setReference($reference) + { + $this->container['reference'] = $reference; + + return $this; + } + + + /** + * Gets shipping_address + * + * @return \Wallee\Sdk\Model\AddressCreate + */ + public function getShippingAddress() + { + return $this->container['shipping_address']; + } + + /** + * Sets shipping_address + * + * @param \Wallee\Sdk\Model\AddressCreate $shipping_address + * + * @return $this + */ + public function setShippingAddress($shipping_address) + { + $this->container['shipping_address'] = $shipping_address; + + 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/wallee-sdk/lib/Model/AbstractSubscriptionAffiliateUpdate.php b/wallee-sdk/lib/Model/AbstractSubscriptionAffiliateUpdate.php index 15c174e..8751c98 100644 --- a/wallee-sdk/lib/Model/AbstractSubscriptionAffiliateUpdate.php +++ b/wallee-sdk/lib/Model/AbstractSubscriptionAffiliateUpdate.php @@ -1,10 +1,8 @@ 'string', - 'metaData' => 'map[string,string]', - 'name' => 'string', - 'state' => '\Wallee\Sdk\Model\CreationEntityState' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var string - */ - private $language; - - /** - * Meta data allow to store additional data along the object. - * - * @var map[string,string] - */ - private $metaData; - - /** - * - * - * @var string - */ - private $name; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['language'])) { - $this->setLanguage($data['language']); - } - if (isset($data['metaData'])) { - $this->setMetaData($data['metaData']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - } - - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return AbstractSubscriptionAffiliateUpdate - */ - public function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns metaData. - * - * Meta data allow to store additional data along the object. - * - * @return map[string,string] - */ - public function getMetaData() { - return $this->metaData; - } - - /** - * Sets metaData. - * - * @param map[string,string] $metaData - * @return AbstractSubscriptionAffiliateUpdate - */ - public function setMetaData($metaData) { - if (is_array($metaData) && empty($metaData)) { - $this->metaData = new \stdClass; - } else { - $this->metaData = $metaData; - } - - return $this; - } - - /** - * Returns name. - * - * - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return AbstractSubscriptionAffiliateUpdate - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return AbstractSubscriptionAffiliateUpdate - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class AbstractSubscriptionAffiliateUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Abstract.SubscriptionAffiliate.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'language' => 'string', + 'meta_data' => 'map[string,string]', + 'name' => 'string', + 'state' => '\Wallee\Sdk\Model\CreationEntityState' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'language' => null, + 'meta_data' => null, + 'name' => null, + 'state' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'language' => 'language', + 'meta_data' => 'metaData', + 'name' => 'name', + 'state' => 'state' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'language' => 'setLanguage', + 'meta_data' => 'setMetaData', + 'name' => 'setName', + 'state' => 'setState' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'language' => 'getLanguage', + 'meta_data' => 'getMetaData', + 'name' => 'getName', + 'state' => 'getState' + ]; + + + + /** + * 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['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['meta_data'] = isset($data['meta_data']) ? $data['meta_data'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets meta_data + * + * @return map[string,string] + */ + public function getMetaData() + { + return $this->container['meta_data']; + } + + /** + * Sets meta_data + * + * @param map[string,string] $meta_data Meta data allow to store additional data along the object. + * + * @return $this + */ + public function setMetaData($meta_data) + { + $this->container['meta_data'] = $meta_data; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + 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/wallee-sdk/lib/Model/AbstractSubscriptionMetricUpdate.php b/wallee-sdk/lib/Model/AbstractSubscriptionMetricUpdate.php index e6ed80b..85e2cb7 100644 --- a/wallee-sdk/lib/Model/AbstractSubscriptionMetricUpdate.php +++ b/wallee-sdk/lib/Model/AbstractSubscriptionMetricUpdate.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', - 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - private $description; - - /** - * - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - private $name; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - } - - - /** - * Returns description. - * - * - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $description - * @return AbstractSubscriptionMetricUpdate - */ - public function setDescription($description) { - $this->description = $description; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $name - * @return AbstractSubscriptionMetricUpdate - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class AbstractSubscriptionMetricUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Abstract.SubscriptionMetric.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'description' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', + 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'name' => 'getName' + ]; + + + + /** + * 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['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 description + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets name + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + 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/wallee-sdk/lib/Model/AbstractSubscriptionProductActive.php b/wallee-sdk/lib/Model/AbstractSubscriptionProductActive.php index c435cc1..cec70f1 100644 --- a/wallee-sdk/lib/Model/AbstractSubscriptionProductActive.php +++ b/wallee-sdk/lib/Model/AbstractSubscriptionProductActive.php @@ -1,10 +1,8 @@ 'int[]', - 'failedPaymentSuspensionPeriod' => 'string', - 'name' => 'string', - 'sortOrder' => 'int', - 'state' => '\Wallee\Sdk\Model\SubscriptionProductState' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The allowed payment method configurations control which payment methods can be used with this product. When none is selected all methods will be allowed. - * - * @var int[] - */ - private $allowedPaymentMethodConfigurations; - - /** - * When a payment fails, the subscription to which the payment belongs to will be suspended. When the suspension is not removed within the specified period the subscription will be terminated. A payment is considered as failed when the subscriber issues a refund or when a subscription charge fails. - * - * @var string - */ - private $failedPaymentSuspensionPeriod; - - /** - * The product name is used internally to identify the configuration in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * The sort order controls in which order the product is listed. The sort order is used to order the products in ascending order. - * - * @var int - */ - private $sortOrder; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionProductState - */ - private $state; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['allowedPaymentMethodConfigurations'])) { - $this->setAllowedPaymentMethodConfigurations($data['allowedPaymentMethodConfigurations']); - } - if (isset($data['failedPaymentSuspensionPeriod'])) { - $this->setFailedPaymentSuspensionPeriod($data['failedPaymentSuspensionPeriod']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['sortOrder'])) { - $this->setSortOrder($data['sortOrder']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - } - - - /** - * Returns allowedPaymentMethodConfigurations. - * - * The allowed payment method configurations control which payment methods can be used with this product. When none is selected all methods will be allowed. - * - * @return int[] - */ - public function getAllowedPaymentMethodConfigurations() { - return $this->allowedPaymentMethodConfigurations; - } - - /** - * Sets allowedPaymentMethodConfigurations. - * - * @param int[] $allowedPaymentMethodConfigurations - * @return AbstractSubscriptionProductActive - */ - public function setAllowedPaymentMethodConfigurations($allowedPaymentMethodConfigurations) { - $this->allowedPaymentMethodConfigurations = $allowedPaymentMethodConfigurations; - - return $this; - } - - /** - * Returns failedPaymentSuspensionPeriod. - * - * When a payment fails, the subscription to which the payment belongs to will be suspended. When the suspension is not removed within the specified period the subscription will be terminated. A payment is considered as failed when the subscriber issues a refund or when a subscription charge fails. - * - * @return string - */ - public function getFailedPaymentSuspensionPeriod() { - return $this->failedPaymentSuspensionPeriod; - } - - /** - * Sets failedPaymentSuspensionPeriod. - * - * @param string $failedPaymentSuspensionPeriod - * @return AbstractSubscriptionProductActive - */ - public function setFailedPaymentSuspensionPeriod($failedPaymentSuspensionPeriod) { - $this->failedPaymentSuspensionPeriod = $failedPaymentSuspensionPeriod; - - return $this; - } - - /** - * Returns name. - * - * The product name is used internally to identify the configuration in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return AbstractSubscriptionProductActive - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns sortOrder. - * - * The sort order controls in which order the product is listed. The sort order is used to order the products in ascending order. - * - * @return int - */ - public function getSortOrder() { - return $this->sortOrder; - } - - /** - * Sets sortOrder. - * - * @param int $sortOrder - * @return AbstractSubscriptionProductActive - */ - public function setSortOrder($sortOrder) { - $this->sortOrder = $sortOrder; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionProductState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\SubscriptionProductState $state - * @return AbstractSubscriptionProductActive - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class AbstractSubscriptionProductActive implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Abstract.SubscriptionProduct.Active'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'allowed_payment_method_configurations' => 'int[]', + 'failed_payment_suspension_period' => 'string', + 'name' => 'string', + 'sort_order' => 'int', + 'state' => '\Wallee\Sdk\Model\SubscriptionProductState' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'allowed_payment_method_configurations' => 'int64', + 'failed_payment_suspension_period' => null, + 'name' => null, + 'sort_order' => 'int32', + 'state' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'allowed_payment_method_configurations' => 'allowedPaymentMethodConfigurations', + 'failed_payment_suspension_period' => 'failedPaymentSuspensionPeriod', + 'name' => 'name', + 'sort_order' => 'sortOrder', + 'state' => 'state' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'allowed_payment_method_configurations' => 'setAllowedPaymentMethodConfigurations', + 'failed_payment_suspension_period' => 'setFailedPaymentSuspensionPeriod', + 'name' => 'setName', + 'sort_order' => 'setSortOrder', + 'state' => 'setState' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'allowed_payment_method_configurations' => 'getAllowedPaymentMethodConfigurations', + 'failed_payment_suspension_period' => 'getFailedPaymentSuspensionPeriod', + 'name' => 'getName', + 'sort_order' => 'getSortOrder', + 'state' => 'getState' + ]; + + + + /** + * 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['allowed_payment_method_configurations'] = isset($data['allowed_payment_method_configurations']) ? $data['allowed_payment_method_configurations'] : null; + + $this->container['failed_payment_suspension_period'] = isset($data['failed_payment_suspension_period']) ? $data['failed_payment_suspension_period'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['sort_order'] = isset($data['sort_order']) ? $data['sort_order'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 allowed_payment_method_configurations + * + * @return int[] + */ + public function getAllowedPaymentMethodConfigurations() + { + return $this->container['allowed_payment_method_configurations']; + } + + /** + * Sets allowed_payment_method_configurations + * + * @param int[] $allowed_payment_method_configurations The allowed payment method configurations control which payment methods can be used with this product. When none is selected all methods will be allowed. + * + * @return $this + */ + public function setAllowedPaymentMethodConfigurations($allowed_payment_method_configurations) + { + $this->container['allowed_payment_method_configurations'] = $allowed_payment_method_configurations; + + return $this; + } + + + /** + * Gets failed_payment_suspension_period + * + * @return string + */ + public function getFailedPaymentSuspensionPeriod() + { + return $this->container['failed_payment_suspension_period']; + } + + /** + * Sets failed_payment_suspension_period + * + * @param string $failed_payment_suspension_period When a payment fails, the subscription to which the payment belongs to will be suspended. When the suspension is not removed within the specified period the subscription will be terminated. A payment is considered as failed when the subscriber issues a refund or when a subscription charge fails. + * + * @return $this + */ + public function setFailedPaymentSuspensionPeriod($failed_payment_suspension_period) + { + $this->container['failed_payment_suspension_period'] = $failed_payment_suspension_period; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The product name is used internally to identify the configuration in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets sort_order + * + * @return int + */ + public function getSortOrder() + { + return $this->container['sort_order']; + } + + /** + * Sets sort_order + * + * @param int $sort_order The sort order controls in which order the product is listed. The sort order is used to order the products in ascending order. + * + * @return $this + */ + public function setSortOrder($sort_order) + { + $this->container['sort_order'] = $sort_order; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\SubscriptionProductState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\SubscriptionProductState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + 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/wallee-sdk/lib/Model/AbstractTokenUpdate.php b/wallee-sdk/lib/Model/AbstractTokenUpdate.php index b1d385b..27c20d9 100644 --- a/wallee-sdk/lib/Model/AbstractTokenUpdate.php +++ b/wallee-sdk/lib/Model/AbstractTokenUpdate.php @@ -1,10 +1,8 @@ 'string', - 'customerId' => 'string', - 'enabledForOneClickPayment' => 'bool', - 'language' => 'string', - 'timeZone' => 'string', - 'tokenReference' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The customer email address is the email address of the customer. - * - * @var string - */ - private $customerEmailAddress; - - /** - * The customer ID identifies the customer in the merchant system. In case the customer ID has been provided it has to correspond with the customer ID provided on the transaction. The customer ID will not be changed automatically. The merchant system has to provide it. - * - * @var string - */ - private $customerId; - - /** - * When a token is enabled for one-click payments the buyer will be able to select the token within the iFrame or on the payment page to pay with the token. The usage of the token will reduce the number of steps the buyer has to go through. The buyer is linked via the customer ID on the transaction with the token. Means the token will be visible for buyers with the same customer ID. Additionally the payment method has to be configured to allow the one-click payments. - * - * @var bool - */ - private $enabledForOneClickPayment; - - /** - * - * - * @var string - */ - private $language; - - /** - * The time zone defines in which time zone the customer is located in. The time zone may affects how dates are formatted when interacting with the customer. - * - * @var string - */ - private $timeZone; - - /** - * Use something that it is easy to identify and may help you find the token (e.g. customer id, email address). - * - * @var string - */ - private $tokenReference; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['customerEmailAddress'])) { - $this->setCustomerEmailAddress($data['customerEmailAddress']); - } - if (isset($data['customerId'])) { - $this->setCustomerId($data['customerId']); - } - if (isset($data['enabledForOneClickPayment'])) { - $this->setEnabledForOneClickPayment($data['enabledForOneClickPayment']); - } - if (isset($data['language'])) { - $this->setLanguage($data['language']); - } - if (isset($data['timeZone'])) { - $this->setTimeZone($data['timeZone']); - } - if (isset($data['tokenReference'])) { - $this->setTokenReference($data['tokenReference']); - } - } - - - /** - * Returns customerEmailAddress. - * - * The customer email address is the email address of the customer. - * - * @return string - */ - public function getCustomerEmailAddress() { - return $this->customerEmailAddress; - } - - /** - * Sets customerEmailAddress. - * - * @param string $customerEmailAddress - * @return AbstractTokenUpdate - */ - public function setCustomerEmailAddress($customerEmailAddress) { - $this->customerEmailAddress = $customerEmailAddress; - - return $this; - } - - /** - * Returns customerId. - * - * The customer ID identifies the customer in the merchant system. In case the customer ID has been provided it has to correspond with the customer ID provided on the transaction. The customer ID will not be changed automatically. The merchant system has to provide it. - * - * @return string - */ - public function getCustomerId() { - return $this->customerId; - } - - /** - * Sets customerId. - * - * @param string $customerId - * @return AbstractTokenUpdate - */ - public function setCustomerId($customerId) { - $this->customerId = $customerId; - - return $this; - } - - /** - * Returns enabledForOneClickPayment. - * - * When a token is enabled for one-click payments the buyer will be able to select the token within the iFrame or on the payment page to pay with the token. The usage of the token will reduce the number of steps the buyer has to go through. The buyer is linked via the customer ID on the transaction with the token. Means the token will be visible for buyers with the same customer ID. Additionally the payment method has to be configured to allow the one-click payments. - * - * @return bool - */ - public function getEnabledForOneClickPayment() { - return $this->enabledForOneClickPayment; - } - - /** - * Sets enabledForOneClickPayment. - * - * @param bool $enabledForOneClickPayment - * @return AbstractTokenUpdate - */ - public function setEnabledForOneClickPayment($enabledForOneClickPayment) { - $this->enabledForOneClickPayment = $enabledForOneClickPayment; - - return $this; - } - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return AbstractTokenUpdate - */ - public function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns timeZone. - * - * The time zone defines in which time zone the customer is located in. The time zone may affects how dates are formatted when interacting with the customer. - * - * @return string - */ - public function getTimeZone() { - return $this->timeZone; - } - - /** - * Sets timeZone. - * - * @param string $timeZone - * @return AbstractTokenUpdate - */ - public function setTimeZone($timeZone) { - $this->timeZone = $timeZone; - - return $this; - } - - /** - * Returns tokenReference. - * - * Use something that it is easy to identify and may help you find the token (e.g. customer id, email address). - * - * @return string - */ - public function getTokenReference() { - return $this->tokenReference; - } - - /** - * Sets tokenReference. - * - * @param string $tokenReference - * @return AbstractTokenUpdate - */ - public function setTokenReference($tokenReference) { - $this->tokenReference = $tokenReference; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class AbstractTokenUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Abstract.Token.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'customer_email_address' => 'string', + 'customer_id' => 'string', + 'enabled_for_one_click_payment' => 'bool', + 'language' => 'string', + 'time_zone' => 'string', + 'token_reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'customer_email_address' => null, + 'customer_id' => null, + 'enabled_for_one_click_payment' => null, + 'language' => null, + 'time_zone' => null, + 'token_reference' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'customer_email_address' => 'customerEmailAddress', + 'customer_id' => 'customerId', + 'enabled_for_one_click_payment' => 'enabledForOneClickPayment', + 'language' => 'language', + 'time_zone' => 'timeZone', + 'token_reference' => 'tokenReference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'customer_email_address' => 'setCustomerEmailAddress', + 'customer_id' => 'setCustomerId', + 'enabled_for_one_click_payment' => 'setEnabledForOneClickPayment', + 'language' => 'setLanguage', + 'time_zone' => 'setTimeZone', + 'token_reference' => 'setTokenReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'customer_email_address' => 'getCustomerEmailAddress', + 'customer_id' => 'getCustomerId', + 'enabled_for_one_click_payment' => 'getEnabledForOneClickPayment', + 'language' => 'getLanguage', + 'time_zone' => 'getTimeZone', + 'token_reference' => 'getTokenReference' + ]; + + + + /** + * 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['customer_email_address'] = isset($data['customer_email_address']) ? $data['customer_email_address'] : null; + + $this->container['customer_id'] = isset($data['customer_id']) ? $data['customer_id'] : null; + + $this->container['enabled_for_one_click_payment'] = isset($data['enabled_for_one_click_payment']) ? $data['enabled_for_one_click_payment'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['time_zone'] = isset($data['time_zone']) ? $data['time_zone'] : null; + + $this->container['token_reference'] = isset($data['token_reference']) ? $data['token_reference'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 customer_email_address + * + * @return string + */ + public function getCustomerEmailAddress() + { + return $this->container['customer_email_address']; + } + + /** + * Sets customer_email_address + * + * @param string $customer_email_address The customer email address is the email address of the customer. + * + * @return $this + */ + public function setCustomerEmailAddress($customer_email_address) + { + $this->container['customer_email_address'] = $customer_email_address; + + return $this; + } + + + /** + * Gets customer_id + * + * @return string + */ + public function getCustomerId() + { + return $this->container['customer_id']; + } + + /** + * Sets customer_id + * + * @param string $customer_id The customer ID identifies the customer in the merchant system. In case the customer ID has been provided it has to correspond with the customer ID provided on the transaction. The customer ID will not be changed automatically. The merchant system has to provide it. + * + * @return $this + */ + public function setCustomerId($customer_id) + { + $this->container['customer_id'] = $customer_id; + + return $this; + } + + + /** + * Gets enabled_for_one_click_payment + * + * @return bool + */ + public function getEnabledForOneClickPayment() + { + return $this->container['enabled_for_one_click_payment']; + } + + /** + * Sets enabled_for_one_click_payment + * + * @param bool $enabled_for_one_click_payment When a token is enabled for one-click payments the buyer will be able to select the token within the iFrame or on the payment page to pay with the token. The usage of the token will reduce the number of steps the buyer has to go through. The buyer is linked via the customer ID on the transaction with the token. Means the token will be visible for buyers with the same customer ID. Additionally the payment method has to be configured to allow the one-click payments. + * + * @return $this + */ + public function setEnabledForOneClickPayment($enabled_for_one_click_payment) + { + $this->container['enabled_for_one_click_payment'] = $enabled_for_one_click_payment; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets time_zone + * + * @return string + */ + public function getTimeZone() + { + return $this->container['time_zone']; + } + + /** + * Sets time_zone + * + * @param string $time_zone The time zone defines in which time zone the customer is located in. The time zone may affects how dates are formatted when interacting with the customer. + * + * @return $this + */ + public function setTimeZone($time_zone) + { + $this->container['time_zone'] = $time_zone; + + return $this; + } + + + /** + * Gets token_reference + * + * @return string + */ + public function getTokenReference() + { + return $this->container['token_reference']; + } + + /** + * Sets token_reference + * + * @param string $token_reference Use something that it is easy to identify and may help you find the token (e.g. customer id, email address). + * + * @return $this + */ + public function setTokenReference($token_reference) + { + $this->container['token_reference'] = $token_reference; + + 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/wallee-sdk/lib/Model/AbstractTransactionCommentActive.php b/wallee-sdk/lib/Model/AbstractTransactionCommentActive.php new file mode 100644 index 0000000..3f7f26d --- /dev/null +++ b/wallee-sdk/lib/Model/AbstractTransactionCommentActive.php @@ -0,0 +1,297 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'content' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'content' => 'content' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent' + ]; + + + + /** + * 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; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content + * + * @return $this + */ + public function setContent($content) + { + $this->container['content'] = $content; + + 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/wallee-sdk/lib/Model/AbstractTransactionInvoiceCommentActive.php b/wallee-sdk/lib/Model/AbstractTransactionInvoiceCommentActive.php new file mode 100644 index 0000000..6e4175e --- /dev/null +++ b/wallee-sdk/lib/Model/AbstractTransactionInvoiceCommentActive.php @@ -0,0 +1,297 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'content' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'content' => 'content' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent' + ]; + + + + /** + * 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; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content + * + * @return $this + */ + public function setContent($content) + { + $this->container['content'] = $content; + + 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/wallee-sdk/lib/Model/AbstractTransactionPending.php b/wallee-sdk/lib/Model/AbstractTransactionPending.php index 100f850..b4d154f 100644 --- a/wallee-sdk/lib/Model/AbstractTransactionPending.php +++ b/wallee-sdk/lib/Model/AbstractTransactionPending.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\PaymentMethodBrand[]', - 'allowedPaymentMethodConfigurations' => 'int[]', - 'billingAddress' => '\Wallee\Sdk\Model\AddressCreate', - 'currency' => 'string', - 'customerEmailAddress' => 'string', - 'customerId' => 'string', - 'failedUrl' => 'string', - 'invoiceMerchantReference' => 'string', - 'language' => 'string', - 'lineItems' => '\Wallee\Sdk\Model\LineItemCreate[]', - 'merchantReference' => 'string', - 'metaData' => 'map[string,string]', - 'shippingAddress' => '\Wallee\Sdk\Model\AddressCreate', - 'shippingMethod' => 'string', - 'successUrl' => 'string', - 'timeZone' => 'string', - 'token' => 'int', - 'tokenizationMode' => '\Wallee\Sdk\Model\TokenizationnMode' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\PaymentMethodBrand[] - */ - private $allowedPaymentMethodBrands; - - /** - * - * - * @var int[] - */ - private $allowedPaymentMethodConfigurations; - - /** - * - * - * @var \Wallee\Sdk\Model\AddressCreate - */ - private $billingAddress; - - /** - * - * - * @var string - */ - private $currency; - - /** - * The customer email address is the email address of the customer. If no email address is provided on the shipping or billing address this address is used. - * - * @var string - */ - private $customerEmailAddress; - - /** - * - * - * @var string - */ - private $customerId; - - /** - * The user will be redirected to failed URL when the transaction could not be authorized or completed. In case no failed URL is specified a default failed page will be displayed. - * - * @var string - */ - private $failedUrl; - - /** - * - * - * @var string - */ - private $invoiceMerchantReference; - - /** - * - * - * @var string - */ - private $language; - - /** - * - * - * @var \Wallee\Sdk\Model\LineItemCreate[] - */ - private $lineItems; - - /** - * - * - * @var string - */ - private $merchantReference; - - /** - * Meta data allow to store additional data along the object. - * - * @var map[string,string] - */ - private $metaData; - - /** - * - * - * @var \Wallee\Sdk\Model\AddressCreate - */ - private $shippingAddress; - - /** - * - * - * @var string - */ - private $shippingMethod; - - /** - * The user will be redirected to success URL when the transaction could be authorized or completed. In case no success URL is specified a default success page will be displayed. - * - * @var string - */ - private $successUrl; - - /** - * The time zone defines in which time zone the customer is located in. The time zone may affects how dates are formatted when interacting with the customer. - * - * @var string - */ - private $timeZone; - - /** - * - * - * @var int - */ - private $token; - - /** - * The tokenization mode controls if and how the tokenization of payment information is applied to the transaction. - * - * @var \Wallee\Sdk\Model\TokenizationnMode - */ - private $tokenizationMode; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['allowedPaymentMethodBrands'])) { - $this->setAllowedPaymentMethodBrands($data['allowedPaymentMethodBrands']); - } - if (isset($data['allowedPaymentMethodConfigurations'])) { - $this->setAllowedPaymentMethodConfigurations($data['allowedPaymentMethodConfigurations']); - } - if (isset($data['billingAddress'])) { - $this->setBillingAddress($data['billingAddress']); - } - if (isset($data['currency'])) { - $this->setCurrency($data['currency']); - } - if (isset($data['customerEmailAddress'])) { - $this->setCustomerEmailAddress($data['customerEmailAddress']); - } - if (isset($data['customerId'])) { - $this->setCustomerId($data['customerId']); - } - if (isset($data['failedUrl'])) { - $this->setFailedUrl($data['failedUrl']); - } - if (isset($data['invoiceMerchantReference'])) { - $this->setInvoiceMerchantReference($data['invoiceMerchantReference']); - } - if (isset($data['language'])) { - $this->setLanguage($data['language']); - } - if (isset($data['lineItems'])) { - $this->setLineItems($data['lineItems']); - } - if (isset($data['merchantReference'])) { - $this->setMerchantReference($data['merchantReference']); - } - if (isset($data['metaData'])) { - $this->setMetaData($data['metaData']); - } - if (isset($data['shippingAddress'])) { - $this->setShippingAddress($data['shippingAddress']); - } - if (isset($data['shippingMethod'])) { - $this->setShippingMethod($data['shippingMethod']); - } - if (isset($data['successUrl'])) { - $this->setSuccessUrl($data['successUrl']); - } - if (isset($data['timeZone'])) { - $this->setTimeZone($data['timeZone']); - } - if (isset($data['token'])) { - $this->setToken($data['token']); - } - if (isset($data['tokenizationMode'])) { - $this->setTokenizationMode($data['tokenizationMode']); - } - } - - - /** - * Returns allowedPaymentMethodBrands. - * - * - * - * @return \Wallee\Sdk\Model\PaymentMethodBrand[] - */ - public function getAllowedPaymentMethodBrands() { - return $this->allowedPaymentMethodBrands; - } - - /** - * Sets allowedPaymentMethodBrands. - * - * @param \Wallee\Sdk\Model\PaymentMethodBrand[] $allowedPaymentMethodBrands - * @return AbstractTransactionPending - */ - public function setAllowedPaymentMethodBrands($allowedPaymentMethodBrands) { - $this->allowedPaymentMethodBrands = $allowedPaymentMethodBrands; - - return $this; - } - - /** - * Returns allowedPaymentMethodConfigurations. - * - * - * - * @return int[] - */ - public function getAllowedPaymentMethodConfigurations() { - return $this->allowedPaymentMethodConfigurations; - } - - /** - * Sets allowedPaymentMethodConfigurations. - * - * @param int[] $allowedPaymentMethodConfigurations - * @return AbstractTransactionPending - */ - public function setAllowedPaymentMethodConfigurations($allowedPaymentMethodConfigurations) { - $this->allowedPaymentMethodConfigurations = $allowedPaymentMethodConfigurations; - - return $this; - } - - /** - * Returns billingAddress. - * - * - * - * @return \Wallee\Sdk\Model\AddressCreate - */ - public function getBillingAddress() { - return $this->billingAddress; - } - - /** - * Sets billingAddress. - * - * @param \Wallee\Sdk\Model\AddressCreate $billingAddress - * @return AbstractTransactionPending - */ - public function setBillingAddress($billingAddress) { - $this->billingAddress = $billingAddress; - - return $this; - } - - /** - * Returns currency. - * - * - * - * @return string - */ - public function getCurrency() { - return $this->currency; - } - - /** - * Sets currency. - * - * @param string $currency - * @return AbstractTransactionPending - */ - public function setCurrency($currency) { - $this->currency = $currency; - - return $this; - } - - /** - * Returns customerEmailAddress. - * - * The customer email address is the email address of the customer. If no email address is provided on the shipping or billing address this address is used. - * - * @return string - */ - public function getCustomerEmailAddress() { - return $this->customerEmailAddress; - } - - /** - * Sets customerEmailAddress. - * - * @param string $customerEmailAddress - * @return AbstractTransactionPending - */ - public function setCustomerEmailAddress($customerEmailAddress) { - $this->customerEmailAddress = $customerEmailAddress; - - return $this; - } - - /** - * Returns customerId. - * - * - * - * @return string - */ - public function getCustomerId() { - return $this->customerId; - } - - /** - * Sets customerId. - * - * @param string $customerId - * @return AbstractTransactionPending - */ - public function setCustomerId($customerId) { - $this->customerId = $customerId; - - return $this; - } - - /** - * Returns failedUrl. - * - * The user will be redirected to failed URL when the transaction could not be authorized or completed. In case no failed URL is specified a default failed page will be displayed. - * - * @return string - */ - public function getFailedUrl() { - return $this->failedUrl; - } - - /** - * Sets failedUrl. - * - * @param string $failedUrl - * @return AbstractTransactionPending - */ - public function setFailedUrl($failedUrl) { - $this->failedUrl = $failedUrl; - - return $this; - } - - /** - * Returns invoiceMerchantReference. - * - * - * - * @return string - */ - public function getInvoiceMerchantReference() { - return $this->invoiceMerchantReference; - } - - /** - * Sets invoiceMerchantReference. - * - * @param string $invoiceMerchantReference - * @return AbstractTransactionPending - */ - public function setInvoiceMerchantReference($invoiceMerchantReference) { - $this->invoiceMerchantReference = $invoiceMerchantReference; - - return $this; - } - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return AbstractTransactionPending - */ - public function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns lineItems. - * - * - * - * @return \Wallee\Sdk\Model\LineItemCreate[] - */ - public function getLineItems() { - return $this->lineItems; - } - - /** - * Sets lineItems. - * - * @param \Wallee\Sdk\Model\LineItemCreate[] $lineItems - * @return AbstractTransactionPending - */ - public function setLineItems($lineItems) { - $this->lineItems = $lineItems; - - return $this; - } - - /** - * Returns merchantReference. - * - * - * - * @return string - */ - public function getMerchantReference() { - return $this->merchantReference; - } - - /** - * Sets merchantReference. - * - * @param string $merchantReference - * @return AbstractTransactionPending - */ - public function setMerchantReference($merchantReference) { - $this->merchantReference = $merchantReference; - - return $this; - } - - /** - * Returns metaData. - * - * Meta data allow to store additional data along the object. - * - * @return map[string,string] - */ - public function getMetaData() { - return $this->metaData; - } - - /** - * Sets metaData. - * - * @param map[string,string] $metaData - * @return AbstractTransactionPending - */ - public function setMetaData($metaData) { - if (is_array($metaData) && empty($metaData)) { - $this->metaData = new \stdClass; - } else { - $this->metaData = $metaData; - } - - return $this; - } - - /** - * Returns shippingAddress. - * - * - * - * @return \Wallee\Sdk\Model\AddressCreate - */ - public function getShippingAddress() { - return $this->shippingAddress; - } - - /** - * Sets shippingAddress. - * - * @param \Wallee\Sdk\Model\AddressCreate $shippingAddress - * @return AbstractTransactionPending - */ - public function setShippingAddress($shippingAddress) { - $this->shippingAddress = $shippingAddress; - - return $this; - } - - /** - * Returns shippingMethod. - * - * - * - * @return string - */ - public function getShippingMethod() { - return $this->shippingMethod; - } - - /** - * Sets shippingMethod. - * - * @param string $shippingMethod - * @return AbstractTransactionPending - */ - public function setShippingMethod($shippingMethod) { - $this->shippingMethod = $shippingMethod; - - return $this; - } - - /** - * Returns successUrl. - * - * The user will be redirected to success URL when the transaction could be authorized or completed. In case no success URL is specified a default success page will be displayed. - * - * @return string - */ - public function getSuccessUrl() { - return $this->successUrl; - } - - /** - * Sets successUrl. - * - * @param string $successUrl - * @return AbstractTransactionPending - */ - public function setSuccessUrl($successUrl) { - $this->successUrl = $successUrl; - - return $this; - } - - /** - * Returns timeZone. - * - * The time zone defines in which time zone the customer is located in. The time zone may affects how dates are formatted when interacting with the customer. - * - * @return string - */ - public function getTimeZone() { - return $this->timeZone; - } - - /** - * Sets timeZone. - * - * @param string $timeZone - * @return AbstractTransactionPending - */ - public function setTimeZone($timeZone) { - $this->timeZone = $timeZone; - - return $this; - } - - /** - * Returns token. - * - * - * - * @return int - */ - public function getToken() { - return $this->token; - } - - /** - * Sets token. - * - * @param int $token - * @return AbstractTransactionPending - */ - public function setToken($token) { - $this->token = $token; - - return $this; - } - - /** - * Returns tokenizationMode. - * - * The tokenization mode controls if and how the tokenization of payment information is applied to the transaction. - * - * @return \Wallee\Sdk\Model\TokenizationnMode - */ - public function getTokenizationMode() { - return $this->tokenizationMode; - } - - /** - * Sets tokenizationMode. - * - * @param \Wallee\Sdk\Model\TokenizationnMode $tokenizationMode - * @return AbstractTransactionPending - */ - public function setTokenizationMode($tokenizationMode) { - $this->tokenizationMode = $tokenizationMode; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class AbstractTransactionPending implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Abstract.Transaction.Pending'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'allowed_payment_method_brands' => '\Wallee\Sdk\Model\PaymentMethodBrand[]', + 'allowed_payment_method_configurations' => 'int[]', + 'billing_address' => '\Wallee\Sdk\Model\AddressCreate', + 'currency' => 'string', + 'customer_email_address' => 'string', + 'customer_id' => 'string', + 'failed_url' => 'string', + 'invoice_merchant_reference' => 'string', + 'language' => 'string', + 'line_items' => '\Wallee\Sdk\Model\LineItemCreate[]', + 'merchant_reference' => 'string', + 'meta_data' => 'map[string,string]', + 'shipping_address' => '\Wallee\Sdk\Model\AddressCreate', + 'shipping_method' => 'string', + 'success_url' => 'string', + 'time_zone' => 'string', + 'token' => 'int', + 'tokenization_mode' => '\Wallee\Sdk\Model\TokenizationMode' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'allowed_payment_method_brands' => null, + 'allowed_payment_method_configurations' => 'int64', + 'billing_address' => null, + 'currency' => null, + 'customer_email_address' => null, + 'customer_id' => null, + 'failed_url' => null, + 'invoice_merchant_reference' => null, + 'language' => null, + 'line_items' => null, + 'merchant_reference' => null, + 'meta_data' => null, + 'shipping_address' => null, + 'shipping_method' => null, + 'success_url' => null, + 'time_zone' => null, + 'token' => 'int64', + 'tokenization_mode' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'allowed_payment_method_brands' => 'allowedPaymentMethodBrands', + 'allowed_payment_method_configurations' => 'allowedPaymentMethodConfigurations', + 'billing_address' => 'billingAddress', + 'currency' => 'currency', + 'customer_email_address' => 'customerEmailAddress', + 'customer_id' => 'customerId', + 'failed_url' => 'failedUrl', + 'invoice_merchant_reference' => 'invoiceMerchantReference', + 'language' => 'language', + 'line_items' => 'lineItems', + 'merchant_reference' => 'merchantReference', + 'meta_data' => 'metaData', + 'shipping_address' => 'shippingAddress', + 'shipping_method' => 'shippingMethod', + 'success_url' => 'successUrl', + 'time_zone' => 'timeZone', + 'token' => 'token', + 'tokenization_mode' => 'tokenizationMode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'allowed_payment_method_brands' => 'setAllowedPaymentMethodBrands', + 'allowed_payment_method_configurations' => 'setAllowedPaymentMethodConfigurations', + 'billing_address' => 'setBillingAddress', + 'currency' => 'setCurrency', + 'customer_email_address' => 'setCustomerEmailAddress', + 'customer_id' => 'setCustomerId', + 'failed_url' => 'setFailedUrl', + 'invoice_merchant_reference' => 'setInvoiceMerchantReference', + 'language' => 'setLanguage', + 'line_items' => 'setLineItems', + 'merchant_reference' => 'setMerchantReference', + 'meta_data' => 'setMetaData', + 'shipping_address' => 'setShippingAddress', + 'shipping_method' => 'setShippingMethod', + 'success_url' => 'setSuccessUrl', + 'time_zone' => 'setTimeZone', + 'token' => 'setToken', + 'tokenization_mode' => 'setTokenizationMode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'allowed_payment_method_brands' => 'getAllowedPaymentMethodBrands', + 'allowed_payment_method_configurations' => 'getAllowedPaymentMethodConfigurations', + 'billing_address' => 'getBillingAddress', + 'currency' => 'getCurrency', + 'customer_email_address' => 'getCustomerEmailAddress', + 'customer_id' => 'getCustomerId', + 'failed_url' => 'getFailedUrl', + 'invoice_merchant_reference' => 'getInvoiceMerchantReference', + 'language' => 'getLanguage', + 'line_items' => 'getLineItems', + 'merchant_reference' => 'getMerchantReference', + 'meta_data' => 'getMetaData', + 'shipping_address' => 'getShippingAddress', + 'shipping_method' => 'getShippingMethod', + 'success_url' => 'getSuccessUrl', + 'time_zone' => 'getTimeZone', + 'token' => 'getToken', + 'tokenization_mode' => 'getTokenizationMode' + ]; + + + + /** + * 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['allowed_payment_method_brands'] = isset($data['allowed_payment_method_brands']) ? $data['allowed_payment_method_brands'] : null; + + $this->container['allowed_payment_method_configurations'] = isset($data['allowed_payment_method_configurations']) ? $data['allowed_payment_method_configurations'] : null; + + $this->container['billing_address'] = isset($data['billing_address']) ? $data['billing_address'] : null; + + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + + $this->container['customer_email_address'] = isset($data['customer_email_address']) ? $data['customer_email_address'] : null; + + $this->container['customer_id'] = isset($data['customer_id']) ? $data['customer_id'] : null; + + $this->container['failed_url'] = isset($data['failed_url']) ? $data['failed_url'] : null; + + $this->container['invoice_merchant_reference'] = isset($data['invoice_merchant_reference']) ? $data['invoice_merchant_reference'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['line_items'] = isset($data['line_items']) ? $data['line_items'] : null; + + $this->container['merchant_reference'] = isset($data['merchant_reference']) ? $data['merchant_reference'] : null; + + $this->container['meta_data'] = isset($data['meta_data']) ? $data['meta_data'] : null; + + $this->container['shipping_address'] = isset($data['shipping_address']) ? $data['shipping_address'] : null; + + $this->container['shipping_method'] = isset($data['shipping_method']) ? $data['shipping_method'] : null; + + $this->container['success_url'] = isset($data['success_url']) ? $data['success_url'] : null; + + $this->container['time_zone'] = isset($data['time_zone']) ? $data['time_zone'] : null; + + $this->container['token'] = isset($data['token']) ? $data['token'] : null; + + $this->container['tokenization_mode'] = isset($data['tokenization_mode']) ? $data['tokenization_mode'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 allowed_payment_method_brands + * + * @return \Wallee\Sdk\Model\PaymentMethodBrand[] + */ + public function getAllowedPaymentMethodBrands() + { + return $this->container['allowed_payment_method_brands']; + } + + /** + * Sets allowed_payment_method_brands + * + * @param \Wallee\Sdk\Model\PaymentMethodBrand[] $allowed_payment_method_brands + * + * @return $this + */ + public function setAllowedPaymentMethodBrands($allowed_payment_method_brands) + { + $this->container['allowed_payment_method_brands'] = $allowed_payment_method_brands; + + return $this; + } + + + /** + * Gets allowed_payment_method_configurations + * + * @return int[] + */ + public function getAllowedPaymentMethodConfigurations() + { + return $this->container['allowed_payment_method_configurations']; + } + + /** + * Sets allowed_payment_method_configurations + * + * @param int[] $allowed_payment_method_configurations + * + * @return $this + */ + public function setAllowedPaymentMethodConfigurations($allowed_payment_method_configurations) + { + $this->container['allowed_payment_method_configurations'] = $allowed_payment_method_configurations; + + return $this; + } + + + /** + * Gets billing_address + * + * @return \Wallee\Sdk\Model\AddressCreate + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Wallee\Sdk\Model\AddressCreate $billing_address + * + * @return $this + */ + public function setBillingAddress($billing_address) + { + $this->container['billing_address'] = $billing_address; + + return $this; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + + /** + * Gets customer_email_address + * + * @return string + */ + public function getCustomerEmailAddress() + { + return $this->container['customer_email_address']; + } + + /** + * Sets customer_email_address + * + * @param string $customer_email_address The customer email address is the email address of the customer. If no email address is provided on the shipping or billing address this address is used. + * + * @return $this + */ + public function setCustomerEmailAddress($customer_email_address) + { + $this->container['customer_email_address'] = $customer_email_address; + + return $this; + } + + + /** + * Gets customer_id + * + * @return string + */ + public function getCustomerId() + { + return $this->container['customer_id']; + } + + /** + * Sets customer_id + * + * @param string $customer_id + * + * @return $this + */ + public function setCustomerId($customer_id) + { + $this->container['customer_id'] = $customer_id; + + return $this; + } + + + /** + * Gets failed_url + * + * @return string + */ + public function getFailedUrl() + { + return $this->container['failed_url']; + } + + /** + * Sets failed_url + * + * @param string $failed_url The user will be redirected to failed URL when the transaction could not be authorized or completed. In case no failed URL is specified a default failed page will be displayed. + * + * @return $this + */ + public function setFailedUrl($failed_url) + { + $this->container['failed_url'] = $failed_url; + + return $this; + } + + + /** + * Gets invoice_merchant_reference + * + * @return string + */ + public function getInvoiceMerchantReference() + { + return $this->container['invoice_merchant_reference']; + } + + /** + * Sets invoice_merchant_reference + * + * @param string $invoice_merchant_reference + * + * @return $this + */ + public function setInvoiceMerchantReference($invoice_merchant_reference) + { + $this->container['invoice_merchant_reference'] = $invoice_merchant_reference; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets line_items + * + * @return \Wallee\Sdk\Model\LineItemCreate[] + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Wallee\Sdk\Model\LineItemCreate[] $line_items + * + * @return $this + */ + public function setLineItems($line_items) + { + $this->container['line_items'] = $line_items; + + return $this; + } + + + /** + * Gets merchant_reference + * + * @return string + */ + public function getMerchantReference() + { + return $this->container['merchant_reference']; + } + + /** + * Sets merchant_reference + * + * @param string $merchant_reference + * + * @return $this + */ + public function setMerchantReference($merchant_reference) + { + $this->container['merchant_reference'] = $merchant_reference; + + return $this; + } + + + /** + * Gets meta_data + * + * @return map[string,string] + */ + public function getMetaData() + { + return $this->container['meta_data']; + } + + /** + * Sets meta_data + * + * @param map[string,string] $meta_data Meta data allow to store additional data along the object. + * + * @return $this + */ + public function setMetaData($meta_data) + { + $this->container['meta_data'] = $meta_data; + + return $this; + } + + + /** + * Gets shipping_address + * + * @return \Wallee\Sdk\Model\AddressCreate + */ + public function getShippingAddress() + { + return $this->container['shipping_address']; + } + + /** + * Sets shipping_address + * + * @param \Wallee\Sdk\Model\AddressCreate $shipping_address + * + * @return $this + */ + public function setShippingAddress($shipping_address) + { + $this->container['shipping_address'] = $shipping_address; + + return $this; + } + + + /** + * Gets shipping_method + * + * @return string + */ + public function getShippingMethod() + { + return $this->container['shipping_method']; + } + + /** + * Sets shipping_method + * + * @param string $shipping_method + * + * @return $this + */ + public function setShippingMethod($shipping_method) + { + $this->container['shipping_method'] = $shipping_method; + + return $this; + } + + + /** + * Gets success_url + * + * @return string + */ + public function getSuccessUrl() + { + return $this->container['success_url']; + } + + /** + * Sets success_url + * + * @param string $success_url The user will be redirected to success URL when the transaction could be authorized or completed. In case no success URL is specified a default success page will be displayed. + * + * @return $this + */ + public function setSuccessUrl($success_url) + { + $this->container['success_url'] = $success_url; + + return $this; + } + + + /** + * Gets time_zone + * + * @return string + */ + public function getTimeZone() + { + return $this->container['time_zone']; + } + + /** + * Sets time_zone + * + * @param string $time_zone The time zone defines in which time zone the customer is located in. The time zone may affects how dates are formatted when interacting with the customer. + * + * @return $this + */ + public function setTimeZone($time_zone) + { + $this->container['time_zone'] = $time_zone; + + return $this; + } + + + /** + * Gets token + * + * @return int + */ + public function getToken() + { + return $this->container['token']; + } + + /** + * Sets token + * + * @param int $token + * + * @return $this + */ + public function setToken($token) + { + $this->container['token'] = $token; + + return $this; + } + + + /** + * Gets tokenization_mode + * + * @return \Wallee\Sdk\Model\TokenizationMode + */ + public function getTokenizationMode() + { + return $this->container['tokenization_mode']; + } + + /** + * Sets tokenization_mode + * + * @param \Wallee\Sdk\Model\TokenizationMode $tokenization_mode The tokenization mode controls if and how the tokenization of payment information is applied to the transaction. + * + * @return $this + */ + public function setTokenizationMode($tokenization_mode) + { + $this->container['tokenization_mode'] = $tokenization_mode; + + 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/wallee-sdk/lib/Model/AbstractWebhookListenerUpdate.php b/wallee-sdk/lib/Model/AbstractWebhookListenerUpdate.php index a7ede08..a9d2974 100644 --- a/wallee-sdk/lib/Model/AbstractWebhookListenerUpdate.php +++ b/wallee-sdk/lib/Model/AbstractWebhookListenerUpdate.php @@ -1,10 +1,8 @@ 'string', - 'state' => '\Wallee\Sdk\Model\CreationEntityState' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The webhook listener name is used internally to identify the webhook listener in administrative interfaces.For example it is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - } - - - /** - * Returns name. - * - * The webhook listener name is used internally to identify the webhook listener in administrative interfaces.For example it is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return AbstractWebhookListenerUpdate - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return AbstractWebhookListenerUpdate - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class AbstractWebhookListenerUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Abstract.WebhookListener.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'entity_states' => 'string[]', + 'name' => 'string', + 'notify_every_change' => 'bool', + 'state' => '\Wallee\Sdk\Model\CreationEntityState' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'entity_states' => null, + 'name' => null, + 'notify_every_change' => null, + 'state' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'entity_states' => 'entityStates', + 'name' => 'name', + 'notify_every_change' => 'notifyEveryChange', + 'state' => 'state' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'entity_states' => 'setEntityStates', + 'name' => 'setName', + 'notify_every_change' => 'setNotifyEveryChange', + 'state' => 'setState' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'entity_states' => 'getEntityStates', + 'name' => 'getName', + 'notify_every_change' => 'getNotifyEveryChange', + 'state' => 'getState' + ]; + + + + /** + * 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['entity_states'] = isset($data['entity_states']) ? $data['entity_states'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['notify_every_change'] = isset($data['notify_every_change']) ? $data['notify_every_change'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets entity_states + * + * @return string[] + */ + public function getEntityStates() + { + return $this->container['entity_states']; + } + + /** + * Sets entity_states + * + * @param string[] $entity_states The target state identifies the state into which entities need to move into to trigger the webhook listener. + * + * @return $this + */ + public function setEntityStates($entity_states) + { + $this->container['entity_states'] = $entity_states; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The webhook listener name is used internally to identify the webhook listener in administrative interfaces.For example it is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets notify_every_change + * + * @return bool + */ + public function getNotifyEveryChange() + { + return $this->container['notify_every_change']; + } + + /** + * Sets notify_every_change + * + * @param bool $notify_every_change Defines whether the webhook listener is to be informed about every change made to the entity in contrast to state transitions only. + * + * @return $this + */ + public function setNotifyEveryChange($notify_every_change) + { + $this->container['notify_every_change'] = $notify_every_change; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + 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/wallee-sdk/lib/Model/AbstractWebhookUrlUpdate.php b/wallee-sdk/lib/Model/AbstractWebhookUrlUpdate.php index 818dbc6..6302326 100644 --- a/wallee-sdk/lib/Model/AbstractWebhookUrlUpdate.php +++ b/wallee-sdk/lib/Model/AbstractWebhookUrlUpdate.php @@ -1,10 +1,8 @@ 'string', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'url' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The URL name is used internally to identify the URL in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The URL to which the HTTP requests are sent to. An example URL could look like https://www.example.com/some/path?some-query-parameter=value. - * - * @var string - */ - private $url; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['url'])) { - $this->setUrl($data['url']); - } - } - - - /** - * Returns name. - * - * The URL name is used internally to identify the URL in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return AbstractWebhookUrlUpdate - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return AbstractWebhookUrlUpdate - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns url. - * - * The URL to which the HTTP requests are sent to. An example URL could look like https://www.example.com/some/path?some-query-parameter=value. - * - * @return string - */ - public function getUrl() { - return $this->url; - } - - /** - * Sets url. - * - * @param string $url - * @return AbstractWebhookUrlUpdate - */ - public function setUrl($url) { - $this->url = $url; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class AbstractWebhookUrlUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Abstract.WebhookUrl.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'name' => 'string', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'state' => null, + 'url' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'state' => 'state', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'state' => 'setState', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'state' => 'getState', + 'url' => 'getUrl' + ]; + + + + /** + * 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['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The URL name is used internally to identify the URL in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url The URL to which the HTTP requests are sent to. An example URL could look like https://www.example.com/some/path?some-query-parameter=value. + * + * @return $this + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + 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/wallee-sdk/lib/Model/Account.php b/wallee-sdk/lib/Model/Account.php index f1d72c2..9d580bc 100644 --- a/wallee-sdk/lib/Model/Account.php +++ b/wallee-sdk/lib/Model/Account.php @@ -1,10 +1,8 @@ 'bool', - 'activeOrRestrictedActive' => 'bool', - 'id' => 'int', - 'name' => 'string', - 'parentAccount' => '\Wallee\Sdk\Model\Account', - 'plannedPurgeDate' => '\DateTime', - 'restrictedActive' => 'bool', - 'scope' => 'int', - 'state' => '\Wallee\Sdk\Model\AccountState', - 'subaccountLimit' => 'int', - 'type' => '\Wallee\Sdk\Model\AccountType', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * Active means that this account and all accounts in the hierarchy are active. - * - * @var bool - */ - private $active; - - /** - * This property is true when all accounts in the hierarchy are active or restricted active. - * - * @var bool - */ - private $activeOrRestrictedActive; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The name of the account identifies the account within the administrative interface. - * - * @var string - */ - private $name; - - /** - * The account which is responsible for administering the account. - * - * @var \Wallee\Sdk\Model\Account - */ - private $parentAccount; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * Restricted active means that at least one account in the hierarchy is only restricted active, but all are either restricted active or active. - * - * @var bool - */ - private $restrictedActive; - - /** - * This is the scope to which the account belongs to. - * - * @var int - */ - private $scope; - - /** - * - * - * @var \Wallee\Sdk\Model\AccountState - */ - private $state; - - /** - * This property restricts the number of subaccounts which can be created within this account. - * - * @var int - */ - private $subaccountLimit; - - /** - * The account type defines which role and capabilities it has. - * - * @var \Wallee\Sdk\Model\AccountType - */ - private $type; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['parentAccount'])) { - $this->setParentAccount($data['parentAccount']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['type'])) { - $this->setType($data['type']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns active. - * - * Active means that this account and all accounts in the hierarchy are active. - * - * @return bool - */ - public function getActive() { - return $this->active; - } - - /** - * Sets active. - * - * @param bool $active - * @return Account - */ - protected function setActive($active) { - $this->active = $active; - - return $this; - } - - /** - * Returns activeOrRestrictedActive. - * - * This property is true when all accounts in the hierarchy are active or restricted active. - * - * @return bool - */ - public function getActiveOrRestrictedActive() { - return $this->activeOrRestrictedActive; - } - - /** - * Sets activeOrRestrictedActive. - * - * @param bool $activeOrRestrictedActive - * @return Account - */ - protected function setActiveOrRestrictedActive($activeOrRestrictedActive) { - $this->activeOrRestrictedActive = $activeOrRestrictedActive; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return Account - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * The name of the account identifies the account within the administrative interface. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return Account - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns parentAccount. - * - * The account which is responsible for administering the account. - * - * @return \Wallee\Sdk\Model\Account - */ - public function getParentAccount() { - return $this->parentAccount; - } - - /** - * Sets parentAccount. - * - * @param \Wallee\Sdk\Model\Account $parentAccount - * @return Account - */ - public function setParentAccount($parentAccount) { - $this->parentAccount = $parentAccount; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return Account - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns restrictedActive. - * - * Restricted active means that at least one account in the hierarchy is only restricted active, but all are either restricted active or active. - * - * @return bool - */ - public function getRestrictedActive() { - return $this->restrictedActive; - } - - /** - * Sets restrictedActive. - * - * @param bool $restrictedActive - * @return Account - */ - protected function setRestrictedActive($restrictedActive) { - $this->restrictedActive = $restrictedActive; - - return $this; - } - - /** - * Returns scope. - * - * This is the scope to which the account belongs to. - * - * @return int - */ - public function getScope() { - return $this->scope; - } - - /** - * Sets scope. - * - * @param int $scope - * @return Account - */ - protected function setScope($scope) { - $this->scope = $scope; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\AccountState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\AccountState $state - * @return Account - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns subaccountLimit. - * - * This property restricts the number of subaccounts which can be created within this account. - * - * @return int - */ - public function getSubaccountLimit() { - return $this->subaccountLimit; - } - - /** - * Sets subaccountLimit. - * - * @param int $subaccountLimit - * @return Account - */ - protected function setSubaccountLimit($subaccountLimit) { - $this->subaccountLimit = $subaccountLimit; - - return $this; - } - - /** - * Returns type. - * - * The account type defines which role and capabilities it has. - * - * @return \Wallee\Sdk\Model\AccountType - */ - public function getType() { - return $this->type; - } - - /** - * Sets type. - * - * @param \Wallee\Sdk\Model\AccountType $type - * @return Account - */ - public function setType($type) { - $this->type = $type; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return Account - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class Account implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Account'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'active' => 'bool', + 'active_or_restricted_active' => 'bool', + 'id' => 'int', + 'name' => 'string', + 'parent_account' => '\Wallee\Sdk\Model\Account', + 'planned_purge_date' => '\DateTime', + 'restricted_active' => 'bool', + 'scope' => 'int', + 'state' => '\Wallee\Sdk\Model\AccountState', + 'subaccount_limit' => 'int', + 'type' => '\Wallee\Sdk\Model\AccountType', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'active' => null, + 'active_or_restricted_active' => null, + 'id' => 'int64', + 'name' => null, + 'parent_account' => null, + 'planned_purge_date' => 'date-time', + 'restricted_active' => null, + 'scope' => 'int64', + 'state' => null, + 'subaccount_limit' => 'int64', + 'type' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'active' => 'active', + 'active_or_restricted_active' => 'activeOrRestrictedActive', + 'id' => 'id', + 'name' => 'name', + 'parent_account' => 'parentAccount', + 'planned_purge_date' => 'plannedPurgeDate', + 'restricted_active' => 'restrictedActive', + 'scope' => 'scope', + 'state' => 'state', + 'subaccount_limit' => 'subaccountLimit', + 'type' => 'type', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'active' => 'setActive', + 'active_or_restricted_active' => 'setActiveOrRestrictedActive', + 'id' => 'setId', + 'name' => 'setName', + 'parent_account' => 'setParentAccount', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'restricted_active' => 'setRestrictedActive', + 'scope' => 'setScope', + 'state' => 'setState', + 'subaccount_limit' => 'setSubaccountLimit', + 'type' => 'setType', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'active' => 'getActive', + 'active_or_restricted_active' => 'getActiveOrRestrictedActive', + 'id' => 'getId', + 'name' => 'getName', + 'parent_account' => 'getParentAccount', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'restricted_active' => 'getRestrictedActive', + 'scope' => 'getScope', + 'state' => 'getState', + 'subaccount_limit' => 'getSubaccountLimit', + 'type' => 'getType', + 'version' => 'getVersion' + ]; + + + + /** + * 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['active'] = isset($data['active']) ? $data['active'] : null; + + $this->container['active_or_restricted_active'] = isset($data['active_or_restricted_active']) ? $data['active_or_restricted_active'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['parent_account'] = isset($data['parent_account']) ? $data['parent_account'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['restricted_active'] = isset($data['restricted_active']) ? $data['restricted_active'] : null; + + $this->container['scope'] = isset($data['scope']) ? $data['scope'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['subaccount_limit'] = isset($data['subaccount_limit']) ? $data['subaccount_limit'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 active + * + * @return bool + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool $active Active means that this account and all accounts in the hierarchy are active. + * + * @return $this + */ + public function setActive($active) + { + $this->container['active'] = $active; + + return $this; + } + + + /** + * Gets active_or_restricted_active + * + * @return bool + */ + public function getActiveOrRestrictedActive() + { + return $this->container['active_or_restricted_active']; + } + + /** + * Sets active_or_restricted_active + * + * @param bool $active_or_restricted_active This property is true when all accounts in the hierarchy are active or restricted active. + * + * @return $this + */ + public function setActiveOrRestrictedActive($active_or_restricted_active) + { + $this->container['active_or_restricted_active'] = $active_or_restricted_active; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the account identifies the account within the administrative interface. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets parent_account + * + * @return \Wallee\Sdk\Model\Account + */ + public function getParentAccount() + { + return $this->container['parent_account']; + } + + /** + * Sets parent_account + * + * @param \Wallee\Sdk\Model\Account $parent_account The account which is responsible for administering the account. + * + * @return $this + */ + public function setParentAccount($parent_account) + { + $this->container['parent_account'] = $parent_account; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets restricted_active + * + * @return bool + */ + public function getRestrictedActive() + { + return $this->container['restricted_active']; + } + + /** + * Sets restricted_active + * + * @param bool $restricted_active Restricted active means that at least one account in the hierarchy is only restricted active, but all are either restricted active or active. + * + * @return $this + */ + public function setRestrictedActive($restricted_active) + { + $this->container['restricted_active'] = $restricted_active; + + return $this; + } + + + /** + * Gets scope + * + * @return int + */ + public function getScope() + { + return $this->container['scope']; + } + + /** + * Sets scope + * + * @param int $scope This is the scope to which the account belongs to. + * + * @return $this + */ + public function setScope($scope) + { + $this->container['scope'] = $scope; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\AccountState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\AccountState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets subaccount_limit + * + * @return int + */ + public function getSubaccountLimit() + { + return $this->container['subaccount_limit']; + } + + /** + * Sets subaccount_limit + * + * @param int $subaccount_limit This property restricts the number of subaccounts which can be created within this account. + * + * @return $this + */ + public function setSubaccountLimit($subaccount_limit) + { + $this->container['subaccount_limit'] = $subaccount_limit; + + return $this; + } + + + /** + * Gets type + * + * @return \Wallee\Sdk\Model\AccountType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Wallee\Sdk\Model\AccountType $type The account type defines which role and capabilities it has. + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/AccountCreate.php b/wallee-sdk/lib/Model/AccountCreate.php index f8a7830..938ea8f 100644 --- a/wallee-sdk/lib/Model/AccountCreate.php +++ b/wallee-sdk/lib/Model/AccountCreate.php @@ -1,10 +1,8 @@ 'int', - 'scope' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * The account which is responsible for administering the account. - * - * @var int - */ - private $parentAccount; - - /** - * This is the scope to which the account belongs to. - * - * @var int - */ - private $scope; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['parentAccount'])) { - $this->setParentAccount($data['parentAccount']); - } - if (isset($data['scope'])) { - $this->setScope($data['scope']); - } - } - - - /** - * Returns parentAccount. - * - * The account which is responsible for administering the account. - * - * @return int - */ - public function getParentAccount() { - return $this->parentAccount; - } - - /** - * Sets parentAccount. - * - * @param int $parentAccount - * @return AccountCreate - */ - public function setParentAccount($parentAccount) { - $this->parentAccount = $parentAccount; - - return $this; - } - - /** - * Returns scope. - * - * This is the scope to which the account belongs to. - * - * @return int - */ - public function getScope() { - return $this->scope; - } - - /** - * Sets scope. - * - * @param int $scope - * @return AccountCreate - */ - public function setScope($scope) { - $this->scope = $scope; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - if ($this->getScope() === null) { - throw new ValidationException("'scope' can't be null", 'scope', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class AccountCreate extends AbstractAccountUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Account.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'parent_account' => 'int', + 'scope' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'parent_account' => 'int64', + 'scope' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'parent_account' => 'parentAccount', + 'scope' => 'scope' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'parent_account' => 'setParentAccount', + 'scope' => 'setScope' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'parent_account' => 'getParentAccount', + 'scope' => 'getScope' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['parent_account'] = isset($data['parent_account']) ? $data['parent_account'] : null; + + $this->container['scope'] = isset($data['scope']) ? $data['scope'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['scope'] === null) { + $invalidProperties[] = "'scope' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 parent_account + * + * @return int + */ + public function getParentAccount() + { + return $this->container['parent_account']; + } + + /** + * Sets parent_account + * + * @param int $parent_account The account which is responsible for administering the account. + * + * @return $this + */ + public function setParentAccount($parent_account) + { + $this->container['parent_account'] = $parent_account; + + return $this; + } + + + /** + * Gets scope + * + * @return int + */ + public function getScope() + { + return $this->container['scope']; + } + + /** + * Sets scope + * + * @param int $scope This is the scope to which the account belongs to. + * + * @return $this + */ + public function setScope($scope) + { + $this->container['scope'] = $scope; + + 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/wallee-sdk/lib/Model/AccountState.php b/wallee-sdk/lib/Model/AccountState.php index e3277a6..79034a6 100644 --- a/wallee-sdk/lib/Model/AccountState.php +++ b/wallee-sdk/lib/Model/AccountState.php @@ -1,10 +1,8 @@ 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return AccountUpdate - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return AccountUpdate - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - if ($this->getId() === null) { - throw new ValidationException("'id' can't be null", 'id', $this); - } - if ($this->getVersion() === null) { - throw new ValidationException("'version' can't be null", 'version', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class AccountUpdate extends AbstractAccountUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Account.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/Address.php b/wallee-sdk/lib/Model/Address.php index b996bd9..8825cef 100644 --- a/wallee-sdk/lib/Model/Address.php +++ b/wallee-sdk/lib/Model/Address.php @@ -1,10 +1,8 @@ 'string', - 'commercialRegisterNumber' => 'string', - 'country' => 'string', - 'dateOfBirth' => '\DateTime', - 'dependentLocality' => 'string', - 'emailAddress' => 'string', - 'familyName' => 'string', - 'gender' => '\Wallee\Sdk\Model\Gender', - 'givenName' => 'string', - 'legalOrganizationForm' => '\Wallee\Sdk\Model\LegalOrganizationForm', - 'mobilePhoneNumber' => 'string', - 'organizationName' => 'string', - 'phoneNumber' => 'string', - 'postCode' => 'string', - 'postalState' => 'string', - 'salesTaxNumber' => 'string', - 'salutation' => 'string', - 'socialSecurityNumber' => 'string', - 'sortingCode' => 'string', - 'street' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var string - */ - private $city; - - /** - * - * - * @var string - */ - private $commercialRegisterNumber; - - /** - * - * - * @var string - */ - private $country; - - /** - * - * - * @var \DateTime - */ - private $dateOfBirth; - - /** - * - * - * @var string - */ - private $dependentLocality; - - /** - * - * - * @var string - */ - private $emailAddress; - - /** - * - * - * @var string - */ - private $familyName; - - /** - * - * - * @var \Wallee\Sdk\Model\Gender - */ - private $gender; - - /** - * - * - * @var string - */ - private $givenName; - - /** - * - * - * @var \Wallee\Sdk\Model\LegalOrganizationForm - */ - private $legalOrganizationForm; - - /** - * - * - * @var string - */ - private $mobilePhoneNumber; - - /** - * - * - * @var string - */ - private $organizationName; - - /** - * - * - * @var string - */ - private $phoneNumber; - - /** - * - * - * @var string - */ - private $postCode; - - /** - * - * - * @var string - */ - private $postalState; - - /** - * - * - * @var string - */ - private $salesTaxNumber; - - /** - * - * - * @var string - */ - private $salutation; - - /** - * - * - * @var string - */ - private $socialSecurityNumber; - - /** - * The sorting code identifies the post office at which the post box is located in. - * - * @var string - */ - private $sortingCode; - - /** - * - * - * @var string - */ - private $street; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['gender'])) { - $this->setGender($data['gender']); - } - if (isset($data['legalOrganizationForm'])) { - $this->setLegalOrganizationForm($data['legalOrganizationForm']); - } - } - - - /** - * Returns city. - * - * - * - * @return string - */ - public function getCity() { - return $this->city; - } - - /** - * Sets city. - * - * @param string $city - * @return Address - */ - protected function setCity($city) { - $this->city = $city; - - return $this; - } - - /** - * Returns commercialRegisterNumber. - * - * - * - * @return string - */ - public function getCommercialRegisterNumber() { - return $this->commercialRegisterNumber; - } - - /** - * Sets commercialRegisterNumber. - * - * @param string $commercialRegisterNumber - * @return Address - */ - protected function setCommercialRegisterNumber($commercialRegisterNumber) { - $this->commercialRegisterNumber = $commercialRegisterNumber; - - return $this; - } - - /** - * Returns country. - * - * - * - * @return string - */ - public function getCountry() { - return $this->country; - } - - /** - * Sets country. - * - * @param string $country - * @return Address - */ - protected function setCountry($country) { - $this->country = $country; - - return $this; - } - - /** - * Returns dateOfBirth. - * - * - * - * @return \DateTime - */ - public function getDateOfBirth() { - return $this->dateOfBirth; - } - - /** - * Sets dateOfBirth. - * - * @param \DateTime $dateOfBirth - * @return Address - */ - protected function setDateOfBirth($dateOfBirth) { - $this->dateOfBirth = $dateOfBirth; - - return $this; - } - - /** - * Returns dependentLocality. - * - * - * - * @return string - */ - public function getDependentLocality() { - return $this->dependentLocality; - } - - /** - * Sets dependentLocality. - * - * @param string $dependentLocality - * @return Address - */ - protected function setDependentLocality($dependentLocality) { - $this->dependentLocality = $dependentLocality; - - return $this; - } - - /** - * Returns emailAddress. - * - * - * - * @return string - */ - public function getEmailAddress() { - return $this->emailAddress; - } - - /** - * Sets emailAddress. - * - * @param string $emailAddress - * @return Address - */ - protected function setEmailAddress($emailAddress) { - $this->emailAddress = $emailAddress; - - return $this; - } - - /** - * Returns familyName. - * - * - * - * @return string - */ - public function getFamilyName() { - return $this->familyName; - } - - /** - * Sets familyName. - * - * @param string $familyName - * @return Address - */ - protected function setFamilyName($familyName) { - $this->familyName = $familyName; - - return $this; - } - - /** - * Returns gender. - * - * - * - * @return \Wallee\Sdk\Model\Gender - */ - public function getGender() { - return $this->gender; - } - - /** - * Sets gender. - * - * @param \Wallee\Sdk\Model\Gender $gender - * @return Address - */ - public function setGender($gender) { - $this->gender = $gender; - - return $this; - } - - /** - * Returns givenName. - * - * - * - * @return string - */ - public function getGivenName() { - return $this->givenName; - } - - /** - * Sets givenName. - * - * @param string $givenName - * @return Address - */ - protected function setGivenName($givenName) { - $this->givenName = $givenName; - - return $this; - } - - /** - * Returns legalOrganizationForm. - * - * - * - * @return \Wallee\Sdk\Model\LegalOrganizationForm - */ - public function getLegalOrganizationForm() { - return $this->legalOrganizationForm; - } - - /** - * Sets legalOrganizationForm. - * - * @param \Wallee\Sdk\Model\LegalOrganizationForm $legalOrganizationForm - * @return Address - */ - public function setLegalOrganizationForm($legalOrganizationForm) { - $this->legalOrganizationForm = $legalOrganizationForm; - - return $this; - } - - /** - * Returns mobilePhoneNumber. - * - * - * - * @return string - */ - public function getMobilePhoneNumber() { - return $this->mobilePhoneNumber; - } - - /** - * Sets mobilePhoneNumber. - * - * @param string $mobilePhoneNumber - * @return Address - */ - protected function setMobilePhoneNumber($mobilePhoneNumber) { - $this->mobilePhoneNumber = $mobilePhoneNumber; - - return $this; - } - - /** - * Returns organizationName. - * - * - * - * @return string - */ - public function getOrganizationName() { - return $this->organizationName; - } - - /** - * Sets organizationName. - * - * @param string $organizationName - * @return Address - */ - protected function setOrganizationName($organizationName) { - $this->organizationName = $organizationName; - - return $this; - } - - /** - * Returns phoneNumber. - * - * - * - * @return string - */ - public function getPhoneNumber() { - return $this->phoneNumber; - } - - /** - * Sets phoneNumber. - * - * @param string $phoneNumber - * @return Address - */ - protected function setPhoneNumber($phoneNumber) { - $this->phoneNumber = $phoneNumber; - - return $this; - } - - /** - * Returns postCode. - * - * - * - * @return string - */ - public function getPostCode() { - return $this->postCode; - } - - /** - * Sets postCode. - * - * @param string $postCode - * @return Address - */ - protected function setPostCode($postCode) { - $this->postCode = $postCode; - - return $this; - } - - /** - * Returns postalState. - * - * - * - * @return string - */ - public function getPostalState() { - return $this->postalState; - } - - /** - * Sets postalState. - * - * @param string $postalState - * @return Address - */ - protected function setPostalState($postalState) { - $this->postalState = $postalState; - - return $this; - } - - /** - * Returns salesTaxNumber. - * - * - * - * @return string - */ - public function getSalesTaxNumber() { - return $this->salesTaxNumber; - } - - /** - * Sets salesTaxNumber. - * - * @param string $salesTaxNumber - * @return Address - */ - protected function setSalesTaxNumber($salesTaxNumber) { - $this->salesTaxNumber = $salesTaxNumber; - - return $this; - } - - /** - * Returns salutation. - * - * - * - * @return string - */ - public function getSalutation() { - return $this->salutation; - } - - /** - * Sets salutation. - * - * @param string $salutation - * @return Address - */ - protected function setSalutation($salutation) { - $this->salutation = $salutation; - - return $this; - } - - /** - * Returns socialSecurityNumber. - * - * - * - * @return string - */ - public function getSocialSecurityNumber() { - return $this->socialSecurityNumber; - } - - /** - * Sets socialSecurityNumber. - * - * @param string $socialSecurityNumber - * @return Address - */ - protected function setSocialSecurityNumber($socialSecurityNumber) { - $this->socialSecurityNumber = $socialSecurityNumber; - - return $this; - } - - /** - * Returns sortingCode. - * - * The sorting code identifies the post office at which the post box is located in. - * - * @return string - */ - public function getSortingCode() { - return $this->sortingCode; - } - - /** - * Sets sortingCode. - * - * @param string $sortingCode - * @return Address - */ - protected function setSortingCode($sortingCode) { - $this->sortingCode = $sortingCode; - - return $this; - } - - /** - * Returns street. - * - * - * - * @return string - */ - public function getStreet() { - return $this->street; - } - - /** - * Sets street. - * - * @param string $street - * @return Address - */ - protected function setStreet($street) { - $this->street = $street; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class Address implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Address'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'city' => 'string', + 'commercial_register_number' => 'string', + 'country' => 'string', + 'date_of_birth' => '\DateTime', + 'dependent_locality' => 'string', + 'email_address' => 'string', + 'family_name' => 'string', + 'gender' => '\Wallee\Sdk\Model\Gender', + 'given_name' => 'string', + 'legal_organization_form' => '\Wallee\Sdk\Model\LegalOrganizationForm', + 'mobile_phone_number' => 'string', + 'organization_name' => 'string', + 'phone_number' => 'string', + 'post_code' => 'string', + 'postal_state' => 'string', + 'sales_tax_number' => 'string', + 'salutation' => 'string', + 'social_security_number' => 'string', + 'sorting_code' => 'string', + 'street' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'city' => null, + 'commercial_register_number' => null, + 'country' => null, + 'date_of_birth' => 'date', + 'dependent_locality' => null, + 'email_address' => null, + 'family_name' => null, + 'gender' => null, + 'given_name' => null, + 'legal_organization_form' => null, + 'mobile_phone_number' => null, + 'organization_name' => null, + 'phone_number' => null, + 'post_code' => null, + 'postal_state' => null, + 'sales_tax_number' => null, + 'salutation' => null, + 'social_security_number' => null, + 'sorting_code' => null, + 'street' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'commercial_register_number' => 'commercialRegisterNumber', + 'country' => 'country', + 'date_of_birth' => 'dateOfBirth', + 'dependent_locality' => 'dependentLocality', + 'email_address' => 'emailAddress', + 'family_name' => 'familyName', + 'gender' => 'gender', + 'given_name' => 'givenName', + 'legal_organization_form' => 'legalOrganizationForm', + 'mobile_phone_number' => 'mobilePhoneNumber', + 'organization_name' => 'organizationName', + 'phone_number' => 'phoneNumber', + 'post_code' => 'postCode', + 'postal_state' => 'postalState', + 'sales_tax_number' => 'salesTaxNumber', + 'salutation' => 'salutation', + 'social_security_number' => 'socialSecurityNumber', + 'sorting_code' => 'sortingCode', + 'street' => 'street' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'commercial_register_number' => 'setCommercialRegisterNumber', + 'country' => 'setCountry', + 'date_of_birth' => 'setDateOfBirth', + 'dependent_locality' => 'setDependentLocality', + 'email_address' => 'setEmailAddress', + 'family_name' => 'setFamilyName', + 'gender' => 'setGender', + 'given_name' => 'setGivenName', + 'legal_organization_form' => 'setLegalOrganizationForm', + 'mobile_phone_number' => 'setMobilePhoneNumber', + 'organization_name' => 'setOrganizationName', + 'phone_number' => 'setPhoneNumber', + 'post_code' => 'setPostCode', + 'postal_state' => 'setPostalState', + 'sales_tax_number' => 'setSalesTaxNumber', + 'salutation' => 'setSalutation', + 'social_security_number' => 'setSocialSecurityNumber', + 'sorting_code' => 'setSortingCode', + 'street' => 'setStreet' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'commercial_register_number' => 'getCommercialRegisterNumber', + 'country' => 'getCountry', + 'date_of_birth' => 'getDateOfBirth', + 'dependent_locality' => 'getDependentLocality', + 'email_address' => 'getEmailAddress', + 'family_name' => 'getFamilyName', + 'gender' => 'getGender', + 'given_name' => 'getGivenName', + 'legal_organization_form' => 'getLegalOrganizationForm', + 'mobile_phone_number' => 'getMobilePhoneNumber', + 'organization_name' => 'getOrganizationName', + 'phone_number' => 'getPhoneNumber', + 'post_code' => 'getPostCode', + 'postal_state' => 'getPostalState', + 'sales_tax_number' => 'getSalesTaxNumber', + 'salutation' => 'getSalutation', + 'social_security_number' => 'getSocialSecurityNumber', + 'sorting_code' => 'getSortingCode', + 'street' => 'getStreet' + ]; + + + + /** + * 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['city'] = isset($data['city']) ? $data['city'] : null; + + $this->container['commercial_register_number'] = isset($data['commercial_register_number']) ? $data['commercial_register_number'] : null; + + $this->container['country'] = isset($data['country']) ? $data['country'] : null; + + $this->container['date_of_birth'] = isset($data['date_of_birth']) ? $data['date_of_birth'] : null; + + $this->container['dependent_locality'] = isset($data['dependent_locality']) ? $data['dependent_locality'] : null; + + $this->container['email_address'] = isset($data['email_address']) ? $data['email_address'] : null; + + $this->container['family_name'] = isset($data['family_name']) ? $data['family_name'] : null; + + $this->container['gender'] = isset($data['gender']) ? $data['gender'] : null; + + $this->container['given_name'] = isset($data['given_name']) ? $data['given_name'] : null; + + $this->container['legal_organization_form'] = isset($data['legal_organization_form']) ? $data['legal_organization_form'] : null; + + $this->container['mobile_phone_number'] = isset($data['mobile_phone_number']) ? $data['mobile_phone_number'] : null; + + $this->container['organization_name'] = isset($data['organization_name']) ? $data['organization_name'] : null; + + $this->container['phone_number'] = isset($data['phone_number']) ? $data['phone_number'] : null; + + $this->container['post_code'] = isset($data['post_code']) ? $data['post_code'] : null; + + $this->container['postal_state'] = isset($data['postal_state']) ? $data['postal_state'] : null; + + $this->container['sales_tax_number'] = isset($data['sales_tax_number']) ? $data['sales_tax_number'] : null; + + $this->container['salutation'] = isset($data['salutation']) ? $data['salutation'] : null; + + $this->container['social_security_number'] = isset($data['social_security_number']) ? $data['social_security_number'] : null; + + $this->container['sorting_code'] = isset($data['sorting_code']) ? $data['sorting_code'] : null; + + $this->container['street'] = isset($data['street']) ? $data['street'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 city + * + * @return string + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string $city + * + * @return $this + */ + public function setCity($city) + { + $this->container['city'] = $city; + + return $this; + } + + + /** + * Gets commercial_register_number + * + * @return string + */ + public function getCommercialRegisterNumber() + { + return $this->container['commercial_register_number']; + } + + /** + * Sets commercial_register_number + * + * @param string $commercial_register_number + * + * @return $this + */ + public function setCommercialRegisterNumber($commercial_register_number) + { + $this->container['commercial_register_number'] = $commercial_register_number; + + return $this; + } + + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country + * + * @return $this + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + + + /** + * Gets date_of_birth + * + * @return \DateTime + */ + public function getDateOfBirth() + { + return $this->container['date_of_birth']; + } + + /** + * Sets date_of_birth + * + * @param \DateTime $date_of_birth + * + * @return $this + */ + public function setDateOfBirth($date_of_birth) + { + $this->container['date_of_birth'] = $date_of_birth; + + return $this; + } + + + /** + * Gets dependent_locality + * + * @return string + */ + public function getDependentLocality() + { + return $this->container['dependent_locality']; + } + + /** + * Sets dependent_locality + * + * @param string $dependent_locality + * + * @return $this + */ + public function setDependentLocality($dependent_locality) + { + $this->container['dependent_locality'] = $dependent_locality; + + return $this; + } + + + /** + * Gets email_address + * + * @return string + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string $email_address + * + * @return $this + */ + public function setEmailAddress($email_address) + { + $this->container['email_address'] = $email_address; + + return $this; + } + + + /** + * Gets family_name + * + * @return string + */ + public function getFamilyName() + { + return $this->container['family_name']; + } + + /** + * Sets family_name + * + * @param string $family_name + * + * @return $this + */ + public function setFamilyName($family_name) + { + $this->container['family_name'] = $family_name; + + return $this; + } + + + /** + * Gets gender + * + * @return \Wallee\Sdk\Model\Gender + */ + public function getGender() + { + return $this->container['gender']; + } + + /** + * Sets gender + * + * @param \Wallee\Sdk\Model\Gender $gender + * + * @return $this + */ + public function setGender($gender) + { + $this->container['gender'] = $gender; + + return $this; + } + + + /** + * Gets given_name + * + * @return string + */ + public function getGivenName() + { + return $this->container['given_name']; + } + + /** + * Sets given_name + * + * @param string $given_name + * + * @return $this + */ + public function setGivenName($given_name) + { + $this->container['given_name'] = $given_name; + + return $this; + } + + + /** + * Gets legal_organization_form + * + * @return \Wallee\Sdk\Model\LegalOrganizationForm + */ + public function getLegalOrganizationForm() + { + return $this->container['legal_organization_form']; + } + + /** + * Sets legal_organization_form + * + * @param \Wallee\Sdk\Model\LegalOrganizationForm $legal_organization_form + * + * @return $this + */ + public function setLegalOrganizationForm($legal_organization_form) + { + $this->container['legal_organization_form'] = $legal_organization_form; + + return $this; + } + + + /** + * Gets mobile_phone_number + * + * @return string + */ + public function getMobilePhoneNumber() + { + return $this->container['mobile_phone_number']; + } + + /** + * Sets mobile_phone_number + * + * @param string $mobile_phone_number + * + * @return $this + */ + public function setMobilePhoneNumber($mobile_phone_number) + { + $this->container['mobile_phone_number'] = $mobile_phone_number; + + return $this; + } + + + /** + * Gets organization_name + * + * @return string + */ + public function getOrganizationName() + { + return $this->container['organization_name']; + } + + /** + * Sets organization_name + * + * @param string $organization_name + * + * @return $this + */ + public function setOrganizationName($organization_name) + { + $this->container['organization_name'] = $organization_name; + + return $this; + } + + + /** + * Gets phone_number + * + * @return string + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string $phone_number + * + * @return $this + */ + public function setPhoneNumber($phone_number) + { + $this->container['phone_number'] = $phone_number; + + return $this; + } + + + /** + * Gets post_code + * + * @return string + */ + public function getPostCode() + { + return $this->container['post_code']; + } + + /** + * Sets post_code + * + * @param string $post_code + * + * @return $this + */ + public function setPostCode($post_code) + { + $this->container['post_code'] = $post_code; + + return $this; + } + + + /** + * Gets postal_state + * + * @return string + */ + public function getPostalState() + { + return $this->container['postal_state']; + } + + /** + * Sets postal_state + * + * @param string $postal_state + * + * @return $this + */ + public function setPostalState($postal_state) + { + $this->container['postal_state'] = $postal_state; + + return $this; + } + + + /** + * Gets sales_tax_number + * + * @return string + */ + public function getSalesTaxNumber() + { + return $this->container['sales_tax_number']; + } + + /** + * Sets sales_tax_number + * + * @param string $sales_tax_number + * + * @return $this + */ + public function setSalesTaxNumber($sales_tax_number) + { + $this->container['sales_tax_number'] = $sales_tax_number; + + return $this; + } + + + /** + * Gets salutation + * + * @return string + */ + public function getSalutation() + { + return $this->container['salutation']; + } + + /** + * Sets salutation + * + * @param string $salutation + * + * @return $this + */ + public function setSalutation($salutation) + { + $this->container['salutation'] = $salutation; + + return $this; + } + + + /** + * Gets social_security_number + * + * @return string + */ + public function getSocialSecurityNumber() + { + return $this->container['social_security_number']; + } + + /** + * Sets social_security_number + * + * @param string $social_security_number + * + * @return $this + */ + public function setSocialSecurityNumber($social_security_number) + { + $this->container['social_security_number'] = $social_security_number; + + return $this; + } + + + /** + * Gets sorting_code + * + * @return string + */ + public function getSortingCode() + { + return $this->container['sorting_code']; + } + + /** + * Sets sorting_code + * + * @param string $sorting_code The sorting code identifies the post office at which the post box is located in. + * + * @return $this + */ + public function setSortingCode($sorting_code) + { + $this->container['sorting_code'] = $sorting_code; + + return $this; + } + + + /** + * Gets street + * + * @return string + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string $street + * + * @return $this + */ + public function setStreet($street) + { + $this->container['street'] = $street; + + 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/wallee-sdk/lib/Model/AddressCreate.php b/wallee-sdk/lib/Model/AddressCreate.php index eae11b2..48a97a6 100644 --- a/wallee-sdk/lib/Model/AddressCreate.php +++ b/wallee-sdk/lib/Model/AddressCreate.php @@ -1,10 +1,8 @@ 'string', - 'commercialRegisterNumber' => 'string', - 'country' => 'string', - 'dateOfBirth' => '\DateTime', - 'dependentLocality' => 'string', - 'emailAddress' => 'string', - 'familyName' => 'string', - 'gender' => '\Wallee\Sdk\Model\Gender', - 'givenName' => 'string', - 'legalOrganizationForm' => 'int', - 'mobilePhoneNumber' => 'string', - 'organizationName' => 'string', - 'phoneNumber' => 'string', - 'postCode' => 'string', - 'postalState' => 'string', - 'salesTaxNumber' => 'string', - 'salutation' => 'string', - 'socialSecurityNumber' => 'string', - 'sortingCode' => 'string', - 'street' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var string - */ - private $city; - - /** - * - * - * @var string - */ - private $commercialRegisterNumber; - - /** - * - * - * @var string - */ - private $country; - - /** - * - * - * @var \DateTime - */ - private $dateOfBirth; - - /** - * - * - * @var string - */ - private $dependentLocality; - - /** - * - * - * @var string - */ - private $emailAddress; - - /** - * - * - * @var string - */ - private $familyName; - - /** - * - * - * @var \Wallee\Sdk\Model\Gender - */ - private $gender; - - /** - * - * - * @var string - */ - private $givenName; - - /** - * - * - * @var int - */ - private $legalOrganizationForm; - - /** - * - * - * @var string - */ - private $mobilePhoneNumber; - - /** - * - * - * @var string - */ - private $organizationName; - - /** - * - * - * @var string - */ - private $phoneNumber; - - /** - * - * - * @var string - */ - private $postCode; - - /** - * - * - * @var string - */ - private $postalState; - - /** - * - * - * @var string - */ - private $salesTaxNumber; - - /** - * - * - * @var string - */ - private $salutation; - - /** - * - * - * @var string - */ - private $socialSecurityNumber; - - /** - * The sorting code identifies the post office at which the post box is located in. - * - * @var string - */ - private $sortingCode; - - /** - * - * - * @var string - */ - private $street; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['city'])) { - $this->setCity($data['city']); - } - if (isset($data['commercialRegisterNumber'])) { - $this->setCommercialRegisterNumber($data['commercialRegisterNumber']); - } - if (isset($data['country'])) { - $this->setCountry($data['country']); - } - if (isset($data['dateOfBirth'])) { - $this->setDateOfBirth($data['dateOfBirth']); - } - if (isset($data['dependentLocality'])) { - $this->setDependentLocality($data['dependentLocality']); - } - if (isset($data['emailAddress'])) { - $this->setEmailAddress($data['emailAddress']); - } - if (isset($data['familyName'])) { - $this->setFamilyName($data['familyName']); - } - if (isset($data['gender'])) { - $this->setGender($data['gender']); - } - if (isset($data['givenName'])) { - $this->setGivenName($data['givenName']); - } - if (isset($data['legalOrganizationForm'])) { - $this->setLegalOrganizationForm($data['legalOrganizationForm']); - } - if (isset($data['mobilePhoneNumber'])) { - $this->setMobilePhoneNumber($data['mobilePhoneNumber']); - } - if (isset($data['organizationName'])) { - $this->setOrganizationName($data['organizationName']); - } - if (isset($data['phoneNumber'])) { - $this->setPhoneNumber($data['phoneNumber']); - } - if (isset($data['postCode'])) { - $this->setPostCode($data['postCode']); - } - if (isset($data['postalState'])) { - $this->setPostalState($data['postalState']); - } - if (isset($data['salesTaxNumber'])) { - $this->setSalesTaxNumber($data['salesTaxNumber']); - } - if (isset($data['salutation'])) { - $this->setSalutation($data['salutation']); - } - if (isset($data['socialSecurityNumber'])) { - $this->setSocialSecurityNumber($data['socialSecurityNumber']); - } - if (isset($data['sortingCode'])) { - $this->setSortingCode($data['sortingCode']); - } - if (isset($data['street'])) { - $this->setStreet($data['street']); - } - } - - - /** - * Returns city. - * - * - * - * @return string - */ - public function getCity() { - return $this->city; - } - - /** - * Sets city. - * - * @param string $city - * @return AddressCreate - */ - public function setCity($city) { - $this->city = $city; - - return $this; - } - - /** - * Returns commercialRegisterNumber. - * - * - * - * @return string - */ - public function getCommercialRegisterNumber() { - return $this->commercialRegisterNumber; - } - - /** - * Sets commercialRegisterNumber. - * - * @param string $commercialRegisterNumber - * @return AddressCreate - */ - public function setCommercialRegisterNumber($commercialRegisterNumber) { - $this->commercialRegisterNumber = $commercialRegisterNumber; - - return $this; - } - - /** - * Returns country. - * - * - * - * @return string - */ - public function getCountry() { - return $this->country; - } - - /** - * Sets country. - * - * @param string $country - * @return AddressCreate - */ - public function setCountry($country) { - $this->country = $country; - - return $this; - } - - /** - * Returns dateOfBirth. - * - * - * - * @return \DateTime - */ - public function getDateOfBirth() { - return $this->dateOfBirth; - } - - /** - * Sets dateOfBirth. - * - * @param \DateTime $dateOfBirth - * @return AddressCreate - */ - public function setDateOfBirth($dateOfBirth) { - $this->dateOfBirth = $dateOfBirth; - - return $this; - } - - /** - * Returns dependentLocality. - * - * - * - * @return string - */ - public function getDependentLocality() { - return $this->dependentLocality; - } - - /** - * Sets dependentLocality. - * - * @param string $dependentLocality - * @return AddressCreate - */ - public function setDependentLocality($dependentLocality) { - $this->dependentLocality = $dependentLocality; - - return $this; - } - - /** - * Returns emailAddress. - * - * - * - * @return string - */ - public function getEmailAddress() { - return $this->emailAddress; - } - - /** - * Sets emailAddress. - * - * @param string $emailAddress - * @return AddressCreate - */ - public function setEmailAddress($emailAddress) { - $this->emailAddress = $emailAddress; - - return $this; - } - - /** - * Returns familyName. - * - * - * - * @return string - */ - public function getFamilyName() { - return $this->familyName; - } - - /** - * Sets familyName. - * - * @param string $familyName - * @return AddressCreate - */ - public function setFamilyName($familyName) { - $this->familyName = $familyName; - - return $this; - } - - /** - * Returns gender. - * - * - * - * @return \Wallee\Sdk\Model\Gender - */ - public function getGender() { - return $this->gender; - } - - /** - * Sets gender. - * - * @param \Wallee\Sdk\Model\Gender $gender - * @return AddressCreate - */ - public function setGender($gender) { - $this->gender = $gender; - - return $this; - } - - /** - * Returns givenName. - * - * - * - * @return string - */ - public function getGivenName() { - return $this->givenName; - } - - /** - * Sets givenName. - * - * @param string $givenName - * @return AddressCreate - */ - public function setGivenName($givenName) { - $this->givenName = $givenName; - - return $this; - } - - /** - * Returns legalOrganizationForm. - * - * - * - * @return int - */ - public function getLegalOrganizationForm() { - return $this->legalOrganizationForm; - } - - /** - * Sets legalOrganizationForm. - * - * @param int $legalOrganizationForm - * @return AddressCreate - */ - public function setLegalOrganizationForm($legalOrganizationForm) { - $this->legalOrganizationForm = $legalOrganizationForm; - - return $this; - } - - /** - * Returns mobilePhoneNumber. - * - * - * - * @return string - */ - public function getMobilePhoneNumber() { - return $this->mobilePhoneNumber; - } - - /** - * Sets mobilePhoneNumber. - * - * @param string $mobilePhoneNumber - * @return AddressCreate - */ - public function setMobilePhoneNumber($mobilePhoneNumber) { - $this->mobilePhoneNumber = $mobilePhoneNumber; - - return $this; - } - - /** - * Returns organizationName. - * - * - * - * @return string - */ - public function getOrganizationName() { - return $this->organizationName; - } - - /** - * Sets organizationName. - * - * @param string $organizationName - * @return AddressCreate - */ - public function setOrganizationName($organizationName) { - $this->organizationName = $organizationName; - - return $this; - } - - /** - * Returns phoneNumber. - * - * - * - * @return string - */ - public function getPhoneNumber() { - return $this->phoneNumber; - } - - /** - * Sets phoneNumber. - * - * @param string $phoneNumber - * @return AddressCreate - */ - public function setPhoneNumber($phoneNumber) { - $this->phoneNumber = $phoneNumber; - - return $this; - } - - /** - * Returns postCode. - * - * - * - * @return string - */ - public function getPostCode() { - return $this->postCode; - } - - /** - * Sets postCode. - * - * @param string $postCode - * @return AddressCreate - */ - public function setPostCode($postCode) { - $this->postCode = $postCode; - - return $this; - } - - /** - * Returns postalState. - * - * - * - * @return string - */ - public function getPostalState() { - return $this->postalState; - } - - /** - * Sets postalState. - * - * @param string $postalState - * @return AddressCreate - */ - public function setPostalState($postalState) { - $this->postalState = $postalState; - - return $this; - } - - /** - * Returns salesTaxNumber. - * - * - * - * @return string - */ - public function getSalesTaxNumber() { - return $this->salesTaxNumber; - } - - /** - * Sets salesTaxNumber. - * - * @param string $salesTaxNumber - * @return AddressCreate - */ - public function setSalesTaxNumber($salesTaxNumber) { - $this->salesTaxNumber = $salesTaxNumber; - - return $this; - } - - /** - * Returns salutation. - * - * - * - * @return string - */ - public function getSalutation() { - return $this->salutation; - } - - /** - * Sets salutation. - * - * @param string $salutation - * @return AddressCreate - */ - public function setSalutation($salutation) { - $this->salutation = $salutation; - - return $this; - } - - /** - * Returns socialSecurityNumber. - * - * - * - * @return string - */ - public function getSocialSecurityNumber() { - return $this->socialSecurityNumber; - } - - /** - * Sets socialSecurityNumber. - * - * @param string $socialSecurityNumber - * @return AddressCreate - */ - public function setSocialSecurityNumber($socialSecurityNumber) { - $this->socialSecurityNumber = $socialSecurityNumber; - - return $this; - } - - /** - * Returns sortingCode. - * - * The sorting code identifies the post office at which the post box is located in. - * - * @return string - */ - public function getSortingCode() { - return $this->sortingCode; - } - - /** - * Sets sortingCode. - * - * @param string $sortingCode - * @return AddressCreate - */ - public function setSortingCode($sortingCode) { - $this->sortingCode = $sortingCode; - - return $this; - } - - /** - * Returns street. - * - * - * - * @return string - */ - public function getStreet() { - return $this->street; - } - - /** - * Sets street. - * - * @param string $street - * @return AddressCreate - */ - public function setStreet($street) { - $this->street = $street; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class AddressCreate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Address.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'city' => 'string', + 'commercial_register_number' => 'string', + 'country' => 'string', + 'date_of_birth' => '\DateTime', + 'dependent_locality' => 'string', + 'email_address' => 'string', + 'family_name' => 'string', + 'gender' => '\Wallee\Sdk\Model\Gender', + 'given_name' => 'string', + 'legal_organization_form' => 'int', + 'mobile_phone_number' => 'string', + 'organization_name' => 'string', + 'phone_number' => 'string', + 'post_code' => 'string', + 'postal_state' => 'string', + 'sales_tax_number' => 'string', + 'salutation' => 'string', + 'social_security_number' => 'string', + 'sorting_code' => 'string', + 'street' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'city' => null, + 'commercial_register_number' => null, + 'country' => null, + 'date_of_birth' => 'date', + 'dependent_locality' => null, + 'email_address' => null, + 'family_name' => null, + 'gender' => null, + 'given_name' => null, + 'legal_organization_form' => 'int64', + 'mobile_phone_number' => null, + 'organization_name' => null, + 'phone_number' => null, + 'post_code' => null, + 'postal_state' => null, + 'sales_tax_number' => null, + 'salutation' => null, + 'social_security_number' => null, + 'sorting_code' => null, + 'street' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'commercial_register_number' => 'commercialRegisterNumber', + 'country' => 'country', + 'date_of_birth' => 'dateOfBirth', + 'dependent_locality' => 'dependentLocality', + 'email_address' => 'emailAddress', + 'family_name' => 'familyName', + 'gender' => 'gender', + 'given_name' => 'givenName', + 'legal_organization_form' => 'legalOrganizationForm', + 'mobile_phone_number' => 'mobilePhoneNumber', + 'organization_name' => 'organizationName', + 'phone_number' => 'phoneNumber', + 'post_code' => 'postCode', + 'postal_state' => 'postalState', + 'sales_tax_number' => 'salesTaxNumber', + 'salutation' => 'salutation', + 'social_security_number' => 'socialSecurityNumber', + 'sorting_code' => 'sortingCode', + 'street' => 'street' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'commercial_register_number' => 'setCommercialRegisterNumber', + 'country' => 'setCountry', + 'date_of_birth' => 'setDateOfBirth', + 'dependent_locality' => 'setDependentLocality', + 'email_address' => 'setEmailAddress', + 'family_name' => 'setFamilyName', + 'gender' => 'setGender', + 'given_name' => 'setGivenName', + 'legal_organization_form' => 'setLegalOrganizationForm', + 'mobile_phone_number' => 'setMobilePhoneNumber', + 'organization_name' => 'setOrganizationName', + 'phone_number' => 'setPhoneNumber', + 'post_code' => 'setPostCode', + 'postal_state' => 'setPostalState', + 'sales_tax_number' => 'setSalesTaxNumber', + 'salutation' => 'setSalutation', + 'social_security_number' => 'setSocialSecurityNumber', + 'sorting_code' => 'setSortingCode', + 'street' => 'setStreet' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'commercial_register_number' => 'getCommercialRegisterNumber', + 'country' => 'getCountry', + 'date_of_birth' => 'getDateOfBirth', + 'dependent_locality' => 'getDependentLocality', + 'email_address' => 'getEmailAddress', + 'family_name' => 'getFamilyName', + 'gender' => 'getGender', + 'given_name' => 'getGivenName', + 'legal_organization_form' => 'getLegalOrganizationForm', + 'mobile_phone_number' => 'getMobilePhoneNumber', + 'organization_name' => 'getOrganizationName', + 'phone_number' => 'getPhoneNumber', + 'post_code' => 'getPostCode', + 'postal_state' => 'getPostalState', + 'sales_tax_number' => 'getSalesTaxNumber', + 'salutation' => 'getSalutation', + 'social_security_number' => 'getSocialSecurityNumber', + 'sorting_code' => 'getSortingCode', + 'street' => 'getStreet' + ]; + + + + /** + * 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['city'] = isset($data['city']) ? $data['city'] : null; + + $this->container['commercial_register_number'] = isset($data['commercial_register_number']) ? $data['commercial_register_number'] : null; + + $this->container['country'] = isset($data['country']) ? $data['country'] : null; + + $this->container['date_of_birth'] = isset($data['date_of_birth']) ? $data['date_of_birth'] : null; + + $this->container['dependent_locality'] = isset($data['dependent_locality']) ? $data['dependent_locality'] : null; + + $this->container['email_address'] = isset($data['email_address']) ? $data['email_address'] : null; + + $this->container['family_name'] = isset($data['family_name']) ? $data['family_name'] : null; + + $this->container['gender'] = isset($data['gender']) ? $data['gender'] : null; + + $this->container['given_name'] = isset($data['given_name']) ? $data['given_name'] : null; + + $this->container['legal_organization_form'] = isset($data['legal_organization_form']) ? $data['legal_organization_form'] : null; + + $this->container['mobile_phone_number'] = isset($data['mobile_phone_number']) ? $data['mobile_phone_number'] : null; + + $this->container['organization_name'] = isset($data['organization_name']) ? $data['organization_name'] : null; + + $this->container['phone_number'] = isset($data['phone_number']) ? $data['phone_number'] : null; + + $this->container['post_code'] = isset($data['post_code']) ? $data['post_code'] : null; + + $this->container['postal_state'] = isset($data['postal_state']) ? $data['postal_state'] : null; + + $this->container['sales_tax_number'] = isset($data['sales_tax_number']) ? $data['sales_tax_number'] : null; + + $this->container['salutation'] = isset($data['salutation']) ? $data['salutation'] : null; + + $this->container['social_security_number'] = isset($data['social_security_number']) ? $data['social_security_number'] : null; + + $this->container['sorting_code'] = isset($data['sorting_code']) ? $data['sorting_code'] : null; + + $this->container['street'] = isset($data['street']) ? $data['street'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 city + * + * @return string + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string $city + * + * @return $this + */ + public function setCity($city) + { + $this->container['city'] = $city; + + return $this; + } + + + /** + * Gets commercial_register_number + * + * @return string + */ + public function getCommercialRegisterNumber() + { + return $this->container['commercial_register_number']; + } + + /** + * Sets commercial_register_number + * + * @param string $commercial_register_number + * + * @return $this + */ + public function setCommercialRegisterNumber($commercial_register_number) + { + $this->container['commercial_register_number'] = $commercial_register_number; + + return $this; + } + + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country + * + * @return $this + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + + + /** + * Gets date_of_birth + * + * @return \DateTime + */ + public function getDateOfBirth() + { + return $this->container['date_of_birth']; + } + + /** + * Sets date_of_birth + * + * @param \DateTime $date_of_birth + * + * @return $this + */ + public function setDateOfBirth($date_of_birth) + { + $this->container['date_of_birth'] = $date_of_birth; + + return $this; + } + + + /** + * Gets dependent_locality + * + * @return string + */ + public function getDependentLocality() + { + return $this->container['dependent_locality']; + } + + /** + * Sets dependent_locality + * + * @param string $dependent_locality + * + * @return $this + */ + public function setDependentLocality($dependent_locality) + { + $this->container['dependent_locality'] = $dependent_locality; + + return $this; + } + + + /** + * Gets email_address + * + * @return string + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string $email_address + * + * @return $this + */ + public function setEmailAddress($email_address) + { + $this->container['email_address'] = $email_address; + + return $this; + } + + + /** + * Gets family_name + * + * @return string + */ + public function getFamilyName() + { + return $this->container['family_name']; + } + + /** + * Sets family_name + * + * @param string $family_name + * + * @return $this + */ + public function setFamilyName($family_name) + { + $this->container['family_name'] = $family_name; + + return $this; + } + + + /** + * Gets gender + * + * @return \Wallee\Sdk\Model\Gender + */ + public function getGender() + { + return $this->container['gender']; + } + + /** + * Sets gender + * + * @param \Wallee\Sdk\Model\Gender $gender + * + * @return $this + */ + public function setGender($gender) + { + $this->container['gender'] = $gender; + + return $this; + } + + + /** + * Gets given_name + * + * @return string + */ + public function getGivenName() + { + return $this->container['given_name']; + } + + /** + * Sets given_name + * + * @param string $given_name + * + * @return $this + */ + public function setGivenName($given_name) + { + $this->container['given_name'] = $given_name; + + return $this; + } + + + /** + * Gets legal_organization_form + * + * @return int + */ + public function getLegalOrganizationForm() + { + return $this->container['legal_organization_form']; + } + + /** + * Sets legal_organization_form + * + * @param int $legal_organization_form + * + * @return $this + */ + public function setLegalOrganizationForm($legal_organization_form) + { + $this->container['legal_organization_form'] = $legal_organization_form; + + return $this; + } + + + /** + * Gets mobile_phone_number + * + * @return string + */ + public function getMobilePhoneNumber() + { + return $this->container['mobile_phone_number']; + } + + /** + * Sets mobile_phone_number + * + * @param string $mobile_phone_number + * + * @return $this + */ + public function setMobilePhoneNumber($mobile_phone_number) + { + $this->container['mobile_phone_number'] = $mobile_phone_number; + + return $this; + } + + + /** + * Gets organization_name + * + * @return string + */ + public function getOrganizationName() + { + return $this->container['organization_name']; + } + + /** + * Sets organization_name + * + * @param string $organization_name + * + * @return $this + */ + public function setOrganizationName($organization_name) + { + $this->container['organization_name'] = $organization_name; + + return $this; + } + + + /** + * Gets phone_number + * + * @return string + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string $phone_number + * + * @return $this + */ + public function setPhoneNumber($phone_number) + { + $this->container['phone_number'] = $phone_number; + + return $this; + } + + + /** + * Gets post_code + * + * @return string + */ + public function getPostCode() + { + return $this->container['post_code']; + } + + /** + * Sets post_code + * + * @param string $post_code + * + * @return $this + */ + public function setPostCode($post_code) + { + $this->container['post_code'] = $post_code; + + return $this; + } + + + /** + * Gets postal_state + * + * @return string + */ + public function getPostalState() + { + return $this->container['postal_state']; + } + + /** + * Sets postal_state + * + * @param string $postal_state + * + * @return $this + */ + public function setPostalState($postal_state) + { + $this->container['postal_state'] = $postal_state; + + return $this; + } + + + /** + * Gets sales_tax_number + * + * @return string + */ + public function getSalesTaxNumber() + { + return $this->container['sales_tax_number']; + } + + /** + * Sets sales_tax_number + * + * @param string $sales_tax_number + * + * @return $this + */ + public function setSalesTaxNumber($sales_tax_number) + { + $this->container['sales_tax_number'] = $sales_tax_number; + + return $this; + } + + + /** + * Gets salutation + * + * @return string + */ + public function getSalutation() + { + return $this->container['salutation']; + } + + /** + * Sets salutation + * + * @param string $salutation + * + * @return $this + */ + public function setSalutation($salutation) + { + $this->container['salutation'] = $salutation; + + return $this; + } + + + /** + * Gets social_security_number + * + * @return string + */ + public function getSocialSecurityNumber() + { + return $this->container['social_security_number']; + } + + /** + * Sets social_security_number + * + * @param string $social_security_number + * + * @return $this + */ + public function setSocialSecurityNumber($social_security_number) + { + $this->container['social_security_number'] = $social_security_number; + + return $this; + } + + + /** + * Gets sorting_code + * + * @return string + */ + public function getSortingCode() + { + return $this->container['sorting_code']; + } + + /** + * Sets sorting_code + * + * @param string $sorting_code The sorting code identifies the post office at which the post box is located in. + * + * @return $this + */ + public function setSortingCode($sorting_code) + { + $this->container['sorting_code'] = $sorting_code; + + return $this; + } + + + /** + * Gets street + * + * @return string + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string $street + * + * @return $this + */ + public function setStreet($street) + { + $this->container['street'] = $street; + + 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/wallee-sdk/lib/Model/ApplicationUser.php b/wallee-sdk/lib/Model/ApplicationUser.php index c7ec990..0d5f1f6 100644 --- a/wallee-sdk/lib/Model/ApplicationUser.php +++ b/wallee-sdk/lib/Model/ApplicationUser.php @@ -1,10 +1,8 @@ 'string', - 'primaryAccount' => '\Wallee\Sdk\Model\Account', - 'requestLimit' => 'int', - ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * The user name is used to identify the application user in administrative interfaces. - * - * @var string - */ - private $name; - - /** - * The account that this user is associated with. The account owner will be able to manage this user. - * - * @var \Wallee\Sdk\Model\Account - */ - private $primaryAccount; - - /** - * The request limit defines the maximum number of API request accepted within 2 minutes. This limit can only be changed with special privileges. - * - * @var int - */ - private $requestLimit; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['primaryAccount'])) { - $this->setPrimaryAccount($data['primaryAccount']); - } - if (isset($data['scope'])) { - $this->setScope($data['scope']); - } - } - - - /** - * Returns name. - * - * The user name is used to identify the application user in administrative interfaces. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return ApplicationUser - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns primaryAccount. - * - * The account that this user is associated with. The account owner will be able to manage this user. - * - * @return \Wallee\Sdk\Model\Account - */ - public function getPrimaryAccount() { - return $this->primaryAccount; - } - - /** - * Sets primaryAccount. - * - * @param \Wallee\Sdk\Model\Account $primaryAccount - * @return ApplicationUser - */ - public function setPrimaryAccount($primaryAccount) { - $this->primaryAccount = $primaryAccount; - - return $this; - } - - /** - * Returns requestLimit. - * - * The request limit defines the maximum number of API request accepted within 2 minutes. This limit can only be changed with special privileges. - * - * @return int - */ - public function getRequestLimit() { - return $this->requestLimit; - } - - /** - * Sets requestLimit. - * - * @param int $requestLimit - * @return ApplicationUser - */ - protected function setRequestLimit($requestLimit) { - $this->requestLimit = $requestLimit; - - return $this; - } - - /** - * Returns scope. - * - * The scope to which the user belongs to. - * - * @return \Wallee\Sdk\Model\Scope - */ - public function getScope() { - return parent::getScope(); - } - - /** - * Sets scope. - * - * @param \Wallee\Sdk\Model\Scope $scope - * @return ApplicationUser - */ - public function setScope($scope) { - return parent::setScope($scope); - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class ApplicationUser extends User +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ApplicationUser'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'name' => 'string', + 'primary_account' => '\Wallee\Sdk\Model\Account', + 'request_limit' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'primary_account' => null, + 'request_limit' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'primary_account' => 'primaryAccount', + 'request_limit' => 'requestLimit' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'primary_account' => 'setPrimaryAccount', + 'request_limit' => 'setRequestLimit' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'primary_account' => 'getPrimaryAccount', + 'request_limit' => 'getRequestLimit' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['primary_account'] = isset($data['primary_account']) ? $data['primary_account'] : null; + + $this->container['request_limit'] = isset($data['request_limit']) ? $data['request_limit'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The user name is used to identify the application user in administrative interfaces. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets primary_account + * + * @return \Wallee\Sdk\Model\Account + */ + public function getPrimaryAccount() + { + return $this->container['primary_account']; + } + + /** + * Sets primary_account + * + * @param \Wallee\Sdk\Model\Account $primary_account The account that this user is associated with. The account owner will be able to manage this user. + * + * @return $this + */ + public function setPrimaryAccount($primary_account) + { + $this->container['primary_account'] = $primary_account; + + return $this; + } + + + /** + * Gets request_limit + * + * @return int + */ + public function getRequestLimit() + { + return $this->container['request_limit']; + } + + /** + * Sets request_limit + * + * @param int $request_limit The request limit defines the maximum number of API request accepted within 2 minutes. This limit can only be changed with special privileges. + * + * @return $this + */ + public function setRequestLimit($request_limit) + { + $this->container['request_limit'] = $request_limit; + + 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/wallee-sdk/lib/Model/ApplicationUserCreate.php b/wallee-sdk/lib/Model/ApplicationUserCreate.php index bf233e8..765ae5c 100644 --- a/wallee-sdk/lib/Model/ApplicationUserCreate.php +++ b/wallee-sdk/lib/Model/ApplicationUserCreate.php @@ -1,10 +1,8 @@ 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * The account that this user is associated with. The account owner will be able to manage this user. - * - * @var int - */ - private $primaryAccount; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['primaryAccount'])) { - $this->setPrimaryAccount($data['primaryAccount']); - } - } - - - /** - * Returns primaryAccount. - * - * The account that this user is associated with. The account owner will be able to manage this user. - * - * @return int - */ - public function getPrimaryAccount() { - return $this->primaryAccount; - } - - /** - * Sets primaryAccount. - * - * @param int $primaryAccount - * @return ApplicationUserCreate - */ - public function setPrimaryAccount($primaryAccount) { - $this->primaryAccount = $primaryAccount; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - if ($this->getPrimaryAccount() === null) { - throw new ValidationException("'primaryAccount' can't be null", 'primaryAccount', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class ApplicationUserCreate extends AbstractApplicationUserUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ApplicationUser.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'primary_account' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'primary_account' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'primary_account' => 'primaryAccount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'primary_account' => 'setPrimaryAccount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'primary_account' => 'getPrimaryAccount' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['primary_account'] = isset($data['primary_account']) ? $data['primary_account'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['primary_account'] === null) { + $invalidProperties[] = "'primary_account' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 primary_account + * + * @return int + */ + public function getPrimaryAccount() + { + return $this->container['primary_account']; + } + + /** + * Sets primary_account + * + * @param int $primary_account The account that this user is associated with. The account owner will be able to manage this user. + * + * @return $this + */ + public function setPrimaryAccount($primary_account) + { + $this->container['primary_account'] = $primary_account; + + 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/wallee-sdk/lib/Model/ApplicationUserCreateWithMacKey.php b/wallee-sdk/lib/Model/ApplicationUserCreateWithMacKey.php index 97ca9ec..efaec6d 100644 --- a/wallee-sdk/lib/Model/ApplicationUserCreateWithMacKey.php +++ b/wallee-sdk/lib/Model/ApplicationUserCreateWithMacKey.php @@ -1,10 +1,8 @@ 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * - * - * @var string - */ - private $macKey; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - } - - - /** - * Returns macKey. - * - * - * - * @return string - */ - public function getMacKey() { - return $this->macKey; - } - - /** - * Sets macKey. - * - * @param string $macKey - * @return ApplicationUserCreateWithMacKey - */ - protected function setMacKey($macKey) { - $this->macKey = $macKey; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class ApplicationUserCreateWithMacKey extends ApplicationUser +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ApplicationUser.CreateWithMacKey'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'mac_key' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'mac_key' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'mac_key' => 'macKey' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'mac_key' => 'setMacKey' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'mac_key' => 'getMacKey' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['mac_key'] = isset($data['mac_key']) ? $data['mac_key'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 mac_key + * + * @return string + */ + public function getMacKey() + { + return $this->container['mac_key']; + } + + /** + * Sets mac_key + * + * @param string $mac_key + * + * @return $this + */ + public function setMacKey($mac_key) + { + $this->container['mac_key'] = $mac_key; + + 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/wallee-sdk/lib/Model/ApplicationUserUpdate.php b/wallee-sdk/lib/Model/ApplicationUserUpdate.php index 1c78d1c..4dc9202 100644 --- a/wallee-sdk/lib/Model/ApplicationUserUpdate.php +++ b/wallee-sdk/lib/Model/ApplicationUserUpdate.php @@ -1,10 +1,8 @@ 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return ApplicationUserUpdate - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return ApplicationUserUpdate - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - if ($this->getId() === null) { - throw new ValidationException("'id' can't be null", 'id', $this); - } - if ($this->getVersion() === null) { - throw new ValidationException("'version' can't be null", 'version', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class ApplicationUserUpdate extends AbstractApplicationUserUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ApplicationUser.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/AttachmentResource.php b/wallee-sdk/lib/Model/AttachmentResource.php deleted file mode 100644 index 2cc47e2..0000000 --- a/wallee-sdk/lib/Model/AttachmentResource.php +++ /dev/null @@ -1,178 +0,0 @@ - 'map[string,string]', - 'resourcePath' => '\Wallee\Sdk\Model\ModelResourcePath' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The name of the attachment which is shown to the user within the email client. - * - * @var map[string,string] - */ - private $attachmentName; - - /** - * The path to the resource which should be attached to the email. - * - * @var \Wallee\Sdk\Model\ModelResourcePath - */ - private $resourcePath; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['attachmentName']) && $data['attachmentName'] != null) { - $this->setAttachmentName($data['attachmentName']); - } - if (isset($data['resourcePath']) && $data['resourcePath'] != null) { - $this->setResourcePath($data['resourcePath']); - } - } - - - /** - * Returns attachmentName. - * - * The name of the attachment which is shown to the user within the email client. - * - * @return map[string,string] - */ - public function getAttachmentName() { - return $this->attachmentName; - } - - /** - * Sets attachmentName. - * - * @param map[string,string] $attachmentName - * @return AttachmentResource - */ - public function setAttachmentName($attachmentName) { - $this->attachmentName = $attachmentName; - - return $this; - } - - /** - * Returns resourcePath. - * - * The path to the resource which should be attached to the email. - * - * @return \Wallee\Sdk\Model\ModelResourcePath - */ - public function getResourcePath() { - return $this->resourcePath; - } - - /** - * Sets resourcePath. - * - * @param \Wallee\Sdk\Model\ModelResourcePath $resourcePath - * @return AttachmentResource - */ - public function setResourcePath($resourcePath) { - $this->resourcePath = $resourcePath; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - -} - diff --git a/wallee-sdk/lib/Model/Charge.php b/wallee-sdk/lib/Model/Charge.php index 42b66de..5f141ab 100644 --- a/wallee-sdk/lib/Model/Charge.php +++ b/wallee-sdk/lib/Model/Charge.php @@ -1,10 +1,8 @@ '\DateTime', - 'failureReason' => '\Wallee\Sdk\Model\FailureReason', - 'language' => 'string', - 'plannedPurgeDate' => '\DateTime', - 'spaceViewId' => 'int', - 'state' => '\Wallee\Sdk\Model\ChargeState', - 'timeoutOn' => '\DateTime', - 'transaction' => '\Wallee\Sdk\Model\Transaction', - 'type' => '\Wallee\Sdk\Model\ChargeType', - 'userFailureMessage' => 'string', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * The date on which the charge was created on. - * - * @var \DateTime - */ - private $createdOn; - - /** - * - * - * @var \Wallee\Sdk\Model\FailureReason - */ - private $failureReason; - - /** - * - * - * @var string - */ - private $language; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var int - */ - private $spaceViewId; - - /** - * - * - * @var \Wallee\Sdk\Model\ChargeState - */ - private $state; - - /** - * - * - * @var \DateTime - */ - private $timeoutOn; - - /** - * - * - * @var \Wallee\Sdk\Model\Transaction - */ - private $transaction; - - /** - * - * - * @var \Wallee\Sdk\Model\ChargeType - */ - private $type; - - /** - * The failure message describes for an end user why the charge is failed in the language of the user. This is only provided when the charge is marked as failed. - * - * @var string - */ - private $userFailureMessage; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['failureReason'])) { - $this->setFailureReason($data['failureReason']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['transaction'])) { - $this->setTransaction($data['transaction']); - } - if (isset($data['type'])) { - $this->setType($data['type']); - } - } - - - /** - * Returns createdOn. - * - * The date on which the charge was created on. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return Charge - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns failureReason. - * - * - * - * @return \Wallee\Sdk\Model\FailureReason - */ - public function getFailureReason() { - return $this->failureReason; - } - - /** - * Sets failureReason. - * - * @param \Wallee\Sdk\Model\FailureReason $failureReason - * @return Charge - */ - public function setFailureReason($failureReason) { - $this->failureReason = $failureReason; - - return $this; - } - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return Charge - */ - protected function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return Charge - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns spaceViewId. - * - * - * - * @return int - */ - public function getSpaceViewId() { - return $this->spaceViewId; - } - - /** - * Sets spaceViewId. - * - * @param int $spaceViewId - * @return Charge - */ - protected function setSpaceViewId($spaceViewId) { - $this->spaceViewId = $spaceViewId; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\ChargeState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\ChargeState $state - * @return Charge - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns timeoutOn. - * - * - * - * @return \DateTime - */ - public function getTimeoutOn() { - return $this->timeoutOn; - } - - /** - * Sets timeoutOn. - * - * @param \DateTime $timeoutOn - * @return Charge - */ - protected function setTimeoutOn($timeoutOn) { - $this->timeoutOn = $timeoutOn; - - return $this; - } - - /** - * Returns transaction. - * - * - * - * @return \Wallee\Sdk\Model\Transaction - */ - public function getTransaction() { - return $this->transaction; - } - - /** - * Sets transaction. - * - * @param \Wallee\Sdk\Model\Transaction $transaction - * @return Charge - */ - public function setTransaction($transaction) { - $this->transaction = $transaction; - - return $this; - } - - /** - * Returns type. - * - * - * - * @return \Wallee\Sdk\Model\ChargeType - */ - public function getType() { - return $this->type; - } - - /** - * Sets type. - * - * @param \Wallee\Sdk\Model\ChargeType $type - * @return Charge - */ - public function setType($type) { - $this->type = $type; - - return $this; - } - - /** - * Returns userFailureMessage. - * - * The failure message describes for an end user why the charge is failed in the language of the user. This is only provided when the charge is marked as failed. - * - * @return string - */ - public function getUserFailureMessage() { - return $this->userFailureMessage; - } - - /** - * Sets userFailureMessage. - * - * @param string $userFailureMessage - * @return Charge - */ - protected function setUserFailureMessage($userFailureMessage) { - $this->userFailureMessage = $userFailureMessage; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return Charge - */ - protected function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class Charge extends TransactionAwareEntity +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Charge'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'created_on' => '\DateTime', + 'failure_reason' => '\Wallee\Sdk\Model\FailureReason', + 'language' => 'string', + 'planned_purge_date' => '\DateTime', + 'space_view_id' => 'int', + 'state' => '\Wallee\Sdk\Model\ChargeState', + 'time_zone' => 'string', + 'timeout_on' => '\DateTime', + 'transaction' => '\Wallee\Sdk\Model\Transaction', + 'type' => '\Wallee\Sdk\Model\ChargeType', + 'user_failure_message' => 'string', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'created_on' => 'date-time', + 'failure_reason' => null, + 'language' => null, + 'planned_purge_date' => 'date-time', + 'space_view_id' => 'int64', + 'state' => null, + 'time_zone' => null, + 'timeout_on' => 'date-time', + 'transaction' => null, + 'type' => null, + 'user_failure_message' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'created_on' => 'createdOn', + 'failure_reason' => 'failureReason', + 'language' => 'language', + 'planned_purge_date' => 'plannedPurgeDate', + 'space_view_id' => 'spaceViewId', + 'state' => 'state', + 'time_zone' => 'timeZone', + 'timeout_on' => 'timeoutOn', + 'transaction' => 'transaction', + 'type' => 'type', + 'user_failure_message' => 'userFailureMessage', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'created_on' => 'setCreatedOn', + 'failure_reason' => 'setFailureReason', + 'language' => 'setLanguage', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'space_view_id' => 'setSpaceViewId', + 'state' => 'setState', + 'time_zone' => 'setTimeZone', + 'timeout_on' => 'setTimeoutOn', + 'transaction' => 'setTransaction', + 'type' => 'setType', + 'user_failure_message' => 'setUserFailureMessage', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'created_on' => 'getCreatedOn', + 'failure_reason' => 'getFailureReason', + 'language' => 'getLanguage', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'space_view_id' => 'getSpaceViewId', + 'state' => 'getState', + 'time_zone' => 'getTimeZone', + 'timeout_on' => 'getTimeoutOn', + 'transaction' => 'getTransaction', + 'type' => 'getType', + 'user_failure_message' => 'getUserFailureMessage', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['failure_reason'] = isset($data['failure_reason']) ? $data['failure_reason'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['space_view_id'] = isset($data['space_view_id']) ? $data['space_view_id'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['time_zone'] = isset($data['time_zone']) ? $data['time_zone'] : null; + + $this->container['timeout_on'] = isset($data['timeout_on']) ? $data['timeout_on'] : null; + + $this->container['transaction'] = isset($data['transaction']) ? $data['transaction'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + $this->container['user_failure_message'] = isset($data['user_failure_message']) ? $data['user_failure_message'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The date on which the charge was created on. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets failure_reason + * + * @return \Wallee\Sdk\Model\FailureReason + */ + public function getFailureReason() + { + return $this->container['failure_reason']; + } + + /** + * Sets failure_reason + * + * @param \Wallee\Sdk\Model\FailureReason $failure_reason + * + * @return $this + */ + public function setFailureReason($failure_reason) + { + $this->container['failure_reason'] = $failure_reason; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets space_view_id + * + * @return int + */ + public function getSpaceViewId() + { + return $this->container['space_view_id']; + } + + /** + * Sets space_view_id + * + * @param int $space_view_id + * + * @return $this + */ + public function setSpaceViewId($space_view_id) + { + $this->container['space_view_id'] = $space_view_id; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\ChargeState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\ChargeState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets time_zone + * + * @return string + */ + public function getTimeZone() + { + return $this->container['time_zone']; + } + + /** + * Sets time_zone + * + * @param string $time_zone + * + * @return $this + */ + public function setTimeZone($time_zone) + { + $this->container['time_zone'] = $time_zone; + + return $this; + } + + + /** + * Gets timeout_on + * + * @return \DateTime + */ + public function getTimeoutOn() + { + return $this->container['timeout_on']; + } + + /** + * Sets timeout_on + * + * @param \DateTime $timeout_on + * + * @return $this + */ + public function setTimeoutOn($timeout_on) + { + $this->container['timeout_on'] = $timeout_on; + + return $this; + } + + + /** + * Gets transaction + * + * @return \Wallee\Sdk\Model\Transaction + */ + public function getTransaction() + { + return $this->container['transaction']; + } + + /** + * Sets transaction + * + * @param \Wallee\Sdk\Model\Transaction $transaction + * + * @return $this + */ + public function setTransaction($transaction) + { + $this->container['transaction'] = $transaction; + + return $this; + } + + + /** + * Gets type + * + * @return \Wallee\Sdk\Model\ChargeType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Wallee\Sdk\Model\ChargeType $type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + + /** + * Gets user_failure_message + * + * @return string + */ + public function getUserFailureMessage() + { + return $this->container['user_failure_message']; + } + + /** + * Sets user_failure_message + * + * @param string $user_failure_message The failure message describes for an end user why the charge is failed in the language of the user. This is only provided when the charge is marked as failed. + * + * @return $this + */ + public function setUserFailureMessage($user_failure_message) + { + $this->container['user_failure_message'] = $user_failure_message; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/ChargeAttempt.php b/wallee-sdk/lib/Model/ChargeAttempt.php index 155bb9c..361af2d 100644 --- a/wallee-sdk/lib/Model/ChargeAttempt.php +++ b/wallee-sdk/lib/Model/ChargeAttempt.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\Charge', - 'connectorConfiguration' => '\Wallee\Sdk\Model\PaymentConnectorConfiguration', - 'createdOn' => '\DateTime', - 'environment' => '\Wallee\Sdk\Model\ChargeAttemptEnvironment', - 'failedOn' => '\DateTime', - 'failureReason' => '\Wallee\Sdk\Model\FailureReason', - 'initializingTokenVersion' => 'bool', - 'invocation' => '\Wallee\Sdk\Model\ConnectorInvocation', - 'labels' => '\Wallee\Sdk\Model\Label[]', - 'language' => 'string', - 'nextUpdateOn' => '\DateTime', - 'plannedPurgeDate' => '\DateTime', - 'redirectionUrl' => 'string', - 'spaceViewId' => 'int', - 'state' => '\Wallee\Sdk\Model\ChargeAttemptState', - 'succeededOn' => '\DateTime', - 'timeoutOn' => '\DateTime', - 'tokenVersion' => '\Wallee\Sdk\Model\TokenVersion', - 'userFailureMessage' => 'string', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\Charge - */ - private $charge; - - /** - * - * - * @var \Wallee\Sdk\Model\PaymentConnectorConfiguration - */ - private $connectorConfiguration; - - /** - * The created on date indicates the date on which the entity was stored into the database. - * - * @var \DateTime - */ - private $createdOn; - - /** - * - * - * @var \Wallee\Sdk\Model\ChargeAttemptEnvironment - */ - private $environment; - - /** - * - * - * @var \DateTime - */ - private $failedOn; - - /** - * - * - * @var \Wallee\Sdk\Model\FailureReason - */ - private $failureReason; - - /** - * - * - * @var bool - */ - private $initializingTokenVersion; - - /** - * - * - * @var \Wallee\Sdk\Model\ConnectorInvocation - */ - private $invocation; - - /** - * - * - * @var \Wallee\Sdk\Model\Label[] - */ - private $labels; - - /** - * - * - * @var string - */ - private $language; - - /** - * - * - * @var \DateTime - */ - private $nextUpdateOn; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var string - */ - private $redirectionUrl; - - /** - * - * - * @var int - */ - private $spaceViewId; - - /** - * - * - * @var \Wallee\Sdk\Model\ChargeAttemptState - */ - private $state; - - /** - * - * - * @var \DateTime - */ - private $succeededOn; - - /** - * - * - * @var \DateTime - */ - private $timeoutOn; - - /** - * - * - * @var \Wallee\Sdk\Model\TokenVersion - */ - private $tokenVersion; - - /** - * The user failure message contains the message for the user in case the attempt failed. The message is localized into the language specified on the transaction. - * - * @var string - */ - private $userFailureMessage; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['charge'])) { - $this->setCharge($data['charge']); - } - if (isset($data['connectorConfiguration'])) { - $this->setConnectorConfiguration($data['connectorConfiguration']); - } - if (isset($data['environment'])) { - $this->setEnvironment($data['environment']); - } - if (isset($data['failureReason'])) { - $this->setFailureReason($data['failureReason']); - } - if (isset($data['invocation'])) { - $this->setInvocation($data['invocation']); - } - if (isset($data['labels'])) { - $this->setLabels($data['labels']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['tokenVersion'])) { - $this->setTokenVersion($data['tokenVersion']); - } - } - - - /** - * Returns charge. - * - * - * - * @return \Wallee\Sdk\Model\Charge - */ - public function getCharge() { - return $this->charge; - } - - /** - * Sets charge. - * - * @param \Wallee\Sdk\Model\Charge $charge - * @return ChargeAttempt - */ - public function setCharge($charge) { - $this->charge = $charge; - - return $this; - } - - /** - * Returns connectorConfiguration. - * - * - * - * @return \Wallee\Sdk\Model\PaymentConnectorConfiguration - */ - public function getConnectorConfiguration() { - return $this->connectorConfiguration; - } - - /** - * Sets connectorConfiguration. - * - * @param \Wallee\Sdk\Model\PaymentConnectorConfiguration $connectorConfiguration - * @return ChargeAttempt - */ - public function setConnectorConfiguration($connectorConfiguration) { - $this->connectorConfiguration = $connectorConfiguration; - - return $this; - } - - /** - * Returns createdOn. - * - * The created on date indicates the date on which the entity was stored into the database. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return ChargeAttempt - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns environment. - * - * - * - * @return \Wallee\Sdk\Model\ChargeAttemptEnvironment - */ - public function getEnvironment() { - return $this->environment; - } - - /** - * Sets environment. - * - * @param \Wallee\Sdk\Model\ChargeAttemptEnvironment $environment - * @return ChargeAttempt - */ - public function setEnvironment($environment) { - $this->environment = $environment; - - return $this; - } - - /** - * Returns failedOn. - * - * - * - * @return \DateTime - */ - public function getFailedOn() { - return $this->failedOn; - } - - /** - * Sets failedOn. - * - * @param \DateTime $failedOn - * @return ChargeAttempt - */ - protected function setFailedOn($failedOn) { - $this->failedOn = $failedOn; - - return $this; - } - - /** - * Returns failureReason. - * - * - * - * @return \Wallee\Sdk\Model\FailureReason - */ - public function getFailureReason() { - return $this->failureReason; - } - - /** - * Sets failureReason. - * - * @param \Wallee\Sdk\Model\FailureReason $failureReason - * @return ChargeAttempt - */ - public function setFailureReason($failureReason) { - $this->failureReason = $failureReason; - - return $this; - } - - /** - * Returns initializingTokenVersion. - * - * - * - * @return bool - */ - public function getInitializingTokenVersion() { - return $this->initializingTokenVersion; - } - - /** - * Sets initializingTokenVersion. - * - * @param bool $initializingTokenVersion - * @return ChargeAttempt - */ - protected function setInitializingTokenVersion($initializingTokenVersion) { - $this->initializingTokenVersion = $initializingTokenVersion; - - return $this; - } - - /** - * Returns invocation. - * - * - * - * @return \Wallee\Sdk\Model\ConnectorInvocation - */ - public function getInvocation() { - return $this->invocation; - } - - /** - * Sets invocation. - * - * @param \Wallee\Sdk\Model\ConnectorInvocation $invocation - * @return ChargeAttempt - */ - public function setInvocation($invocation) { - $this->invocation = $invocation; - - return $this; - } - - /** - * Returns labels. - * - * - * - * @return \Wallee\Sdk\Model\Label[] - */ - public function getLabels() { - return $this->labels; - } - - /** - * Sets labels. - * - * @param \Wallee\Sdk\Model\Label[] $labels - * @return ChargeAttempt - */ - public function setLabels($labels) { - $this->labels = $labels; - - return $this; - } - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return ChargeAttempt - */ - protected function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns nextUpdateOn. - * - * - * - * @return \DateTime - */ - public function getNextUpdateOn() { - return $this->nextUpdateOn; - } - - /** - * Sets nextUpdateOn. - * - * @param \DateTime $nextUpdateOn - * @return ChargeAttempt - */ - protected function setNextUpdateOn($nextUpdateOn) { - $this->nextUpdateOn = $nextUpdateOn; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return ChargeAttempt - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns redirectionUrl. - * - * - * - * @return string - */ - public function getRedirectionUrl() { - return $this->redirectionUrl; - } - - /** - * Sets redirectionUrl. - * - * @param string $redirectionUrl - * @return ChargeAttempt - */ - protected function setRedirectionUrl($redirectionUrl) { - $this->redirectionUrl = $redirectionUrl; - - return $this; - } - - /** - * Returns spaceViewId. - * - * - * - * @return int - */ - public function getSpaceViewId() { - return $this->spaceViewId; - } - - /** - * Sets spaceViewId. - * - * @param int $spaceViewId - * @return ChargeAttempt - */ - protected function setSpaceViewId($spaceViewId) { - $this->spaceViewId = $spaceViewId; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\ChargeAttemptState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\ChargeAttemptState $state - * @return ChargeAttempt - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns succeededOn. - * - * - * - * @return \DateTime - */ - public function getSucceededOn() { - return $this->succeededOn; - } - - /** - * Sets succeededOn. - * - * @param \DateTime $succeededOn - * @return ChargeAttempt - */ - protected function setSucceededOn($succeededOn) { - $this->succeededOn = $succeededOn; - - return $this; - } - - /** - * Returns timeoutOn. - * - * - * - * @return \DateTime - */ - public function getTimeoutOn() { - return $this->timeoutOn; - } - - /** - * Sets timeoutOn. - * - * @param \DateTime $timeoutOn - * @return ChargeAttempt - */ - protected function setTimeoutOn($timeoutOn) { - $this->timeoutOn = $timeoutOn; - - return $this; - } - - /** - * Returns tokenVersion. - * - * - * - * @return \Wallee\Sdk\Model\TokenVersion - */ - public function getTokenVersion() { - return $this->tokenVersion; - } - - /** - * Sets tokenVersion. - * - * @param \Wallee\Sdk\Model\TokenVersion $tokenVersion - * @return ChargeAttempt - */ - public function setTokenVersion($tokenVersion) { - $this->tokenVersion = $tokenVersion; - - return $this; - } - - /** - * Returns userFailureMessage. - * - * The user failure message contains the message for the user in case the attempt failed. The message is localized into the language specified on the transaction. - * - * @return string - */ - public function getUserFailureMessage() { - return $this->userFailureMessage; - } - - /** - * Sets userFailureMessage. - * - * @param string $userFailureMessage - * @return ChargeAttempt - */ - protected function setUserFailureMessage($userFailureMessage) { - $this->userFailureMessage = $userFailureMessage; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return ChargeAttempt - */ - protected function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class ChargeAttempt extends TransactionAwareEntity +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ChargeAttempt'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'charge' => '\Wallee\Sdk\Model\Charge', + 'connector_configuration' => '\Wallee\Sdk\Model\PaymentConnectorConfiguration', + 'created_on' => '\DateTime', + 'environment' => '\Wallee\Sdk\Model\ChargeAttemptEnvironment', + 'failed_on' => '\DateTime', + 'failure_reason' => '\Wallee\Sdk\Model\FailureReason', + 'initializing_token_version' => 'bool', + 'invocation' => '\Wallee\Sdk\Model\ConnectorInvocation', + 'labels' => '\Wallee\Sdk\Model\Label[]', + 'language' => 'string', + 'next_update_on' => '\DateTime', + 'planned_purge_date' => '\DateTime', + 'redirection_url' => 'string', + 'space_view_id' => 'int', + 'state' => '\Wallee\Sdk\Model\ChargeAttemptState', + 'succeeded_on' => '\DateTime', + 'terminal' => '\Wallee\Sdk\Model\PaymentTerminal', + 'time_zone' => 'string', + 'timeout_on' => '\DateTime', + 'token_version' => '\Wallee\Sdk\Model\TokenVersion', + 'user_failure_message' => 'string', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'charge' => null, + 'connector_configuration' => null, + 'created_on' => 'date-time', + 'environment' => null, + 'failed_on' => 'date-time', + 'failure_reason' => null, + 'initializing_token_version' => null, + 'invocation' => null, + 'labels' => null, + 'language' => null, + 'next_update_on' => 'date-time', + 'planned_purge_date' => 'date-time', + 'redirection_url' => null, + 'space_view_id' => 'int64', + 'state' => null, + 'succeeded_on' => 'date-time', + 'terminal' => null, + 'time_zone' => null, + 'timeout_on' => 'date-time', + 'token_version' => null, + 'user_failure_message' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'charge' => 'charge', + 'connector_configuration' => 'connectorConfiguration', + 'created_on' => 'createdOn', + 'environment' => 'environment', + 'failed_on' => 'failedOn', + 'failure_reason' => 'failureReason', + 'initializing_token_version' => 'initializingTokenVersion', + 'invocation' => 'invocation', + 'labels' => 'labels', + 'language' => 'language', + 'next_update_on' => 'nextUpdateOn', + 'planned_purge_date' => 'plannedPurgeDate', + 'redirection_url' => 'redirectionUrl', + 'space_view_id' => 'spaceViewId', + 'state' => 'state', + 'succeeded_on' => 'succeededOn', + 'terminal' => 'terminal', + 'time_zone' => 'timeZone', + 'timeout_on' => 'timeoutOn', + 'token_version' => 'tokenVersion', + 'user_failure_message' => 'userFailureMessage', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'charge' => 'setCharge', + 'connector_configuration' => 'setConnectorConfiguration', + 'created_on' => 'setCreatedOn', + 'environment' => 'setEnvironment', + 'failed_on' => 'setFailedOn', + 'failure_reason' => 'setFailureReason', + 'initializing_token_version' => 'setInitializingTokenVersion', + 'invocation' => 'setInvocation', + 'labels' => 'setLabels', + 'language' => 'setLanguage', + 'next_update_on' => 'setNextUpdateOn', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'redirection_url' => 'setRedirectionUrl', + 'space_view_id' => 'setSpaceViewId', + 'state' => 'setState', + 'succeeded_on' => 'setSucceededOn', + 'terminal' => 'setTerminal', + 'time_zone' => 'setTimeZone', + 'timeout_on' => 'setTimeoutOn', + 'token_version' => 'setTokenVersion', + 'user_failure_message' => 'setUserFailureMessage', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'charge' => 'getCharge', + 'connector_configuration' => 'getConnectorConfiguration', + 'created_on' => 'getCreatedOn', + 'environment' => 'getEnvironment', + 'failed_on' => 'getFailedOn', + 'failure_reason' => 'getFailureReason', + 'initializing_token_version' => 'getInitializingTokenVersion', + 'invocation' => 'getInvocation', + 'labels' => 'getLabels', + 'language' => 'getLanguage', + 'next_update_on' => 'getNextUpdateOn', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'redirection_url' => 'getRedirectionUrl', + 'space_view_id' => 'getSpaceViewId', + 'state' => 'getState', + 'succeeded_on' => 'getSucceededOn', + 'terminal' => 'getTerminal', + 'time_zone' => 'getTimeZone', + 'timeout_on' => 'getTimeoutOn', + 'token_version' => 'getTokenVersion', + 'user_failure_message' => 'getUserFailureMessage', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['charge'] = isset($data['charge']) ? $data['charge'] : null; + + $this->container['connector_configuration'] = isset($data['connector_configuration']) ? $data['connector_configuration'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['environment'] = isset($data['environment']) ? $data['environment'] : null; + + $this->container['failed_on'] = isset($data['failed_on']) ? $data['failed_on'] : null; + + $this->container['failure_reason'] = isset($data['failure_reason']) ? $data['failure_reason'] : null; + + $this->container['initializing_token_version'] = isset($data['initializing_token_version']) ? $data['initializing_token_version'] : null; + + $this->container['invocation'] = isset($data['invocation']) ? $data['invocation'] : null; + + $this->container['labels'] = isset($data['labels']) ? $data['labels'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['next_update_on'] = isset($data['next_update_on']) ? $data['next_update_on'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['redirection_url'] = isset($data['redirection_url']) ? $data['redirection_url'] : null; + + $this->container['space_view_id'] = isset($data['space_view_id']) ? $data['space_view_id'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['succeeded_on'] = isset($data['succeeded_on']) ? $data['succeeded_on'] : null; + + $this->container['terminal'] = isset($data['terminal']) ? $data['terminal'] : null; + + $this->container['time_zone'] = isset($data['time_zone']) ? $data['time_zone'] : null; + + $this->container['timeout_on'] = isset($data['timeout_on']) ? $data['timeout_on'] : null; + + $this->container['token_version'] = isset($data['token_version']) ? $data['token_version'] : null; + + $this->container['user_failure_message'] = isset($data['user_failure_message']) ? $data['user_failure_message'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 charge + * + * @return \Wallee\Sdk\Model\Charge + */ + public function getCharge() + { + return $this->container['charge']; + } + + /** + * Sets charge + * + * @param \Wallee\Sdk\Model\Charge $charge + * + * @return $this + */ + public function setCharge($charge) + { + $this->container['charge'] = $charge; + + return $this; + } + + + /** + * Gets connector_configuration + * + * @return \Wallee\Sdk\Model\PaymentConnectorConfiguration + */ + public function getConnectorConfiguration() + { + return $this->container['connector_configuration']; + } + + /** + * Sets connector_configuration + * + * @param \Wallee\Sdk\Model\PaymentConnectorConfiguration $connector_configuration + * + * @return $this + */ + public function setConnectorConfiguration($connector_configuration) + { + $this->container['connector_configuration'] = $connector_configuration; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets environment + * + * @return \Wallee\Sdk\Model\ChargeAttemptEnvironment + */ + public function getEnvironment() + { + return $this->container['environment']; + } + + /** + * Sets environment + * + * @param \Wallee\Sdk\Model\ChargeAttemptEnvironment $environment + * + * @return $this + */ + public function setEnvironment($environment) + { + $this->container['environment'] = $environment; + + return $this; + } + + + /** + * Gets failed_on + * + * @return \DateTime + */ + public function getFailedOn() + { + return $this->container['failed_on']; + } + + /** + * Sets failed_on + * + * @param \DateTime $failed_on + * + * @return $this + */ + public function setFailedOn($failed_on) + { + $this->container['failed_on'] = $failed_on; + + return $this; + } + + + /** + * Gets failure_reason + * + * @return \Wallee\Sdk\Model\FailureReason + */ + public function getFailureReason() + { + return $this->container['failure_reason']; + } + + /** + * Sets failure_reason + * + * @param \Wallee\Sdk\Model\FailureReason $failure_reason + * + * @return $this + */ + public function setFailureReason($failure_reason) + { + $this->container['failure_reason'] = $failure_reason; + + return $this; + } + + + /** + * Gets initializing_token_version + * + * @return bool + */ + public function getInitializingTokenVersion() + { + return $this->container['initializing_token_version']; + } + + /** + * Sets initializing_token_version + * + * @param bool $initializing_token_version + * + * @return $this + */ + public function setInitializingTokenVersion($initializing_token_version) + { + $this->container['initializing_token_version'] = $initializing_token_version; + + return $this; + } + + + /** + * Gets invocation + * + * @return \Wallee\Sdk\Model\ConnectorInvocation + */ + public function getInvocation() + { + return $this->container['invocation']; + } + + /** + * Sets invocation + * + * @param \Wallee\Sdk\Model\ConnectorInvocation $invocation + * + * @return $this + */ + public function setInvocation($invocation) + { + $this->container['invocation'] = $invocation; + + return $this; + } + + + /** + * Gets labels + * + * @return \Wallee\Sdk\Model\Label[] + */ + public function getLabels() + { + return $this->container['labels']; + } + + /** + * Sets labels + * + * @param \Wallee\Sdk\Model\Label[] $labels + * + * @return $this + */ + public function setLabels($labels) + { + $this->container['labels'] = $labels; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets next_update_on + * + * @return \DateTime + */ + public function getNextUpdateOn() + { + return $this->container['next_update_on']; + } + + /** + * Sets next_update_on + * + * @param \DateTime $next_update_on + * + * @return $this + */ + public function setNextUpdateOn($next_update_on) + { + $this->container['next_update_on'] = $next_update_on; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets redirection_url + * + * @return string + */ + public function getRedirectionUrl() + { + return $this->container['redirection_url']; + } + + /** + * Sets redirection_url + * + * @param string $redirection_url + * + * @return $this + */ + public function setRedirectionUrl($redirection_url) + { + $this->container['redirection_url'] = $redirection_url; + + return $this; + } + + + /** + * Gets space_view_id + * + * @return int + */ + public function getSpaceViewId() + { + return $this->container['space_view_id']; + } + + /** + * Sets space_view_id + * + * @param int $space_view_id + * + * @return $this + */ + public function setSpaceViewId($space_view_id) + { + $this->container['space_view_id'] = $space_view_id; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\ChargeAttemptState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\ChargeAttemptState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets succeeded_on + * + * @return \DateTime + */ + public function getSucceededOn() + { + return $this->container['succeeded_on']; + } + + /** + * Sets succeeded_on + * + * @param \DateTime $succeeded_on + * + * @return $this + */ + public function setSucceededOn($succeeded_on) + { + $this->container['succeeded_on'] = $succeeded_on; + + return $this; + } + + + /** + * Gets terminal + * + * @return \Wallee\Sdk\Model\PaymentTerminal + */ + public function getTerminal() + { + return $this->container['terminal']; + } + + /** + * Sets terminal + * + * @param \Wallee\Sdk\Model\PaymentTerminal $terminal + * + * @return $this + */ + public function setTerminal($terminal) + { + $this->container['terminal'] = $terminal; + + return $this; + } + + + /** + * Gets time_zone + * + * @return string + */ + public function getTimeZone() + { + return $this->container['time_zone']; + } + + /** + * Sets time_zone + * + * @param string $time_zone + * + * @return $this + */ + public function setTimeZone($time_zone) + { + $this->container['time_zone'] = $time_zone; + + return $this; + } + + + /** + * Gets timeout_on + * + * @return \DateTime + */ + public function getTimeoutOn() + { + return $this->container['timeout_on']; + } + + /** + * Sets timeout_on + * + * @param \DateTime $timeout_on + * + * @return $this + */ + public function setTimeoutOn($timeout_on) + { + $this->container['timeout_on'] = $timeout_on; + + return $this; + } + + + /** + * Gets token_version + * + * @return \Wallee\Sdk\Model\TokenVersion + */ + public function getTokenVersion() + { + return $this->container['token_version']; + } + + /** + * Sets token_version + * + * @param \Wallee\Sdk\Model\TokenVersion $token_version + * + * @return $this + */ + public function setTokenVersion($token_version) + { + $this->container['token_version'] = $token_version; + + return $this; + } + + + /** + * Gets user_failure_message + * + * @return string + */ + public function getUserFailureMessage() + { + return $this->container['user_failure_message']; + } + + /** + * Sets user_failure_message + * + * @param string $user_failure_message The user failure message contains the message for the user in case the attempt failed. The message is localized into the language specified on the transaction. + * + * @return $this + */ + public function setUserFailureMessage($user_failure_message) + { + $this->container['user_failure_message'] = $user_failure_message; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/ChargeAttemptEnvironment.php b/wallee-sdk/lib/Model/ChargeAttemptEnvironment.php index b102204..eadd675 100644 --- a/wallee-sdk/lib/Model/ChargeAttemptEnvironment.php +++ b/wallee-sdk/lib/Model/ChargeAttemptEnvironment.php @@ -1,10 +1,8 @@ 'int[]', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'name' => 'string', - 'plannedPurgeDate' => '\DateTime', - 'priority' => 'int', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * If a transaction meets all selected conditions, the charge flow will be used to process the transaction. If the conditions are not met the next charge flow in line will be chosen according to the priorities. - * - * @var int[] - */ - private $conditions; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The charge flow name is used internally to identify the configuration in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * The priority orders the charge flows. As such the priority determines together with the conditions the charge flow the selection mechanism for a particular transaction. A change of the priority affects all future selections. - * - * @var int - */ - private $priority; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['conditions'])) { - $this->setConditions($data['conditions']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns conditions. - * - * If a transaction meets all selected conditions, the charge flow will be used to process the transaction. If the conditions are not met the next charge flow in line will be chosen according to the priorities. - * - * @return int[] - */ - public function getConditions() { - return $this->conditions; - } - - /** - * Sets conditions. - * - * @param int[] $conditions - * @return ChargeFlow - */ - public function setConditions($conditions) { - $this->conditions = $conditions; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return ChargeFlow - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return ChargeFlow - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * The charge flow name is used internally to identify the configuration in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return ChargeFlow - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return ChargeFlow - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns priority. - * - * The priority orders the charge flows. As such the priority determines together with the conditions the charge flow the selection mechanism for a particular transaction. A change of the priority affects all future selections. - * - * @return int - */ - public function getPriority() { - return $this->priority; - } - - /** - * Sets priority. - * - * @param int $priority - * @return ChargeFlow - */ - protected function setPriority($priority) { - $this->priority = $priority; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return ChargeFlow - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return ChargeFlow - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class ChargeFlow implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ChargeFlow'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'conditions' => 'int[]', + 'id' => 'int', + 'linked_space_id' => 'int', + 'name' => 'string', + 'planned_purge_date' => '\DateTime', + 'priority' => 'int', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'conditions' => 'int64', + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'name' => null, + 'planned_purge_date' => 'date-time', + 'priority' => 'int32', + 'state' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'conditions' => 'conditions', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'planned_purge_date' => 'plannedPurgeDate', + 'priority' => 'priority', + 'state' => 'state', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'conditions' => 'setConditions', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'priority' => 'setPriority', + 'state' => 'setState', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'conditions' => 'getConditions', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'priority' => 'getPriority', + 'state' => 'getState', + 'version' => 'getVersion' + ]; + + + + /** + * 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['conditions'] = isset($data['conditions']) ? $data['conditions'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['priority'] = isset($data['priority']) ? $data['priority'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 conditions + * + * @return int[] + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param int[] $conditions If a transaction meets all selected conditions, the charge flow will be used to process the transaction. If the conditions are not met the next charge flow in line will be chosen according to the priorities. + * + * @return $this + */ + public function setConditions($conditions) + { + $this->container['conditions'] = $conditions; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The charge flow name is used internally to identify the configuration in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets priority + * + * @return int + */ + public function getPriority() + { + return $this->container['priority']; + } + + /** + * Sets priority + * + * @param int $priority The priority orders the charge flows. As such the priority determines together with the conditions the charge flow the selection mechanism for a particular transaction. A change of the priority affects all future selections. + * + * @return $this + */ + public function setPriority($priority) + { + $this->container['priority'] = $priority; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/ChargeFlowLevel.php b/wallee-sdk/lib/Model/ChargeFlowLevel.php index e569f2c..cba356e 100644 --- a/wallee-sdk/lib/Model/ChargeFlowLevel.php +++ b/wallee-sdk/lib/Model/ChargeFlowLevel.php @@ -1,10 +1,8 @@ 'int', - 'configuration' => '\Wallee\Sdk\Model\ChargeFlowLevelConfiguration', - 'createdOn' => '\DateTime', - 'plannedPurgeDate' => '\DateTime', - 'state' => '\Wallee\Sdk\Model\ChargeFlowLevelState', - 'synchronousCharge' => 'int', - 'timeoutOn' => '\DateTime', - 'tokenCharge' => 'int', - 'transaction' => '\Wallee\Sdk\Model\Transaction', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * - * - * @var int - */ - private $asynchronousCharge; - - /** - * - * - * @var \Wallee\Sdk\Model\ChargeFlowLevelConfiguration - */ - private $configuration; - - /** - * The created on date indicates the date on which the entity was stored into the database. - * - * @var \DateTime - */ - private $createdOn; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var \Wallee\Sdk\Model\ChargeFlowLevelState - */ - private $state; - - /** - * - * - * @var int - */ - private $synchronousCharge; - - /** - * - * - * @var \DateTime - */ - private $timeoutOn; - - /** - * - * - * @var int - */ - private $tokenCharge; - - /** - * - * - * @var \Wallee\Sdk\Model\Transaction - */ - private $transaction; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['configuration'])) { - $this->setConfiguration($data['configuration']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['transaction'])) { - $this->setTransaction($data['transaction']); - } - } - - - /** - * Returns asynchronousCharge. - * - * - * - * @return int - */ - public function getAsynchronousCharge() { - return $this->asynchronousCharge; - } - - /** - * Sets asynchronousCharge. - * - * @param int $asynchronousCharge - * @return ChargeFlowLevel - */ - protected function setAsynchronousCharge($asynchronousCharge) { - $this->asynchronousCharge = $asynchronousCharge; - - return $this; - } - - /** - * Returns configuration. - * - * - * - * @return \Wallee\Sdk\Model\ChargeFlowLevelConfiguration - */ - public function getConfiguration() { - return $this->configuration; - } - - /** - * Sets configuration. - * - * @param \Wallee\Sdk\Model\ChargeFlowLevelConfiguration $configuration - * @return ChargeFlowLevel - */ - public function setConfiguration($configuration) { - $this->configuration = $configuration; - - return $this; - } - - /** - * Returns createdOn. - * - * The created on date indicates the date on which the entity was stored into the database. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return ChargeFlowLevel - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return ChargeFlowLevel - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\ChargeFlowLevelState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\ChargeFlowLevelState $state - * @return ChargeFlowLevel - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns synchronousCharge. - * - * - * - * @return int - */ - public function getSynchronousCharge() { - return $this->synchronousCharge; - } - - /** - * Sets synchronousCharge. - * - * @param int $synchronousCharge - * @return ChargeFlowLevel - */ - protected function setSynchronousCharge($synchronousCharge) { - $this->synchronousCharge = $synchronousCharge; - - return $this; - } - - /** - * Returns timeoutOn. - * - * - * - * @return \DateTime - */ - public function getTimeoutOn() { - return $this->timeoutOn; - } - - /** - * Sets timeoutOn. - * - * @param \DateTime $timeoutOn - * @return ChargeFlowLevel - */ - protected function setTimeoutOn($timeoutOn) { - $this->timeoutOn = $timeoutOn; - - return $this; - } - - /** - * Returns tokenCharge. - * - * - * - * @return int - */ - public function getTokenCharge() { - return $this->tokenCharge; - } - - /** - * Sets tokenCharge. - * - * @param int $tokenCharge - * @return ChargeFlowLevel - */ - protected function setTokenCharge($tokenCharge) { - $this->tokenCharge = $tokenCharge; - - return $this; - } - - /** - * Returns transaction. - * - * - * - * @return \Wallee\Sdk\Model\Transaction - */ - public function getTransaction() { - return $this->transaction; - } - - /** - * Sets transaction. - * - * @param \Wallee\Sdk\Model\Transaction $transaction - * @return ChargeFlowLevel - */ - public function setTransaction($transaction) { - $this->transaction = $transaction; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return ChargeFlowLevel - */ - protected function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class ChargeFlowLevel extends TransactionAwareEntity +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ChargeFlowLevel'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'asynchronous_charge' => 'int', + 'configuration' => '\Wallee\Sdk\Model\ChargeFlowLevelConfiguration', + 'created_on' => '\DateTime', + 'planned_purge_date' => '\DateTime', + 'state' => '\Wallee\Sdk\Model\ChargeFlowLevelState', + 'synchronous_charge' => 'int', + 'timeout_on' => '\DateTime', + 'token_charge' => 'int', + 'transaction' => '\Wallee\Sdk\Model\Transaction', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'asynchronous_charge' => 'int64', + 'configuration' => null, + 'created_on' => 'date-time', + 'planned_purge_date' => 'date-time', + 'state' => null, + 'synchronous_charge' => 'int64', + 'timeout_on' => 'date-time', + 'token_charge' => 'int64', + 'transaction' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'asynchronous_charge' => 'asynchronousCharge', + 'configuration' => 'configuration', + 'created_on' => 'createdOn', + 'planned_purge_date' => 'plannedPurgeDate', + 'state' => 'state', + 'synchronous_charge' => 'synchronousCharge', + 'timeout_on' => 'timeoutOn', + 'token_charge' => 'tokenCharge', + 'transaction' => 'transaction', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'asynchronous_charge' => 'setAsynchronousCharge', + 'configuration' => 'setConfiguration', + 'created_on' => 'setCreatedOn', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'state' => 'setState', + 'synchronous_charge' => 'setSynchronousCharge', + 'timeout_on' => 'setTimeoutOn', + 'token_charge' => 'setTokenCharge', + 'transaction' => 'setTransaction', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'asynchronous_charge' => 'getAsynchronousCharge', + 'configuration' => 'getConfiguration', + 'created_on' => 'getCreatedOn', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'state' => 'getState', + 'synchronous_charge' => 'getSynchronousCharge', + 'timeout_on' => 'getTimeoutOn', + 'token_charge' => 'getTokenCharge', + 'transaction' => 'getTransaction', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['asynchronous_charge'] = isset($data['asynchronous_charge']) ? $data['asynchronous_charge'] : null; + + $this->container['configuration'] = isset($data['configuration']) ? $data['configuration'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['synchronous_charge'] = isset($data['synchronous_charge']) ? $data['synchronous_charge'] : null; + + $this->container['timeout_on'] = isset($data['timeout_on']) ? $data['timeout_on'] : null; + + $this->container['token_charge'] = isset($data['token_charge']) ? $data['token_charge'] : null; + + $this->container['transaction'] = isset($data['transaction']) ? $data['transaction'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 asynchronous_charge + * + * @return int + */ + public function getAsynchronousCharge() + { + return $this->container['asynchronous_charge']; + } + + /** + * Sets asynchronous_charge + * + * @param int $asynchronous_charge + * + * @return $this + */ + public function setAsynchronousCharge($asynchronous_charge) + { + $this->container['asynchronous_charge'] = $asynchronous_charge; + + return $this; + } + + + /** + * Gets configuration + * + * @return \Wallee\Sdk\Model\ChargeFlowLevelConfiguration + */ + public function getConfiguration() + { + return $this->container['configuration']; + } + + /** + * Sets configuration + * + * @param \Wallee\Sdk\Model\ChargeFlowLevelConfiguration $configuration + * + * @return $this + */ + public function setConfiguration($configuration) + { + $this->container['configuration'] = $configuration; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\ChargeFlowLevelState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\ChargeFlowLevelState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets synchronous_charge + * + * @return int + */ + public function getSynchronousCharge() + { + return $this->container['synchronous_charge']; + } + + /** + * Sets synchronous_charge + * + * @param int $synchronous_charge + * + * @return $this + */ + public function setSynchronousCharge($synchronous_charge) + { + $this->container['synchronous_charge'] = $synchronous_charge; + + return $this; + } + + + /** + * Gets timeout_on + * + * @return \DateTime + */ + public function getTimeoutOn() + { + return $this->container['timeout_on']; + } + + /** + * Sets timeout_on + * + * @param \DateTime $timeout_on + * + * @return $this + */ + public function setTimeoutOn($timeout_on) + { + $this->container['timeout_on'] = $timeout_on; + + return $this; + } + + + /** + * Gets token_charge + * + * @return int + */ + public function getTokenCharge() + { + return $this->container['token_charge']; + } + + /** + * Sets token_charge + * + * @param int $token_charge + * + * @return $this + */ + public function setTokenCharge($token_charge) + { + $this->container['token_charge'] = $token_charge; + + return $this; + } + + + /** + * Gets transaction + * + * @return \Wallee\Sdk\Model\Transaction + */ + public function getTransaction() + { + return $this->container['transaction']; + } + + /** + * Sets transaction + * + * @param \Wallee\Sdk\Model\Transaction $transaction + * + * @return $this + */ + public function setTransaction($transaction) + { + $this->container['transaction'] = $transaction; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/ChargeFlowLevelConfiguration.php b/wallee-sdk/lib/Model/ChargeFlowLevelConfiguration.php index daef1f8..b1d01b7 100644 --- a/wallee-sdk/lib/Model/ChargeFlowLevelConfiguration.php +++ b/wallee-sdk/lib/Model/ChargeFlowLevelConfiguration.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\ChargeFlow', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'name' => 'string', - 'period' => 'string', - 'plannedPurgeDate' => '\DateTime', - 'priority' => 'int', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'type' => 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The charge flow level configuration to which the flow is associated. - * - * @var \Wallee\Sdk\Model\ChargeFlow - */ - private $flow; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The charge flow level configuration name is used internally to identify the charge flow level configuration. For example the name is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * The duration of the level before switching to the next one. - * - * @var string - */ - private $period; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * The priority indicates the sort order of the level configurations. A low value indicates that the level configuration is executed before any level with a higher value. Any change to this value affects future level configuration selections. - * - * @var int - */ - private $priority; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The type determines how the payment link is delivered to the customer. Once the type is defined it cannot be changed anymore. - * - * @var int - */ - private $type; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['flow'])) { - $this->setFlow($data['flow']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns flow. - * - * The charge flow level configuration to which the flow is associated. - * - * @return \Wallee\Sdk\Model\ChargeFlow - */ - public function getFlow() { - return $this->flow; - } - - /** - * Sets flow. - * - * @param \Wallee\Sdk\Model\ChargeFlow $flow - * @return ChargeFlowLevelConfiguration - */ - public function setFlow($flow) { - $this->flow = $flow; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return ChargeFlowLevelConfiguration - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return ChargeFlowLevelConfiguration - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * The charge flow level configuration name is used internally to identify the charge flow level configuration. For example the name is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return ChargeFlowLevelConfiguration - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns period. - * - * The duration of the level before switching to the next one. - * - * @return string - */ - public function getPeriod() { - return $this->period; - } - - /** - * Sets period. - * - * @param string $period - * @return ChargeFlowLevelConfiguration - */ - protected function setPeriod($period) { - $this->period = $period; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return ChargeFlowLevelConfiguration - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns priority. - * - * The priority indicates the sort order of the level configurations. A low value indicates that the level configuration is executed before any level with a higher value. Any change to this value affects future level configuration selections. - * - * @return int - */ - public function getPriority() { - return $this->priority; - } - - /** - * Sets priority. - * - * @param int $priority - * @return ChargeFlowLevelConfiguration - */ - protected function setPriority($priority) { - $this->priority = $priority; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return ChargeFlowLevelConfiguration - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns type. - * - * The type determines how the payment link is delivered to the customer. Once the type is defined it cannot be changed anymore. - * - * @return int - */ - public function getType() { - return $this->type; - } - - /** - * Sets type. - * - * @param int $type - * @return ChargeFlowLevelConfiguration - */ - protected function setType($type) { - $this->type = $type; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return ChargeFlowLevelConfiguration - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class ChargeFlowLevelConfiguration implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ChargeFlowLevelConfiguration'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'flow' => '\Wallee\Sdk\Model\ChargeFlow', + 'id' => 'int', + 'linked_space_id' => 'int', + 'name' => 'string', + 'period' => 'string', + 'planned_purge_date' => '\DateTime', + 'priority' => 'int', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'type' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'flow' => null, + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'name' => null, + 'period' => null, + 'planned_purge_date' => 'date-time', + 'priority' => 'int32', + 'state' => null, + 'type' => 'int64', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'flow' => 'flow', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'period' => 'period', + 'planned_purge_date' => 'plannedPurgeDate', + 'priority' => 'priority', + 'state' => 'state', + 'type' => 'type', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'flow' => 'setFlow', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'period' => 'setPeriod', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'priority' => 'setPriority', + 'state' => 'setState', + 'type' => 'setType', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'flow' => 'getFlow', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'period' => 'getPeriod', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'priority' => 'getPriority', + 'state' => 'getState', + 'type' => 'getType', + 'version' => 'getVersion' + ]; + + + + /** + * 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['flow'] = isset($data['flow']) ? $data['flow'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['period'] = isset($data['period']) ? $data['period'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['priority'] = isset($data['priority']) ? $data['priority'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 flow + * + * @return \Wallee\Sdk\Model\ChargeFlow + */ + public function getFlow() + { + return $this->container['flow']; + } + + /** + * Sets flow + * + * @param \Wallee\Sdk\Model\ChargeFlow $flow The charge flow level configuration to which the flow is associated. + * + * @return $this + */ + public function setFlow($flow) + { + $this->container['flow'] = $flow; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The charge flow level configuration name is used internally to identify the charge flow level configuration. For example the name is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets period + * + * @return string + */ + public function getPeriod() + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param string $period The duration of the level before switching to the next one. + * + * @return $this + */ + public function setPeriod($period) + { + $this->container['period'] = $period; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets priority + * + * @return int + */ + public function getPriority() + { + return $this->container['priority']; + } + + /** + * Sets priority + * + * @param int $priority The priority indicates the sort order of the level configurations. A low value indicates that the level configuration is executed before any level with a higher value. Any change to this value affects future level configuration selections. + * + * @return $this + */ + public function setPriority($priority) + { + $this->container['priority'] = $priority; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets type + * + * @return int + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param int $type The type determines how the payment link is delivered to the customer. Once the type is defined it cannot be changed anymore. + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/ChargeFlowLevelConfigurationType.php b/wallee-sdk/lib/Model/ChargeFlowLevelConfigurationType.php index 8a8b7e6..4a519a1 100644 --- a/wallee-sdk/lib/Model/ChargeFlowLevelConfigurationType.php +++ b/wallee-sdk/lib/Model/ChargeFlowLevelConfigurationType.php @@ -1,10 +1,8 @@ 'map[string,string]', - 'id' => 'int', - 'name' => 'map[string,string]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $name; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - } - - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return ChargeFlowLevelConfigurationType - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return ChargeFlowLevelConfigurationType - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return ChargeFlowLevelConfigurationType - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class ChargeFlowLevelConfigurationType implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ChargeFlowLevelConfigurationType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'description' => 'map[string,string]', + 'id' => 'int', + 'name' => 'map[string,string]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'id' => 'int64', + 'name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'name' => 'getName' + ]; + + + + /** + * 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['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + 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/wallee-sdk/lib/Model/ChargeFlowLevelState.php b/wallee-sdk/lib/Model/ChargeFlowLevelState.php index 28dcc16..7dd22a2 100644 --- a/wallee-sdk/lib/Model/ChargeFlowLevelState.php +++ b/wallee-sdk/lib/Model/ChargeFlowLevelState.php @@ -1,10 +1,8 @@ 'string', - 'defaultMessage' => 'string', - 'id' => 'string', - 'message' => 'string', - 'type' => '\Wallee\Sdk\Model\ClientErrorType' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * Date when an error has occurred. - * - * @var string - */ - private $date; - - /** - * The error message which is translated into the default language (i.e. English). - * - * @var string - */ - private $defaultMessage; - - /** - * Unique identifier of an error. - * - * @var string - */ - private $id; - - /** - * The error message which is translated in into the language of the client. - * - * @var string - */ - private $message; - - /** - * The type of the client error. - * - * @var \Wallee\Sdk\Model\ClientErrorType - */ - private $type; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['type'])) { - $this->setType($data['type']); - } - } - - - /** - * Returns date. - * - * Date when an error has occurred. - * - * @return string - */ - public function getDate() { - return $this->date; - } - - /** - * Sets date. - * - * @param string $date - * @return ClientError - */ - protected function setDate($date) { - $this->date = $date; - - return $this; - } - - /** - * Returns defaultMessage. - * - * The error message which is translated into the default language (i.e. English). - * - * @return string - */ - public function getDefaultMessage() { - return $this->defaultMessage; - } - - /** - * Sets defaultMessage. - * - * @param string $defaultMessage - * @return ClientError - */ - protected function setDefaultMessage($defaultMessage) { - $this->defaultMessage = $defaultMessage; - - return $this; - } - - /** - * Returns id. - * - * Unique identifier of an error. - * - * @return string - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param string $id - * @return ClientError - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns message. - * - * The error message which is translated in into the language of the client. - * - * @return string - */ - public function getMessage() { - return $this->message; - } - - /** - * Sets message. - * - * @param string $message - * @return ClientError - */ - protected function setMessage($message) { - $this->message = $message; - - return $this; - } - - /** - * Returns type. - * - * The type of the client error. - * - * @return \Wallee\Sdk\Model\ClientErrorType - */ - public function getType() { - return $this->type; - } - - /** - * Sets type. - * - * @param \Wallee\Sdk\Model\ClientErrorType $type - * @return ClientError - */ - public function setType($type) { - $this->type = $type; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class ClientError implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ClientError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'date' => 'string', + 'default_message' => 'string', + 'id' => 'string', + 'message' => 'string', + 'type' => '\Wallee\Sdk\Model\ClientErrorType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'date' => null, + 'default_message' => null, + 'id' => null, + 'message' => null, + 'type' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'date' => 'date', + 'default_message' => 'defaultMessage', + 'id' => 'id', + 'message' => 'message', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'date' => 'setDate', + 'default_message' => 'setDefaultMessage', + 'id' => 'setId', + 'message' => 'setMessage', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'date' => 'getDate', + 'default_message' => 'getDefaultMessage', + 'id' => 'getId', + 'message' => 'getMessage', + 'type' => 'getType' + ]; + + + + /** + * 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['date'] = isset($data['date']) ? $data['date'] : null; + + $this->container['default_message'] = isset($data['default_message']) ? $data['default_message'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 date + * + * @return string + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param string $date Date when an error has occurred. + * + * @return $this + */ + public function setDate($date) + { + $this->container['date'] = $date; + + return $this; + } + + + /** + * Gets default_message + * + * @return string + */ + public function getDefaultMessage() + { + return $this->container['default_message']; + } + + /** + * Sets default_message + * + * @param string $default_message The error message which is translated into the default language (i.e. English). + * + * @return $this + */ + public function setDefaultMessage($default_message) + { + $this->container['default_message'] = $default_message; + + return $this; + } + + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id Unique identifier of an error. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message The error message which is translated in into the language of the client. + * + * @return $this + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + + /** + * Gets type + * + * @return \Wallee\Sdk\Model\ClientErrorType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Wallee\Sdk\Model\ClientErrorType $type The type of the client error. + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + 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/wallee-sdk/lib/Model/ClientErrorType.php b/wallee-sdk/lib/Model/ClientErrorType.php index 2183180..55574cd 100644 --- a/wallee-sdk/lib/Model/ClientErrorType.php +++ b/wallee-sdk/lib/Model/ClientErrorType.php @@ -1,10 +1,8 @@ 'float', + 'quantity' => 'float', + 'unique_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'amount' => null, + 'quantity' => null, + 'unique_id' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'quantity' => 'quantity', + 'unique_id' => 'uniqueId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'quantity' => 'setQuantity', + 'unique_id' => 'setUniqueId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'quantity' => 'getQuantity', + 'unique_id' => 'getUniqueId' + ]; + + + + /** + * 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['amount'] = isset($data['amount']) ? $data['amount'] : null; + + $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; + + $this->container['unique_id'] = isset($data['unique_id']) ? $data['unique_id'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 amount + * + * @return float + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param float $amount The total amount of the line item including any tax. + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + + /** + * Gets quantity + * + * @return float + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param float $quantity The quantity of the line item which should be completed. + * + * @return $this + */ + public function setQuantity($quantity) + { + $this->container['quantity'] = $quantity; + + return $this; + } + + + /** + * Gets unique_id + * + * @return string + */ + public function getUniqueId() + { + return $this->container['unique_id']; + } + + /** + * Sets unique_id + * + * @param string $unique_id The unique id identifies the line item on which the capture is applied on. + * + * @return $this + */ + public function setUniqueId($unique_id) + { + $this->container['unique_id'] = $unique_id; + + 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/wallee-sdk/lib/Model/CompletionLineItemCreate.php b/wallee-sdk/lib/Model/CompletionLineItemCreate.php new file mode 100644 index 0000000..b792c7d --- /dev/null +++ b/wallee-sdk/lib/Model/CompletionLineItemCreate.php @@ -0,0 +1,371 @@ + 'float', + 'quantity' => 'float', + 'unique_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'amount' => null, + 'quantity' => null, + 'unique_id' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'quantity' => 'quantity', + 'unique_id' => 'uniqueId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'quantity' => 'setQuantity', + 'unique_id' => 'setUniqueId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'quantity' => 'getQuantity', + 'unique_id' => 'getUniqueId' + ]; + + + + /** + * 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['amount'] = isset($data['amount']) ? $data['amount'] : null; + + $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; + + $this->container['unique_id'] = isset($data['unique_id']) ? $data['unique_id'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + if ($this->container['quantity'] === null) { + $invalidProperties[] = "'quantity' can't be null"; + } + if ($this->container['unique_id'] === null) { + $invalidProperties[] = "'unique_id' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 amount + * + * @return float + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param float $amount The total amount of the line item including any tax. + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + + /** + * Gets quantity + * + * @return float + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param float $quantity The quantity of the line item which should be completed. + * + * @return $this + */ + public function setQuantity($quantity) + { + $this->container['quantity'] = $quantity; + + return $this; + } + + + /** + * Gets unique_id + * + * @return string + */ + public function getUniqueId() + { + return $this->container['unique_id']; + } + + /** + * Sets unique_id + * + * @param string $unique_id The unique id identifies the line item on which the capture is applied on. + * + * @return $this + */ + public function setUniqueId($unique_id) + { + $this->container['unique_id'] = $unique_id; + + 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/wallee-sdk/lib/Model/Condition.php b/wallee-sdk/lib/Model/Condition.php index eeba2f7..fe1311f 100644 --- a/wallee-sdk/lib/Model/Condition.php +++ b/wallee-sdk/lib/Model/Condition.php @@ -1,10 +1,8 @@ 'int', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'name' => 'string', - 'plannedPurgeDate' => '\DateTime', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The selected condition type defines how the configuration is applied to the transactions. - * - * @var int - */ - private $conditionType; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The condition name is used internally to identify the condition. For example the name is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns conditionType. - * - * The selected condition type defines how the configuration is applied to the transactions. - * - * @return int - */ - public function getConditionType() { - return $this->conditionType; - } - - /** - * Sets conditionType. - * - * @param int $conditionType - * @return Condition - */ - protected function setConditionType($conditionType) { - $this->conditionType = $conditionType; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return Condition - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return Condition - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * The condition name is used internally to identify the condition. For example the name is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return Condition - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return Condition - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return Condition - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return Condition - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class Condition implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Condition'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'condition_type' => 'int', + 'id' => 'int', + 'linked_space_id' => 'int', + 'name' => 'string', + 'planned_purge_date' => '\DateTime', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'condition_type' => 'int64', + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'name' => null, + 'planned_purge_date' => 'date-time', + 'state' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'condition_type' => 'conditionType', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'planned_purge_date' => 'plannedPurgeDate', + 'state' => 'state', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'condition_type' => 'setConditionType', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'state' => 'setState', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'condition_type' => 'getConditionType', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'state' => 'getState', + 'version' => 'getVersion' + ]; + + + + /** + * 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['condition_type'] = isset($data['condition_type']) ? $data['condition_type'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 condition_type + * + * @return int + */ + public function getConditionType() + { + return $this->container['condition_type']; + } + + /** + * Sets condition_type + * + * @param int $condition_type The selected condition type defines how the configuration is applied to the transactions. + * + * @return $this + */ + public function setConditionType($condition_type) + { + $this->container['condition_type'] = $condition_type; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The condition name is used internally to identify the condition. For example the name is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/ConditionType.php b/wallee-sdk/lib/Model/ConditionType.php index dd602cf..0ff3136 100644 --- a/wallee-sdk/lib/Model/ConditionType.php +++ b/wallee-sdk/lib/Model/ConditionType.php @@ -1,10 +1,8 @@ 'map[string,string]', - 'id' => 'int', - 'name' => 'map[string,string]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $name; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - } - - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return ConditionType - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return ConditionType - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return ConditionType - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class ConditionType implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ConditionType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'description' => 'map[string,string]', + 'id' => 'int', + 'name' => 'map[string,string]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'id' => 'int64', + 'name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'name' => 'getName' + ]; + + + + /** + * 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['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + 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/wallee-sdk/lib/Model/ConnectorInvocation.php b/wallee-sdk/lib/Model/ConnectorInvocation.php index 217df17..d62a259 100644 --- a/wallee-sdk/lib/Model/ConnectorInvocation.php +++ b/wallee-sdk/lib/Model/ConnectorInvocation.php @@ -1,10 +1,8 @@ '\DateTime', - 'plannedPurgeDate' => '\DateTime', - 'stage' => '\Wallee\Sdk\Model\ConnectorInvocationStage', - 'timeTookInMilliseconds' => 'int', - 'transaction' => 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * The created on date indicates the date on which the entity was stored into the database. - * - * @var \DateTime - */ - private $createdOn; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var \Wallee\Sdk\Model\ConnectorInvocationStage - */ - private $stage; - - /** - * - * - * @var int - */ - private $timeTookInMilliseconds; - - /** - * - * - * @var int - */ - private $transaction; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['stage'])) { - $this->setStage($data['stage']); - } - } - - - /** - * Returns createdOn. - * - * The created on date indicates the date on which the entity was stored into the database. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return ConnectorInvocation - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return ConnectorInvocation - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns stage. - * - * - * - * @return \Wallee\Sdk\Model\ConnectorInvocationStage - */ - public function getStage() { - return $this->stage; - } - - /** - * Sets stage. - * - * @param \Wallee\Sdk\Model\ConnectorInvocationStage $stage - * @return ConnectorInvocation - */ - public function setStage($stage) { - $this->stage = $stage; - - return $this; - } - - /** - * Returns timeTookInMilliseconds. - * - * - * - * @return int - */ - public function getTimeTookInMilliseconds() { - return $this->timeTookInMilliseconds; - } - - /** - * Sets timeTookInMilliseconds. - * - * @param int $timeTookInMilliseconds - * @return ConnectorInvocation - */ - protected function setTimeTookInMilliseconds($timeTookInMilliseconds) { - $this->timeTookInMilliseconds = $timeTookInMilliseconds; - - return $this; - } - - /** - * Returns transaction. - * - * - * - * @return int - */ - public function getTransaction() { - return $this->transaction; - } - - /** - * Sets transaction. - * - * @param int $transaction - * @return ConnectorInvocation - */ - protected function setTransaction($transaction) { - $this->transaction = $transaction; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return ConnectorInvocation - */ - protected function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class ConnectorInvocation extends TransactionAwareEntity +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ConnectorInvocation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'created_on' => '\DateTime', + 'planned_purge_date' => '\DateTime', + 'stage' => '\Wallee\Sdk\Model\ConnectorInvocationStage', + 'time_took_in_milliseconds' => 'int', + 'transaction' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'created_on' => 'date-time', + 'planned_purge_date' => 'date-time', + 'stage' => null, + 'time_took_in_milliseconds' => 'int64', + 'transaction' => 'int64', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'created_on' => 'createdOn', + 'planned_purge_date' => 'plannedPurgeDate', + 'stage' => 'stage', + 'time_took_in_milliseconds' => 'timeTookInMilliseconds', + 'transaction' => 'transaction', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'created_on' => 'setCreatedOn', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'stage' => 'setStage', + 'time_took_in_milliseconds' => 'setTimeTookInMilliseconds', + 'transaction' => 'setTransaction', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'created_on' => 'getCreatedOn', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'stage' => 'getStage', + 'time_took_in_milliseconds' => 'getTimeTookInMilliseconds', + 'transaction' => 'getTransaction', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['stage'] = isset($data['stage']) ? $data['stage'] : null; + + $this->container['time_took_in_milliseconds'] = isset($data['time_took_in_milliseconds']) ? $data['time_took_in_milliseconds'] : null; + + $this->container['transaction'] = isset($data['transaction']) ? $data['transaction'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets stage + * + * @return \Wallee\Sdk\Model\ConnectorInvocationStage + */ + public function getStage() + { + return $this->container['stage']; + } + + /** + * Sets stage + * + * @param \Wallee\Sdk\Model\ConnectorInvocationStage $stage + * + * @return $this + */ + public function setStage($stage) + { + $this->container['stage'] = $stage; + + return $this; + } + + + /** + * Gets time_took_in_milliseconds + * + * @return int + */ + public function getTimeTookInMilliseconds() + { + return $this->container['time_took_in_milliseconds']; + } + + /** + * Sets time_took_in_milliseconds + * + * @param int $time_took_in_milliseconds + * + * @return $this + */ + public function setTimeTookInMilliseconds($time_took_in_milliseconds) + { + $this->container['time_took_in_milliseconds'] = $time_took_in_milliseconds; + + return $this; + } + + + /** + * Gets transaction + * + * @return int + */ + public function getTransaction() + { + return $this->container['transaction']; + } + + /** + * Sets transaction + * + * @param int $transaction + * + * @return $this + */ + public function setTransaction($transaction) + { + $this->container['transaction'] = $transaction; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/ConnectorInvocationStage.php b/wallee-sdk/lib/Model/ConnectorInvocationStage.php index 15efa84..4e49494 100644 --- a/wallee-sdk/lib/Model/ConnectorInvocationStage.php +++ b/wallee-sdk/lib/Model/ConnectorInvocationStage.php @@ -1,10 +1,8 @@ '\DateTime', + 'customer_id' => 'string', + 'email_address' => 'string', + 'family_name' => 'string', + 'given_name' => 'string', + 'id' => 'int', + 'language' => 'string', + 'linked_space_id' => 'int', + 'meta_data' => 'map[string,string]', + 'preferred_currency' => 'string', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'created_on' => 'date-time', + 'customer_id' => null, + 'email_address' => null, + 'family_name' => null, + 'given_name' => null, + 'id' => 'int64', + 'language' => null, + 'linked_space_id' => 'int64', + 'meta_data' => null, + 'preferred_currency' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'created_on' => 'createdOn', + 'customer_id' => 'customerId', + 'email_address' => 'emailAddress', + 'family_name' => 'familyName', + 'given_name' => 'givenName', + 'id' => 'id', + 'language' => 'language', + 'linked_space_id' => 'linkedSpaceId', + 'meta_data' => 'metaData', + 'preferred_currency' => 'preferredCurrency', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'created_on' => 'setCreatedOn', + 'customer_id' => 'setCustomerId', + 'email_address' => 'setEmailAddress', + 'family_name' => 'setFamilyName', + 'given_name' => 'setGivenName', + 'id' => 'setId', + 'language' => 'setLanguage', + 'linked_space_id' => 'setLinkedSpaceId', + 'meta_data' => 'setMetaData', + 'preferred_currency' => 'setPreferredCurrency', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'created_on' => 'getCreatedOn', + 'customer_id' => 'getCustomerId', + 'email_address' => 'getEmailAddress', + 'family_name' => 'getFamilyName', + 'given_name' => 'getGivenName', + 'id' => 'getId', + 'language' => 'getLanguage', + 'linked_space_id' => 'getLinkedSpaceId', + 'meta_data' => 'getMetaData', + 'preferred_currency' => 'getPreferredCurrency', + 'version' => 'getVersion' + ]; + + + + /** + * 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['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['customer_id'] = isset($data['customer_id']) ? $data['customer_id'] : null; + + $this->container['email_address'] = isset($data['email_address']) ? $data['email_address'] : null; + + $this->container['family_name'] = isset($data['family_name']) ? $data['family_name'] : null; + + $this->container['given_name'] = isset($data['given_name']) ? $data['given_name'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['meta_data'] = isset($data['meta_data']) ? $data['meta_data'] : null; + + $this->container['preferred_currency'] = isset($data['preferred_currency']) ? $data['preferred_currency'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets customer_id + * + * @return string + */ + public function getCustomerId() + { + return $this->container['customer_id']; + } + + /** + * Sets customer_id + * + * @param string $customer_id + * + * @return $this + */ + public function setCustomerId($customer_id) + { + $this->container['customer_id'] = $customer_id; + + return $this; + } + + + /** + * Gets email_address + * + * @return string + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string $email_address + * + * @return $this + */ + public function setEmailAddress($email_address) + { + $this->container['email_address'] = $email_address; + + return $this; + } + + + /** + * Gets family_name + * + * @return string + */ + public function getFamilyName() + { + return $this->container['family_name']; + } + + /** + * Sets family_name + * + * @param string $family_name + * + * @return $this + */ + public function setFamilyName($family_name) + { + $this->container['family_name'] = $family_name; + + return $this; + } + + + /** + * Gets given_name + * + * @return string + */ + public function getGivenName() + { + return $this->container['given_name']; + } + + /** + * Sets given_name + * + * @param string $given_name + * + * @return $this + */ + public function setGivenName($given_name) + { + $this->container['given_name'] = $given_name; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets meta_data + * + * @return map[string,string] + */ + public function getMetaData() + { + return $this->container['meta_data']; + } + + /** + * Sets meta_data + * + * @param map[string,string] $meta_data Meta data allow to store additional data along the object. + * + * @return $this + */ + public function setMetaData($meta_data) + { + $this->container['meta_data'] = $meta_data; + + return $this; + } + + + /** + * Gets preferred_currency + * + * @return string + */ + public function getPreferredCurrency() + { + return $this->container['preferred_currency']; + } + + /** + * Sets preferred_currency + * + * @param string $preferred_currency + * + * @return $this + */ + public function setPreferredCurrency($preferred_currency) + { + $this->container['preferred_currency'] = $preferred_currency; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/CustomerActive.php b/wallee-sdk/lib/Model/CustomerActive.php new file mode 100644 index 0000000..5db89b6 --- /dev/null +++ b/wallee-sdk/lib/Model/CustomerActive.php @@ -0,0 +1,330 @@ + 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/CustomerAddress.php b/wallee-sdk/lib/Model/CustomerAddress.php new file mode 100644 index 0000000..dd8f1cb --- /dev/null +++ b/wallee-sdk/lib/Model/CustomerAddress.php @@ -0,0 +1,522 @@ + '\Wallee\Sdk\Model\CustomerPostalAddress', + 'address_type' => '\Wallee\Sdk\Model\CustomerAddressType', + 'created_on' => '\DateTime', + 'customer' => '\Wallee\Sdk\Model\Customer', + 'default_address' => 'bool', + 'id' => 'int', + 'linked_space_id' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'address' => null, + 'address_type' => null, + 'created_on' => 'date-time', + 'customer' => null, + 'default_address' => null, + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'address_type' => 'addressType', + 'created_on' => 'createdOn', + 'customer' => 'customer', + 'default_address' => 'defaultAddress', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'address_type' => 'setAddressType', + 'created_on' => 'setCreatedOn', + 'customer' => 'setCustomer', + 'default_address' => 'setDefaultAddress', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'address_type' => 'getAddressType', + 'created_on' => 'getCreatedOn', + 'customer' => 'getCustomer', + 'default_address' => 'getDefaultAddress', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'version' => 'getVersion' + ]; + + + + /** + * 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['address'] = isset($data['address']) ? $data['address'] : null; + + $this->container['address_type'] = isset($data['address_type']) ? $data['address_type'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['customer'] = isset($data['customer']) ? $data['customer'] : null; + + $this->container['default_address'] = isset($data['default_address']) ? $data['default_address'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets address + * + * @return \Wallee\Sdk\Model\CustomerPostalAddress + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Wallee\Sdk\Model\CustomerPostalAddress $address + * + * @return $this + */ + public function setAddress($address) + { + $this->container['address'] = $address; + + return $this; + } + + + /** + * Gets address_type + * + * @return \Wallee\Sdk\Model\CustomerAddressType + */ + public function getAddressType() + { + return $this->container['address_type']; + } + + /** + * Sets address_type + * + * @param \Wallee\Sdk\Model\CustomerAddressType $address_type + * + * @return $this + */ + public function setAddressType($address_type) + { + $this->container['address_type'] = $address_type; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets customer + * + * @return \Wallee\Sdk\Model\Customer + */ + public function getCustomer() + { + return $this->container['customer']; + } + + /** + * Sets customer + * + * @param \Wallee\Sdk\Model\Customer $customer + * + * @return $this + */ + public function setCustomer($customer) + { + $this->container['customer'] = $customer; + + return $this; + } + + + /** + * Gets default_address + * + * @return bool + */ + public function getDefaultAddress() + { + return $this->container['default_address']; + } + + /** + * Sets default_address + * + * @param bool $default_address + * + * @return $this + */ + public function setDefaultAddress($default_address) + { + $this->container['default_address'] = $default_address; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/CustomerAddressActive.php b/wallee-sdk/lib/Model/CustomerAddressActive.php new file mode 100644 index 0000000..106395a --- /dev/null +++ b/wallee-sdk/lib/Model/CustomerAddressActive.php @@ -0,0 +1,330 @@ + 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/CustomerAddressCreate.php b/wallee-sdk/lib/Model/CustomerAddressCreate.php new file mode 100644 index 0000000..b3b2af4 --- /dev/null +++ b/wallee-sdk/lib/Model/CustomerAddressCreate.php @@ -0,0 +1,295 @@ + 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'customer' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'customer' => 'customer' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'customer' => 'setCustomer' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'customer' => 'getCustomer' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['customer'] = isset($data['customer']) ? $data['customer'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['customer'] === null) { + $invalidProperties[] = "'customer' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 customer + * + * @return int + */ + public function getCustomer() + { + return $this->container['customer']; + } + + /** + * Sets customer + * + * @param int $customer + * + * @return $this + */ + public function setCustomer($customer) + { + $this->container['customer'] = $customer; + + 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/wallee-sdk/lib/Model/TokenizationnMode.php b/wallee-sdk/lib/Model/CustomerAddressType.php similarity index 57% rename from wallee-sdk/lib/Model/TokenizationnMode.php rename to wallee-sdk/lib/Model/CustomerAddressType.php index d189a71..f0589f6 100644 --- a/wallee-sdk/lib/Model/TokenizationnMode.php +++ b/wallee-sdk/lib/Model/CustomerAddressType.php @@ -1,10 +1,8 @@ 'string', + 'created_by' => 'int', + 'created_on' => '\DateTime', + 'customer' => 'int', + 'edited_by' => 'int', + 'edited_on' => '\DateTime', + 'id' => 'int', + 'linked_space_id' => 'int', + 'pinned' => 'bool', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'content' => null, + 'created_by' => 'int64', + 'created_on' => 'date-time', + 'customer' => 'int64', + 'edited_by' => 'int64', + 'edited_on' => 'date-time', + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'pinned' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'content' => 'content', + 'created_by' => 'createdBy', + 'created_on' => 'createdOn', + 'customer' => 'customer', + 'edited_by' => 'editedBy', + 'edited_on' => 'editedOn', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'pinned' => 'pinned', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent', + 'created_by' => 'setCreatedBy', + 'created_on' => 'setCreatedOn', + 'customer' => 'setCustomer', + 'edited_by' => 'setEditedBy', + 'edited_on' => 'setEditedOn', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'pinned' => 'setPinned', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent', + 'created_by' => 'getCreatedBy', + 'created_on' => 'getCreatedOn', + 'customer' => 'getCustomer', + 'edited_by' => 'getEditedBy', + 'edited_on' => 'getEditedOn', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'pinned' => 'getPinned', + 'version' => 'getVersion' + ]; + + + + /** + * 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['created_by'] = isset($data['created_by']) ? $data['created_by'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['customer'] = isset($data['customer']) ? $data['customer'] : null; + + $this->container['edited_by'] = isset($data['edited_by']) ? $data['edited_by'] : null; + + $this->container['edited_on'] = isset($data['edited_on']) ? $data['edited_on'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['pinned'] = isset($data['pinned']) ? $data['pinned'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content + * + * @return $this + */ + public function setContent($content) + { + $this->container['content'] = $content; + + return $this; + } + + + /** + * Gets created_by + * + * @return int + */ + public function getCreatedBy() + { + return $this->container['created_by']; + } + + /** + * Sets created_by + * + * @param int $created_by + * + * @return $this + */ + public function setCreatedBy($created_by) + { + $this->container['created_by'] = $created_by; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets customer + * + * @return int + */ + public function getCustomer() + { + return $this->container['customer']; + } + + /** + * Sets customer + * + * @param int $customer + * + * @return $this + */ + public function setCustomer($customer) + { + $this->container['customer'] = $customer; + + return $this; + } + + + /** + * Gets edited_by + * + * @return int + */ + public function getEditedBy() + { + return $this->container['edited_by']; + } + + /** + * Sets edited_by + * + * @param int $edited_by + * + * @return $this + */ + public function setEditedBy($edited_by) + { + $this->container['edited_by'] = $edited_by; + + return $this; + } + + + /** + * Gets edited_on + * + * @return \DateTime + */ + public function getEditedOn() + { + return $this->container['edited_on']; + } + + /** + * Sets edited_on + * + * @param \DateTime $edited_on The date on which the comment was last edited. + * + * @return $this + */ + public function setEditedOn($edited_on) + { + $this->container['edited_on'] = $edited_on; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets pinned + * + * @return bool + */ + public function getPinned() + { + return $this->container['pinned']; + } + + /** + * Sets pinned + * + * @param bool $pinned + * + * @return $this + */ + public function setPinned($pinned) + { + $this->container['pinned'] = $pinned; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/CustomerCommentActive.php b/wallee-sdk/lib/Model/CustomerCommentActive.php new file mode 100644 index 0000000..13f4b1b --- /dev/null +++ b/wallee-sdk/lib/Model/CustomerCommentActive.php @@ -0,0 +1,330 @@ + 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/CustomerCommentCreate.php b/wallee-sdk/lib/Model/CustomerCommentCreate.php new file mode 100644 index 0000000..7e8a2c6 --- /dev/null +++ b/wallee-sdk/lib/Model/CustomerCommentCreate.php @@ -0,0 +1,295 @@ + 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'customer' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'customer' => 'customer' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'customer' => 'setCustomer' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'customer' => 'getCustomer' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['customer'] = isset($data['customer']) ? $data['customer'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['customer'] === null) { + $invalidProperties[] = "'customer' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 customer + * + * @return int + */ + public function getCustomer() + { + return $this->container['customer']; + } + + /** + * Sets customer + * + * @param int $customer + * + * @return $this + */ + public function setCustomer($customer) + { + $this->container['customer'] = $customer; + + 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/wallee-sdk/lib/Model/CustomerCreate.php b/wallee-sdk/lib/Model/CustomerCreate.php new file mode 100644 index 0000000..084a97c --- /dev/null +++ b/wallee-sdk/lib/Model/CustomerCreate.php @@ -0,0 +1,265 @@ +listInvalidProperties()) === 0; + } + + + /** + * 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/wallee-sdk/lib/Model/CustomerPostalAddress.php b/wallee-sdk/lib/Model/CustomerPostalAddress.php new file mode 100644 index 0000000..47b4d10 --- /dev/null +++ b/wallee-sdk/lib/Model/CustomerPostalAddress.php @@ -0,0 +1,906 @@ + 'string', + 'commercial_register_number' => 'string', + 'country' => 'string', + 'date_of_birth' => '\DateTime', + 'dependent_locality' => 'string', + 'email_address' => 'string', + 'family_name' => 'string', + 'gender' => '\Wallee\Sdk\Model\Gender', + 'given_name' => 'string', + 'legal_organization_form' => '\Wallee\Sdk\Model\LegalOrganizationForm', + 'mobile_phone_number' => 'string', + 'organization_name' => 'string', + 'phone_number' => 'string', + 'post_code' => 'string', + 'postal_state' => 'string', + 'sales_tax_number' => 'string', + 'salutation' => 'string', + 'social_security_number' => 'string', + 'sorting_code' => 'string', + 'street' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'city' => null, + 'commercial_register_number' => null, + 'country' => null, + 'date_of_birth' => 'date', + 'dependent_locality' => null, + 'email_address' => null, + 'family_name' => null, + 'gender' => null, + 'given_name' => null, + 'legal_organization_form' => null, + 'mobile_phone_number' => null, + 'organization_name' => null, + 'phone_number' => null, + 'post_code' => null, + 'postal_state' => null, + 'sales_tax_number' => null, + 'salutation' => null, + 'social_security_number' => null, + 'sorting_code' => null, + 'street' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'commercial_register_number' => 'commercialRegisterNumber', + 'country' => 'country', + 'date_of_birth' => 'dateOfBirth', + 'dependent_locality' => 'dependentLocality', + 'email_address' => 'emailAddress', + 'family_name' => 'familyName', + 'gender' => 'gender', + 'given_name' => 'givenName', + 'legal_organization_form' => 'legalOrganizationForm', + 'mobile_phone_number' => 'mobilePhoneNumber', + 'organization_name' => 'organizationName', + 'phone_number' => 'phoneNumber', + 'post_code' => 'postCode', + 'postal_state' => 'postalState', + 'sales_tax_number' => 'salesTaxNumber', + 'salutation' => 'salutation', + 'social_security_number' => 'socialSecurityNumber', + 'sorting_code' => 'sortingCode', + 'street' => 'street' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'commercial_register_number' => 'setCommercialRegisterNumber', + 'country' => 'setCountry', + 'date_of_birth' => 'setDateOfBirth', + 'dependent_locality' => 'setDependentLocality', + 'email_address' => 'setEmailAddress', + 'family_name' => 'setFamilyName', + 'gender' => 'setGender', + 'given_name' => 'setGivenName', + 'legal_organization_form' => 'setLegalOrganizationForm', + 'mobile_phone_number' => 'setMobilePhoneNumber', + 'organization_name' => 'setOrganizationName', + 'phone_number' => 'setPhoneNumber', + 'post_code' => 'setPostCode', + 'postal_state' => 'setPostalState', + 'sales_tax_number' => 'setSalesTaxNumber', + 'salutation' => 'setSalutation', + 'social_security_number' => 'setSocialSecurityNumber', + 'sorting_code' => 'setSortingCode', + 'street' => 'setStreet' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'commercial_register_number' => 'getCommercialRegisterNumber', + 'country' => 'getCountry', + 'date_of_birth' => 'getDateOfBirth', + 'dependent_locality' => 'getDependentLocality', + 'email_address' => 'getEmailAddress', + 'family_name' => 'getFamilyName', + 'gender' => 'getGender', + 'given_name' => 'getGivenName', + 'legal_organization_form' => 'getLegalOrganizationForm', + 'mobile_phone_number' => 'getMobilePhoneNumber', + 'organization_name' => 'getOrganizationName', + 'phone_number' => 'getPhoneNumber', + 'post_code' => 'getPostCode', + 'postal_state' => 'getPostalState', + 'sales_tax_number' => 'getSalesTaxNumber', + 'salutation' => 'getSalutation', + 'social_security_number' => 'getSocialSecurityNumber', + 'sorting_code' => 'getSortingCode', + 'street' => 'getStreet' + ]; + + + + /** + * 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['city'] = isset($data['city']) ? $data['city'] : null; + + $this->container['commercial_register_number'] = isset($data['commercial_register_number']) ? $data['commercial_register_number'] : null; + + $this->container['country'] = isset($data['country']) ? $data['country'] : null; + + $this->container['date_of_birth'] = isset($data['date_of_birth']) ? $data['date_of_birth'] : null; + + $this->container['dependent_locality'] = isset($data['dependent_locality']) ? $data['dependent_locality'] : null; + + $this->container['email_address'] = isset($data['email_address']) ? $data['email_address'] : null; + + $this->container['family_name'] = isset($data['family_name']) ? $data['family_name'] : null; + + $this->container['gender'] = isset($data['gender']) ? $data['gender'] : null; + + $this->container['given_name'] = isset($data['given_name']) ? $data['given_name'] : null; + + $this->container['legal_organization_form'] = isset($data['legal_organization_form']) ? $data['legal_organization_form'] : null; + + $this->container['mobile_phone_number'] = isset($data['mobile_phone_number']) ? $data['mobile_phone_number'] : null; + + $this->container['organization_name'] = isset($data['organization_name']) ? $data['organization_name'] : null; + + $this->container['phone_number'] = isset($data['phone_number']) ? $data['phone_number'] : null; + + $this->container['post_code'] = isset($data['post_code']) ? $data['post_code'] : null; + + $this->container['postal_state'] = isset($data['postal_state']) ? $data['postal_state'] : null; + + $this->container['sales_tax_number'] = isset($data['sales_tax_number']) ? $data['sales_tax_number'] : null; + + $this->container['salutation'] = isset($data['salutation']) ? $data['salutation'] : null; + + $this->container['social_security_number'] = isset($data['social_security_number']) ? $data['social_security_number'] : null; + + $this->container['sorting_code'] = isset($data['sorting_code']) ? $data['sorting_code'] : null; + + $this->container['street'] = isset($data['street']) ? $data['street'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 city + * + * @return string + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string $city + * + * @return $this + */ + public function setCity($city) + { + $this->container['city'] = $city; + + return $this; + } + + + /** + * Gets commercial_register_number + * + * @return string + */ + public function getCommercialRegisterNumber() + { + return $this->container['commercial_register_number']; + } + + /** + * Sets commercial_register_number + * + * @param string $commercial_register_number + * + * @return $this + */ + public function setCommercialRegisterNumber($commercial_register_number) + { + $this->container['commercial_register_number'] = $commercial_register_number; + + return $this; + } + + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country + * + * @return $this + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + + + /** + * Gets date_of_birth + * + * @return \DateTime + */ + public function getDateOfBirth() + { + return $this->container['date_of_birth']; + } + + /** + * Sets date_of_birth + * + * @param \DateTime $date_of_birth + * + * @return $this + */ + public function setDateOfBirth($date_of_birth) + { + $this->container['date_of_birth'] = $date_of_birth; + + return $this; + } + + + /** + * Gets dependent_locality + * + * @return string + */ + public function getDependentLocality() + { + return $this->container['dependent_locality']; + } + + /** + * Sets dependent_locality + * + * @param string $dependent_locality + * + * @return $this + */ + public function setDependentLocality($dependent_locality) + { + $this->container['dependent_locality'] = $dependent_locality; + + return $this; + } + + + /** + * Gets email_address + * + * @return string + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string $email_address + * + * @return $this + */ + public function setEmailAddress($email_address) + { + $this->container['email_address'] = $email_address; + + return $this; + } + + + /** + * Gets family_name + * + * @return string + */ + public function getFamilyName() + { + return $this->container['family_name']; + } + + /** + * Sets family_name + * + * @param string $family_name + * + * @return $this + */ + public function setFamilyName($family_name) + { + $this->container['family_name'] = $family_name; + + return $this; + } + + + /** + * Gets gender + * + * @return \Wallee\Sdk\Model\Gender + */ + public function getGender() + { + return $this->container['gender']; + } + + /** + * Sets gender + * + * @param \Wallee\Sdk\Model\Gender $gender + * + * @return $this + */ + public function setGender($gender) + { + $this->container['gender'] = $gender; + + return $this; + } + + + /** + * Gets given_name + * + * @return string + */ + public function getGivenName() + { + return $this->container['given_name']; + } + + /** + * Sets given_name + * + * @param string $given_name + * + * @return $this + */ + public function setGivenName($given_name) + { + $this->container['given_name'] = $given_name; + + return $this; + } + + + /** + * Gets legal_organization_form + * + * @return \Wallee\Sdk\Model\LegalOrganizationForm + */ + public function getLegalOrganizationForm() + { + return $this->container['legal_organization_form']; + } + + /** + * Sets legal_organization_form + * + * @param \Wallee\Sdk\Model\LegalOrganizationForm $legal_organization_form + * + * @return $this + */ + public function setLegalOrganizationForm($legal_organization_form) + { + $this->container['legal_organization_form'] = $legal_organization_form; + + return $this; + } + + + /** + * Gets mobile_phone_number + * + * @return string + */ + public function getMobilePhoneNumber() + { + return $this->container['mobile_phone_number']; + } + + /** + * Sets mobile_phone_number + * + * @param string $mobile_phone_number + * + * @return $this + */ + public function setMobilePhoneNumber($mobile_phone_number) + { + $this->container['mobile_phone_number'] = $mobile_phone_number; + + return $this; + } + + + /** + * Gets organization_name + * + * @return string + */ + public function getOrganizationName() + { + return $this->container['organization_name']; + } + + /** + * Sets organization_name + * + * @param string $organization_name + * + * @return $this + */ + public function setOrganizationName($organization_name) + { + $this->container['organization_name'] = $organization_name; + + return $this; + } + + + /** + * Gets phone_number + * + * @return string + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string $phone_number + * + * @return $this + */ + public function setPhoneNumber($phone_number) + { + $this->container['phone_number'] = $phone_number; + + return $this; + } + + + /** + * Gets post_code + * + * @return string + */ + public function getPostCode() + { + return $this->container['post_code']; + } + + /** + * Sets post_code + * + * @param string $post_code + * + * @return $this + */ + public function setPostCode($post_code) + { + $this->container['post_code'] = $post_code; + + return $this; + } + + + /** + * Gets postal_state + * + * @return string + */ + public function getPostalState() + { + return $this->container['postal_state']; + } + + /** + * Sets postal_state + * + * @param string $postal_state + * + * @return $this + */ + public function setPostalState($postal_state) + { + $this->container['postal_state'] = $postal_state; + + return $this; + } + + + /** + * Gets sales_tax_number + * + * @return string + */ + public function getSalesTaxNumber() + { + return $this->container['sales_tax_number']; + } + + /** + * Sets sales_tax_number + * + * @param string $sales_tax_number + * + * @return $this + */ + public function setSalesTaxNumber($sales_tax_number) + { + $this->container['sales_tax_number'] = $sales_tax_number; + + return $this; + } + + + /** + * Gets salutation + * + * @return string + */ + public function getSalutation() + { + return $this->container['salutation']; + } + + /** + * Sets salutation + * + * @param string $salutation + * + * @return $this + */ + public function setSalutation($salutation) + { + $this->container['salutation'] = $salutation; + + return $this; + } + + + /** + * Gets social_security_number + * + * @return string + */ + public function getSocialSecurityNumber() + { + return $this->container['social_security_number']; + } + + /** + * Sets social_security_number + * + * @param string $social_security_number + * + * @return $this + */ + public function setSocialSecurityNumber($social_security_number) + { + $this->container['social_security_number'] = $social_security_number; + + return $this; + } + + + /** + * Gets sorting_code + * + * @return string + */ + public function getSortingCode() + { + return $this->container['sorting_code']; + } + + /** + * Sets sorting_code + * + * @param string $sorting_code The sorting code identifies the post office at which the post box is located in. + * + * @return $this + */ + public function setSortingCode($sorting_code) + { + $this->container['sorting_code'] = $sorting_code; + + return $this; + } + + + /** + * Gets street + * + * @return string + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string $street + * + * @return $this + */ + public function setStreet($street) + { + $this->container['street'] = $street; + + 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/wallee-sdk/lib/Model/CustomerPostalAddressCreate.php b/wallee-sdk/lib/Model/CustomerPostalAddressCreate.php new file mode 100644 index 0000000..13ad22a --- /dev/null +++ b/wallee-sdk/lib/Model/CustomerPostalAddressCreate.php @@ -0,0 +1,906 @@ + 'string', + 'commercial_register_number' => 'string', + 'country' => 'string', + 'date_of_birth' => '\DateTime', + 'dependent_locality' => 'string', + 'email_address' => 'string', + 'family_name' => 'string', + 'gender' => '\Wallee\Sdk\Model\Gender', + 'given_name' => 'string', + 'legal_organization_form' => 'int', + 'mobile_phone_number' => 'string', + 'organization_name' => 'string', + 'phone_number' => 'string', + 'post_code' => 'string', + 'postal_state' => 'string', + 'sales_tax_number' => 'string', + 'salutation' => 'string', + 'social_security_number' => 'string', + 'sorting_code' => 'string', + 'street' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'city' => null, + 'commercial_register_number' => null, + 'country' => null, + 'date_of_birth' => 'date', + 'dependent_locality' => null, + 'email_address' => null, + 'family_name' => null, + 'gender' => null, + 'given_name' => null, + 'legal_organization_form' => 'int64', + 'mobile_phone_number' => null, + 'organization_name' => null, + 'phone_number' => null, + 'post_code' => null, + 'postal_state' => null, + 'sales_tax_number' => null, + 'salutation' => null, + 'social_security_number' => null, + 'sorting_code' => null, + 'street' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'commercial_register_number' => 'commercialRegisterNumber', + 'country' => 'country', + 'date_of_birth' => 'dateOfBirth', + 'dependent_locality' => 'dependentLocality', + 'email_address' => 'emailAddress', + 'family_name' => 'familyName', + 'gender' => 'gender', + 'given_name' => 'givenName', + 'legal_organization_form' => 'legalOrganizationForm', + 'mobile_phone_number' => 'mobilePhoneNumber', + 'organization_name' => 'organizationName', + 'phone_number' => 'phoneNumber', + 'post_code' => 'postCode', + 'postal_state' => 'postalState', + 'sales_tax_number' => 'salesTaxNumber', + 'salutation' => 'salutation', + 'social_security_number' => 'socialSecurityNumber', + 'sorting_code' => 'sortingCode', + 'street' => 'street' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'commercial_register_number' => 'setCommercialRegisterNumber', + 'country' => 'setCountry', + 'date_of_birth' => 'setDateOfBirth', + 'dependent_locality' => 'setDependentLocality', + 'email_address' => 'setEmailAddress', + 'family_name' => 'setFamilyName', + 'gender' => 'setGender', + 'given_name' => 'setGivenName', + 'legal_organization_form' => 'setLegalOrganizationForm', + 'mobile_phone_number' => 'setMobilePhoneNumber', + 'organization_name' => 'setOrganizationName', + 'phone_number' => 'setPhoneNumber', + 'post_code' => 'setPostCode', + 'postal_state' => 'setPostalState', + 'sales_tax_number' => 'setSalesTaxNumber', + 'salutation' => 'setSalutation', + 'social_security_number' => 'setSocialSecurityNumber', + 'sorting_code' => 'setSortingCode', + 'street' => 'setStreet' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'commercial_register_number' => 'getCommercialRegisterNumber', + 'country' => 'getCountry', + 'date_of_birth' => 'getDateOfBirth', + 'dependent_locality' => 'getDependentLocality', + 'email_address' => 'getEmailAddress', + 'family_name' => 'getFamilyName', + 'gender' => 'getGender', + 'given_name' => 'getGivenName', + 'legal_organization_form' => 'getLegalOrganizationForm', + 'mobile_phone_number' => 'getMobilePhoneNumber', + 'organization_name' => 'getOrganizationName', + 'phone_number' => 'getPhoneNumber', + 'post_code' => 'getPostCode', + 'postal_state' => 'getPostalState', + 'sales_tax_number' => 'getSalesTaxNumber', + 'salutation' => 'getSalutation', + 'social_security_number' => 'getSocialSecurityNumber', + 'sorting_code' => 'getSortingCode', + 'street' => 'getStreet' + ]; + + + + /** + * 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['city'] = isset($data['city']) ? $data['city'] : null; + + $this->container['commercial_register_number'] = isset($data['commercial_register_number']) ? $data['commercial_register_number'] : null; + + $this->container['country'] = isset($data['country']) ? $data['country'] : null; + + $this->container['date_of_birth'] = isset($data['date_of_birth']) ? $data['date_of_birth'] : null; + + $this->container['dependent_locality'] = isset($data['dependent_locality']) ? $data['dependent_locality'] : null; + + $this->container['email_address'] = isset($data['email_address']) ? $data['email_address'] : null; + + $this->container['family_name'] = isset($data['family_name']) ? $data['family_name'] : null; + + $this->container['gender'] = isset($data['gender']) ? $data['gender'] : null; + + $this->container['given_name'] = isset($data['given_name']) ? $data['given_name'] : null; + + $this->container['legal_organization_form'] = isset($data['legal_organization_form']) ? $data['legal_organization_form'] : null; + + $this->container['mobile_phone_number'] = isset($data['mobile_phone_number']) ? $data['mobile_phone_number'] : null; + + $this->container['organization_name'] = isset($data['organization_name']) ? $data['organization_name'] : null; + + $this->container['phone_number'] = isset($data['phone_number']) ? $data['phone_number'] : null; + + $this->container['post_code'] = isset($data['post_code']) ? $data['post_code'] : null; + + $this->container['postal_state'] = isset($data['postal_state']) ? $data['postal_state'] : null; + + $this->container['sales_tax_number'] = isset($data['sales_tax_number']) ? $data['sales_tax_number'] : null; + + $this->container['salutation'] = isset($data['salutation']) ? $data['salutation'] : null; + + $this->container['social_security_number'] = isset($data['social_security_number']) ? $data['social_security_number'] : null; + + $this->container['sorting_code'] = isset($data['sorting_code']) ? $data['sorting_code'] : null; + + $this->container['street'] = isset($data['street']) ? $data['street'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 city + * + * @return string + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string $city + * + * @return $this + */ + public function setCity($city) + { + $this->container['city'] = $city; + + return $this; + } + + + /** + * Gets commercial_register_number + * + * @return string + */ + public function getCommercialRegisterNumber() + { + return $this->container['commercial_register_number']; + } + + /** + * Sets commercial_register_number + * + * @param string $commercial_register_number + * + * @return $this + */ + public function setCommercialRegisterNumber($commercial_register_number) + { + $this->container['commercial_register_number'] = $commercial_register_number; + + return $this; + } + + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country + * + * @return $this + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + + + /** + * Gets date_of_birth + * + * @return \DateTime + */ + public function getDateOfBirth() + { + return $this->container['date_of_birth']; + } + + /** + * Sets date_of_birth + * + * @param \DateTime $date_of_birth + * + * @return $this + */ + public function setDateOfBirth($date_of_birth) + { + $this->container['date_of_birth'] = $date_of_birth; + + return $this; + } + + + /** + * Gets dependent_locality + * + * @return string + */ + public function getDependentLocality() + { + return $this->container['dependent_locality']; + } + + /** + * Sets dependent_locality + * + * @param string $dependent_locality + * + * @return $this + */ + public function setDependentLocality($dependent_locality) + { + $this->container['dependent_locality'] = $dependent_locality; + + return $this; + } + + + /** + * Gets email_address + * + * @return string + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string $email_address + * + * @return $this + */ + public function setEmailAddress($email_address) + { + $this->container['email_address'] = $email_address; + + return $this; + } + + + /** + * Gets family_name + * + * @return string + */ + public function getFamilyName() + { + return $this->container['family_name']; + } + + /** + * Sets family_name + * + * @param string $family_name + * + * @return $this + */ + public function setFamilyName($family_name) + { + $this->container['family_name'] = $family_name; + + return $this; + } + + + /** + * Gets gender + * + * @return \Wallee\Sdk\Model\Gender + */ + public function getGender() + { + return $this->container['gender']; + } + + /** + * Sets gender + * + * @param \Wallee\Sdk\Model\Gender $gender + * + * @return $this + */ + public function setGender($gender) + { + $this->container['gender'] = $gender; + + return $this; + } + + + /** + * Gets given_name + * + * @return string + */ + public function getGivenName() + { + return $this->container['given_name']; + } + + /** + * Sets given_name + * + * @param string $given_name + * + * @return $this + */ + public function setGivenName($given_name) + { + $this->container['given_name'] = $given_name; + + return $this; + } + + + /** + * Gets legal_organization_form + * + * @return int + */ + public function getLegalOrganizationForm() + { + return $this->container['legal_organization_form']; + } + + /** + * Sets legal_organization_form + * + * @param int $legal_organization_form + * + * @return $this + */ + public function setLegalOrganizationForm($legal_organization_form) + { + $this->container['legal_organization_form'] = $legal_organization_form; + + return $this; + } + + + /** + * Gets mobile_phone_number + * + * @return string + */ + public function getMobilePhoneNumber() + { + return $this->container['mobile_phone_number']; + } + + /** + * Sets mobile_phone_number + * + * @param string $mobile_phone_number + * + * @return $this + */ + public function setMobilePhoneNumber($mobile_phone_number) + { + $this->container['mobile_phone_number'] = $mobile_phone_number; + + return $this; + } + + + /** + * Gets organization_name + * + * @return string + */ + public function getOrganizationName() + { + return $this->container['organization_name']; + } + + /** + * Sets organization_name + * + * @param string $organization_name + * + * @return $this + */ + public function setOrganizationName($organization_name) + { + $this->container['organization_name'] = $organization_name; + + return $this; + } + + + /** + * Gets phone_number + * + * @return string + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string $phone_number + * + * @return $this + */ + public function setPhoneNumber($phone_number) + { + $this->container['phone_number'] = $phone_number; + + return $this; + } + + + /** + * Gets post_code + * + * @return string + */ + public function getPostCode() + { + return $this->container['post_code']; + } + + /** + * Sets post_code + * + * @param string $post_code + * + * @return $this + */ + public function setPostCode($post_code) + { + $this->container['post_code'] = $post_code; + + return $this; + } + + + /** + * Gets postal_state + * + * @return string + */ + public function getPostalState() + { + return $this->container['postal_state']; + } + + /** + * Sets postal_state + * + * @param string $postal_state + * + * @return $this + */ + public function setPostalState($postal_state) + { + $this->container['postal_state'] = $postal_state; + + return $this; + } + + + /** + * Gets sales_tax_number + * + * @return string + */ + public function getSalesTaxNumber() + { + return $this->container['sales_tax_number']; + } + + /** + * Sets sales_tax_number + * + * @param string $sales_tax_number + * + * @return $this + */ + public function setSalesTaxNumber($sales_tax_number) + { + $this->container['sales_tax_number'] = $sales_tax_number; + + return $this; + } + + + /** + * Gets salutation + * + * @return string + */ + public function getSalutation() + { + return $this->container['salutation']; + } + + /** + * Sets salutation + * + * @param string $salutation + * + * @return $this + */ + public function setSalutation($salutation) + { + $this->container['salutation'] = $salutation; + + return $this; + } + + + /** + * Gets social_security_number + * + * @return string + */ + public function getSocialSecurityNumber() + { + return $this->container['social_security_number']; + } + + /** + * Sets social_security_number + * + * @param string $social_security_number + * + * @return $this + */ + public function setSocialSecurityNumber($social_security_number) + { + $this->container['social_security_number'] = $social_security_number; + + return $this; + } + + + /** + * Gets sorting_code + * + * @return string + */ + public function getSortingCode() + { + return $this->container['sorting_code']; + } + + /** + * Sets sorting_code + * + * @param string $sorting_code The sorting code identifies the post office at which the post box is located in. + * + * @return $this + */ + public function setSortingCode($sorting_code) + { + $this->container['sorting_code'] = $sorting_code; + + return $this; + } + + + /** + * Gets street + * + * @return string + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string $street + * + * @return $this + */ + public function setStreet($street) + { + $this->container['street'] = $street; + + 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/wallee-sdk/lib/Model/CustomersPresence.php b/wallee-sdk/lib/Model/CustomersPresence.php index 3fea058..230de41 100644 --- a/wallee-sdk/lib/Model/CustomersPresence.php +++ b/wallee-sdk/lib/Model/CustomersPresence.php @@ -1,10 +1,8 @@ 'string[]', - 'displayName' => 'string', - 'items' => '\Wallee\Sdk\Model\DatabaseTranslatedStringItem[]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var string[] - */ - private $availableLanguages; - - /** - * - * - * @var string - */ - private $displayName; - - /** - * - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedStringItem[] - */ - private $items; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['availableLanguages'])) { - $this->setAvailableLanguages($data['availableLanguages']); - } - if (isset($data['items'])) { - $this->setItems($data['items']); - } - } - - - /** - * Returns availableLanguages. - * - * - * - * @return string[] - */ - public function getAvailableLanguages() { - return $this->availableLanguages; - } - - /** - * Sets availableLanguages. - * - * @param string[] $availableLanguages - * @return DatabaseTranslatedString - */ - public function setAvailableLanguages($availableLanguages) { - $this->availableLanguages = $availableLanguages; - - return $this; - } - - /** - * Returns displayName. - * - * - * - * @return string - */ - public function getDisplayName() { - return $this->displayName; - } - - /** - * Sets displayName. - * - * @param string $displayName - * @return DatabaseTranslatedString - */ - protected function setDisplayName($displayName) { - $this->displayName = $displayName; - - return $this; - } - - /** - * Returns items. - * - * - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedStringItem[] - */ - public function getItems() { - return $this->items; - } - - /** - * Sets items. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedStringItem[] $items - * @return DatabaseTranslatedString - */ - public function setItems($items) { - $this->items = $items; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class DatabaseTranslatedString implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'DatabaseTranslatedString'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'available_languages' => 'string[]', + 'display_name' => 'string', + 'items' => '\Wallee\Sdk\Model\DatabaseTranslatedStringItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'available_languages' => null, + 'display_name' => null, + 'items' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'available_languages' => 'availableLanguages', + 'display_name' => 'displayName', + 'items' => 'items' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'available_languages' => 'setAvailableLanguages', + 'display_name' => 'setDisplayName', + 'items' => 'setItems' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'available_languages' => 'getAvailableLanguages', + 'display_name' => 'getDisplayName', + 'items' => 'getItems' + ]; + + + + /** + * 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['available_languages'] = isset($data['available_languages']) ? $data['available_languages'] : null; + + $this->container['display_name'] = isset($data['display_name']) ? $data['display_name'] : null; + + $this->container['items'] = isset($data['items']) ? $data['items'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 available_languages + * + * @return string[] + */ + public function getAvailableLanguages() + { + return $this->container['available_languages']; + } + + /** + * Sets available_languages + * + * @param string[] $available_languages + * + * @return $this + */ + public function setAvailableLanguages($available_languages) + { + $this->container['available_languages'] = $available_languages; + + return $this; + } + + + /** + * Gets display_name + * + * @return string + */ + public function getDisplayName() + { + return $this->container['display_name']; + } + + /** + * Sets display_name + * + * @param string $display_name + * + * @return $this + */ + public function setDisplayName($display_name) + { + $this->container['display_name'] = $display_name; + + return $this; + } + + + /** + * Gets items + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedStringItem[] + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedStringItem[] $items + * + * @return $this + */ + public function setItems($items) + { + $this->container['items'] = $items; + + 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/wallee-sdk/lib/Model/DatabaseTranslatedStringCreate.php b/wallee-sdk/lib/Model/DatabaseTranslatedStringCreate.php index 5faa1b6..c2a4074 100644 --- a/wallee-sdk/lib/Model/DatabaseTranslatedStringCreate.php +++ b/wallee-sdk/lib/Model/DatabaseTranslatedStringCreate.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\DatabaseTranslatedStringItemCreate[]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedStringItemCreate[] - */ - private $items; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['items'])) { - $this->setItems($data['items']); - } - } - - - /** - * Returns items. - * - * - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedStringItemCreate[] - */ - public function getItems() { - return $this->items; - } - - /** - * Sets items. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedStringItemCreate[] $items - * @return DatabaseTranslatedStringCreate - */ - public function setItems($items) { - $this->items = $items; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class DatabaseTranslatedStringCreate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'DatabaseTranslatedString.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'items' => '\Wallee\Sdk\Model\DatabaseTranslatedStringItemCreate[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'items' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'items' => 'items' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'items' => 'setItems' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'items' => 'getItems' + ]; + + + + /** + * 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['items'] = isset($data['items']) ? $data['items'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets items + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedStringItemCreate[] + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedStringItemCreate[] $items + * + * @return $this + */ + public function setItems($items) + { + $this->container['items'] = $items; + + 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/wallee-sdk/lib/Model/DatabaseTranslatedStringItem.php b/wallee-sdk/lib/Model/DatabaseTranslatedStringItem.php index 05618de..a34248d 100644 --- a/wallee-sdk/lib/Model/DatabaseTranslatedStringItem.php +++ b/wallee-sdk/lib/Model/DatabaseTranslatedStringItem.php @@ -1,10 +1,8 @@ 'string', - 'languageCode' => 'string', - 'translation' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var string - */ - private $language; - - /** - * - * - * @var string - */ - private $languageCode; - - /** - * - * - * @var string - */ - private $translation; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - } - - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return DatabaseTranslatedStringItem - */ - protected function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns languageCode. - * - * - * - * @return string - */ - public function getLanguageCode() { - return $this->languageCode; - } - - /** - * Sets languageCode. - * - * @param string $languageCode - * @return DatabaseTranslatedStringItem - */ - protected function setLanguageCode($languageCode) { - $this->languageCode = $languageCode; - - return $this; - } - - /** - * Returns translation. - * - * - * - * @return string - */ - public function getTranslation() { - return $this->translation; - } - - /** - * Sets translation. - * - * @param string $translation - * @return DatabaseTranslatedStringItem - */ - protected function setTranslation($translation) { - $this->translation = $translation; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class DatabaseTranslatedStringItem implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'DatabaseTranslatedStringItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'language' => 'string', + 'language_code' => 'string', + 'translation' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'language' => null, + 'language_code' => null, + 'translation' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'language' => 'language', + 'language_code' => 'languageCode', + 'translation' => 'translation' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'language' => 'setLanguage', + 'language_code' => 'setLanguageCode', + 'translation' => 'setTranslation' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'language' => 'getLanguage', + 'language_code' => 'getLanguageCode', + 'translation' => 'getTranslation' + ]; + + + + /** + * 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['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['language_code'] = isset($data['language_code']) ? $data['language_code'] : null; + + $this->container['translation'] = isset($data['translation']) ? $data['translation'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets language_code + * + * @return string + */ + public function getLanguageCode() + { + return $this->container['language_code']; + } + + /** + * Sets language_code + * + * @param string $language_code + * + * @return $this + */ + public function setLanguageCode($language_code) + { + $this->container['language_code'] = $language_code; + + return $this; + } + + + /** + * Gets translation + * + * @return string + */ + public function getTranslation() + { + return $this->container['translation']; + } + + /** + * Sets translation + * + * @param string $translation + * + * @return $this + */ + public function setTranslation($translation) + { + $this->container['translation'] = $translation; + + 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/wallee-sdk/lib/Model/DatabaseTranslatedStringItemCreate.php b/wallee-sdk/lib/Model/DatabaseTranslatedStringItemCreate.php index 709abe9..0d9648b 100644 --- a/wallee-sdk/lib/Model/DatabaseTranslatedStringItemCreate.php +++ b/wallee-sdk/lib/Model/DatabaseTranslatedStringItemCreate.php @@ -1,10 +1,8 @@ 'string', - 'translation' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var string - */ - private $language; - - /** - * - * - * @var string - */ - private $translation; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['language'])) { - $this->setLanguage($data['language']); - } - if (isset($data['translation'])) { - $this->setTranslation($data['translation']); - } - } - - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return DatabaseTranslatedStringItemCreate - */ - public function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns translation. - * - * - * - * @return string - */ - public function getTranslation() { - return $this->translation; - } - - /** - * Sets translation. - * - * @param string $translation - * @return DatabaseTranslatedStringItemCreate - */ - public function setTranslation($translation) { - $this->translation = $translation; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getLanguage() === null) { - throw new ValidationException("'language' can't be null", 'language', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class DatabaseTranslatedStringItemCreate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'DatabaseTranslatedStringItem.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'language' => 'string', + 'translation' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'language' => null, + 'translation' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'language' => 'language', + 'translation' => 'translation' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'language' => 'setLanguage', + 'translation' => 'setTranslation' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'language' => 'getLanguage', + 'translation' => 'getTranslation' + ]; + + + + /** + * 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['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['translation'] = isset($data['translation']) ? $data['translation'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['language'] === null) { + $invalidProperties[] = "'language' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets translation + * + * @return string + */ + public function getTranslation() + { + return $this->container['translation']; + } + + /** + * Sets translation + * + * @param string $translation + * + * @return $this + */ + public function setTranslation($translation) + { + $this->container['translation'] = $translation; + + 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/wallee-sdk/lib/Model/DebtCollectionCase.php b/wallee-sdk/lib/Model/DebtCollectionCase.php index 94eaace..4a34bff 100644 --- a/wallee-sdk/lib/Model/DebtCollectionCase.php +++ b/wallee-sdk/lib/Model/DebtCollectionCase.php @@ -1,10 +1,8 @@ 'float', - 'billingAddress' => '\Wallee\Sdk\Model\Address', - 'closedOn' => '\DateTime', - 'collectorConfiguration' => '\Wallee\Sdk\Model\DebtCollectorConfiguration', - 'contractDate' => '\DateTime', - 'createdOn' => '\DateTime', - 'creator' => 'int', - 'currency' => 'string', - 'dueDate' => '\DateTime', - 'environment' => '\Wallee\Sdk\Model\DebtCollectionEnvironment', - 'externalId' => 'string', - 'failedOn' => '\DateTime', - 'failureReason' => '\Wallee\Sdk\Model\FailureReason', - 'id' => 'int', - 'labels' => '\Wallee\Sdk\Model\Label[]', - 'language' => 'string', - 'lineItems' => '\Wallee\Sdk\Model\LineItem[]', - 'linkedSpaceId' => 'int', - 'nextAttemptOn' => '\DateTime', - 'plannedPurgeDate' => '\DateTime', - 'processingStartedOn' => '\DateTime', - 'processingTimeoutOn' => '\DateTime', - 'reference' => 'string', - 'reviewStartedOn' => '\DateTime', - 'reviewedOn' => '\DateTime', - 'reviewer' => 'int', - 'source' => '\Wallee\Sdk\Model\DebtCollectionCaseSource', - 'sourceEntityId' => 'int', - 'spaceViewId' => 'int', - 'state' => '\Wallee\Sdk\Model\DebtCollectionCaseState', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The amount is the total amount of the not paid items. The amount cannot be change once the case is reviewed. - * - * @var float - */ - private $amount; - - /** - * The billing address of the case identifies the debtor. - * - * @var \Wallee\Sdk\Model\Address - */ - private $billingAddress; - - /** - * The closed on date indicates when the case is closed on. - * - * @var \DateTime - */ - private $closedOn; - - /** - * The collector configuration determines how the debt collection case is processed. - * - * @var \Wallee\Sdk\Model\DebtCollectorConfiguration - */ - private $collectorConfiguration; - - /** - * The contract date is the date on which the contract with the debtor was signed on. - * - * @var \DateTime - */ - private $contractDate; - - /** - * The created on date indicates the date on which the entity was stored into the database. - * - * @var \DateTime - */ - private $createdOn; - - /** - * The creator references the user which has created the debt collection case. - * - * @var int - */ - private $creator; - - /** - * The currency defines the billing currency of the debt collection case. - * - * @var string - */ - private $currency; - - /** - * The due date indicates the date on which the amount receivable was due. This date has to be always in the past. - * - * @var \DateTime - */ - private $dueDate; - - /** - * The environment in which this case will be processed. There must be a debt collector configuration present which supports the chosen environment. - * - * @var \Wallee\Sdk\Model\DebtCollectionEnvironment - */ - private $environment; - - /** - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @var string - */ - private $externalId; - - /** - * The failed on date indicates when the case is failed on. - * - * @var \DateTime - */ - private $failedOn; - - /** - * - * - * @var \Wallee\Sdk\Model\FailureReason - */ - private $failureReason; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var \Wallee\Sdk\Model\Label[] - */ - private $labels; - - /** - * The language indicates the language to be used in the communication with the debtor. - * - * @var string - */ - private $language; - - /** - * The line items of the debt collection case will be shown on documents sent to the debtor and the total of them makes up total amount to collect. - * - * @var \Wallee\Sdk\Model\LineItem[] - */ - private $lineItems; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * - * - * @var \DateTime - */ - private $nextAttemptOn; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * The processing started on date indicates the date on which the processing of the case started on. - * - * @var \DateTime - */ - private $processingStartedOn; - - /** - * - * - * @var \DateTime - */ - private $processingTimeoutOn; - - /** - * The case reference is used in the communication with the debtor. It should be unique and it should be linkable with the source of the debt collection case. - * - * @var string - */ - private $reference; - - /** - * - * - * @var \DateTime - */ - private $reviewStartedOn; - - /** - * The reviewed on date indicates when the review of the case was conducted on. - * - * @var \DateTime - */ - private $reviewedOn; - - /** - * The reviewer references the user which has reviewed the case. - * - * @var int - */ - private $reviewer; - - /** - * The source of the debt collection case indicates the origin of the amount receivable. - * - * @var \Wallee\Sdk\Model\DebtCollectionCaseSource - */ - private $source; - - /** - * The source entity ID points to the object which is the origin of the debt collection case. This ID is only set when the case was triggered by an internal process. - * - * @var int - */ - private $sourceEntityId; - - /** - * - * - * @var int - */ - private $spaceViewId; - - /** - * - * - * @var \Wallee\Sdk\Model\DebtCollectionCaseState - */ - private $state; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['billingAddress'])) { - $this->setBillingAddress($data['billingAddress']); - } - if (isset($data['collectorConfiguration'])) { - $this->setCollectorConfiguration($data['collectorConfiguration']); - } - if (isset($data['environment'])) { - $this->setEnvironment($data['environment']); - } - if (isset($data['failureReason'])) { - $this->setFailureReason($data['failureReason']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['labels'])) { - $this->setLabels($data['labels']); - } - if (isset($data['lineItems'])) { - $this->setLineItems($data['lineItems']); - } - if (isset($data['source'])) { - $this->setSource($data['source']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns amount. - * - * The amount is the total amount of the not paid items. The amount cannot be change once the case is reviewed. - * - * @return float - */ - public function getAmount() { - return $this->amount; - } - - /** - * Sets amount. - * - * @param float $amount - * @return DebtCollectionCase - */ - protected function setAmount($amount) { - $this->amount = $amount; - - return $this; - } - - /** - * Returns billingAddress. - * - * The billing address of the case identifies the debtor. - * - * @return \Wallee\Sdk\Model\Address - */ - public function getBillingAddress() { - return $this->billingAddress; - } - - /** - * Sets billingAddress. - * - * @param \Wallee\Sdk\Model\Address $billingAddress - * @return DebtCollectionCase - */ - public function setBillingAddress($billingAddress) { - $this->billingAddress = $billingAddress; - - return $this; - } - - /** - * Returns closedOn. - * - * The closed on date indicates when the case is closed on. - * - * @return \DateTime - */ - public function getClosedOn() { - return $this->closedOn; - } - - /** - * Sets closedOn. - * - * @param \DateTime $closedOn - * @return DebtCollectionCase - */ - protected function setClosedOn($closedOn) { - $this->closedOn = $closedOn; - - return $this; - } - - /** - * Returns collectorConfiguration. - * - * The collector configuration determines how the debt collection case is processed. - * - * @return \Wallee\Sdk\Model\DebtCollectorConfiguration - */ - public function getCollectorConfiguration() { - return $this->collectorConfiguration; - } - - /** - * Sets collectorConfiguration. - * - * @param \Wallee\Sdk\Model\DebtCollectorConfiguration $collectorConfiguration - * @return DebtCollectionCase - */ - public function setCollectorConfiguration($collectorConfiguration) { - $this->collectorConfiguration = $collectorConfiguration; - - return $this; - } - - /** - * Returns contractDate. - * - * The contract date is the date on which the contract with the debtor was signed on. - * - * @return \DateTime - */ - public function getContractDate() { - return $this->contractDate; - } - - /** - * Sets contractDate. - * - * @param \DateTime $contractDate - * @return DebtCollectionCase - */ - protected function setContractDate($contractDate) { - $this->contractDate = $contractDate; - - return $this; - } - - /** - * Returns createdOn. - * - * The created on date indicates the date on which the entity was stored into the database. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return DebtCollectionCase - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns creator. - * - * The creator references the user which has created the debt collection case. - * - * @return int - */ - public function getCreator() { - return $this->creator; - } - - /** - * Sets creator. - * - * @param int $creator - * @return DebtCollectionCase - */ - protected function setCreator($creator) { - $this->creator = $creator; - - return $this; - } - - /** - * Returns currency. - * - * The currency defines the billing currency of the debt collection case. - * - * @return string - */ - public function getCurrency() { - return $this->currency; - } - - /** - * Sets currency. - * - * @param string $currency - * @return DebtCollectionCase - */ - protected function setCurrency($currency) { - $this->currency = $currency; - - return $this; - } - - /** - * Returns dueDate. - * - * The due date indicates the date on which the amount receivable was due. This date has to be always in the past. - * - * @return \DateTime - */ - public function getDueDate() { - return $this->dueDate; - } - - /** - * Sets dueDate. - * - * @param \DateTime $dueDate - * @return DebtCollectionCase - */ - protected function setDueDate($dueDate) { - $this->dueDate = $dueDate; - - return $this; - } - - /** - * Returns environment. - * - * The environment in which this case will be processed. There must be a debt collector configuration present which supports the chosen environment. - * - * @return \Wallee\Sdk\Model\DebtCollectionEnvironment - */ - public function getEnvironment() { - return $this->environment; - } - - /** - * Sets environment. - * - * @param \Wallee\Sdk\Model\DebtCollectionEnvironment $environment - * @return DebtCollectionCase - */ - public function setEnvironment($environment) { - $this->environment = $environment; - - return $this; - } - - /** - * Returns externalId. - * - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @return string - */ - public function getExternalId() { - return $this->externalId; - } - - /** - * Sets externalId. - * - * @param string $externalId - * @return DebtCollectionCase - */ - protected function setExternalId($externalId) { - $this->externalId = $externalId; - - return $this; - } - - /** - * Returns failedOn. - * - * The failed on date indicates when the case is failed on. - * - * @return \DateTime - */ - public function getFailedOn() { - return $this->failedOn; - } - - /** - * Sets failedOn. - * - * @param \DateTime $failedOn - * @return DebtCollectionCase - */ - protected function setFailedOn($failedOn) { - $this->failedOn = $failedOn; - - return $this; - } - - /** - * Returns failureReason. - * - * - * - * @return \Wallee\Sdk\Model\FailureReason - */ - public function getFailureReason() { - return $this->failureReason; - } - - /** - * Sets failureReason. - * - * @param \Wallee\Sdk\Model\FailureReason $failureReason - * @return DebtCollectionCase - */ - public function setFailureReason($failureReason) { - $this->failureReason = $failureReason; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return DebtCollectionCase - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns labels. - * - * - * - * @return \Wallee\Sdk\Model\Label[] - */ - public function getLabels() { - return $this->labels; - } - - /** - * Sets labels. - * - * @param \Wallee\Sdk\Model\Label[] $labels - * @return DebtCollectionCase - */ - public function setLabels($labels) { - $this->labels = $labels; - - return $this; - } - - /** - * Returns language. - * - * The language indicates the language to be used in the communication with the debtor. - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return DebtCollectionCase - */ - protected function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns lineItems. - * - * The line items of the debt collection case will be shown on documents sent to the debtor and the total of them makes up total amount to collect. - * - * @return \Wallee\Sdk\Model\LineItem[] - */ - public function getLineItems() { - return $this->lineItems; - } - - /** - * Sets lineItems. - * - * @param \Wallee\Sdk\Model\LineItem[] $lineItems - * @return DebtCollectionCase - */ - public function setLineItems($lineItems) { - $this->lineItems = $lineItems; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return DebtCollectionCase - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns nextAttemptOn. - * - * - * - * @return \DateTime - */ - public function getNextAttemptOn() { - return $this->nextAttemptOn; - } - - /** - * Sets nextAttemptOn. - * - * @param \DateTime $nextAttemptOn - * @return DebtCollectionCase - */ - protected function setNextAttemptOn($nextAttemptOn) { - $this->nextAttemptOn = $nextAttemptOn; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return DebtCollectionCase - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns processingStartedOn. - * - * The processing started on date indicates the date on which the processing of the case started on. - * - * @return \DateTime - */ - public function getProcessingStartedOn() { - return $this->processingStartedOn; - } - - /** - * Sets processingStartedOn. - * - * @param \DateTime $processingStartedOn - * @return DebtCollectionCase - */ - protected function setProcessingStartedOn($processingStartedOn) { - $this->processingStartedOn = $processingStartedOn; - - return $this; - } - - /** - * Returns processingTimeoutOn. - * - * - * - * @return \DateTime - */ - public function getProcessingTimeoutOn() { - return $this->processingTimeoutOn; - } - - /** - * Sets processingTimeoutOn. - * - * @param \DateTime $processingTimeoutOn - * @return DebtCollectionCase - */ - protected function setProcessingTimeoutOn($processingTimeoutOn) { - $this->processingTimeoutOn = $processingTimeoutOn; - - return $this; - } - - /** - * Returns reference. - * - * The case reference is used in the communication with the debtor. It should be unique and it should be linkable with the source of the debt collection case. - * - * @return string - */ - public function getReference() { - return $this->reference; - } - - /** - * Sets reference. - * - * @param string $reference - * @return DebtCollectionCase - */ - protected function setReference($reference) { - $this->reference = $reference; - - return $this; - } - - /** - * Returns reviewStartedOn. - * - * - * - * @return \DateTime - */ - public function getReviewStartedOn() { - return $this->reviewStartedOn; - } - - /** - * Sets reviewStartedOn. - * - * @param \DateTime $reviewStartedOn - * @return DebtCollectionCase - */ - protected function setReviewStartedOn($reviewStartedOn) { - $this->reviewStartedOn = $reviewStartedOn; - - return $this; - } - - /** - * Returns reviewedOn. - * - * The reviewed on date indicates when the review of the case was conducted on. - * - * @return \DateTime - */ - public function getReviewedOn() { - return $this->reviewedOn; - } - - /** - * Sets reviewedOn. - * - * @param \DateTime $reviewedOn - * @return DebtCollectionCase - */ - protected function setReviewedOn($reviewedOn) { - $this->reviewedOn = $reviewedOn; - - return $this; - } - - /** - * Returns reviewer. - * - * The reviewer references the user which has reviewed the case. - * - * @return int - */ - public function getReviewer() { - return $this->reviewer; - } - - /** - * Sets reviewer. - * - * @param int $reviewer - * @return DebtCollectionCase - */ - protected function setReviewer($reviewer) { - $this->reviewer = $reviewer; - - return $this; - } - - /** - * Returns source. - * - * The source of the debt collection case indicates the origin of the amount receivable. - * - * @return \Wallee\Sdk\Model\DebtCollectionCaseSource - */ - public function getSource() { - return $this->source; - } - - /** - * Sets source. - * - * @param \Wallee\Sdk\Model\DebtCollectionCaseSource $source - * @return DebtCollectionCase - */ - public function setSource($source) { - $this->source = $source; - - return $this; - } - - /** - * Returns sourceEntityId. - * - * The source entity ID points to the object which is the origin of the debt collection case. This ID is only set when the case was triggered by an internal process. - * - * @return int - */ - public function getSourceEntityId() { - return $this->sourceEntityId; - } - - /** - * Sets sourceEntityId. - * - * @param int $sourceEntityId - * @return DebtCollectionCase - */ - protected function setSourceEntityId($sourceEntityId) { - $this->sourceEntityId = $sourceEntityId; - - return $this; - } - - /** - * Returns spaceViewId. - * - * - * - * @return int - */ - public function getSpaceViewId() { - return $this->spaceViewId; - } - - /** - * Sets spaceViewId. - * - * @param int $spaceViewId - * @return DebtCollectionCase - */ - protected function setSpaceViewId($spaceViewId) { - $this->spaceViewId = $spaceViewId; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\DebtCollectionCaseState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\DebtCollectionCaseState $state - * @return DebtCollectionCase - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return DebtCollectionCase - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class DebtCollectionCase implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'DebtCollectionCase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'amount' => 'float', + 'billing_address' => '\Wallee\Sdk\Model\Address', + 'closed_on' => '\DateTime', + 'collector_configuration' => '\Wallee\Sdk\Model\DebtCollectorConfiguration', + 'contract_date' => '\DateTime', + 'created_on' => '\DateTime', + 'creator' => 'int', + 'currency' => 'string', + 'due_date' => '\DateTime', + 'environment' => '\Wallee\Sdk\Model\DebtCollectionEnvironment', + 'external_id' => 'string', + 'failed_on' => '\DateTime', + 'failure_reason' => '\Wallee\Sdk\Model\FailureReason', + 'id' => 'int', + 'labels' => '\Wallee\Sdk\Model\Label[]', + 'language' => 'string', + 'line_items' => '\Wallee\Sdk\Model\LineItem[]', + 'linked_space_id' => 'int', + 'next_attempt_on' => '\DateTime', + 'planned_purge_date' => '\DateTime', + 'processing_started_on' => '\DateTime', + 'processing_timeout_on' => '\DateTime', + 'reference' => 'string', + 'review_started_on' => '\DateTime', + 'reviewed_on' => '\DateTime', + 'reviewer' => 'int', + 'source' => '\Wallee\Sdk\Model\DebtCollectionCaseSource', + 'source_entity_id' => 'int', + 'space_view_id' => 'int', + 'state' => '\Wallee\Sdk\Model\DebtCollectionCaseState', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'amount' => null, + 'billing_address' => null, + 'closed_on' => 'date-time', + 'collector_configuration' => null, + 'contract_date' => 'date-time', + 'created_on' => 'date-time', + 'creator' => 'int64', + 'currency' => null, + 'due_date' => 'date-time', + 'environment' => null, + 'external_id' => null, + 'failed_on' => 'date-time', + 'failure_reason' => null, + 'id' => 'int64', + 'labels' => null, + 'language' => null, + 'line_items' => null, + 'linked_space_id' => 'int64', + 'next_attempt_on' => 'date-time', + 'planned_purge_date' => 'date-time', + 'processing_started_on' => 'date-time', + 'processing_timeout_on' => 'date-time', + 'reference' => null, + 'review_started_on' => 'date-time', + 'reviewed_on' => 'date-time', + 'reviewer' => 'int64', + 'source' => null, + 'source_entity_id' => 'int64', + 'space_view_id' => 'int64', + 'state' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'billing_address' => 'billingAddress', + 'closed_on' => 'closedOn', + 'collector_configuration' => 'collectorConfiguration', + 'contract_date' => 'contractDate', + 'created_on' => 'createdOn', + 'creator' => 'creator', + 'currency' => 'currency', + 'due_date' => 'dueDate', + 'environment' => 'environment', + 'external_id' => 'externalId', + 'failed_on' => 'failedOn', + 'failure_reason' => 'failureReason', + 'id' => 'id', + 'labels' => 'labels', + 'language' => 'language', + 'line_items' => 'lineItems', + 'linked_space_id' => 'linkedSpaceId', + 'next_attempt_on' => 'nextAttemptOn', + 'planned_purge_date' => 'plannedPurgeDate', + 'processing_started_on' => 'processingStartedOn', + 'processing_timeout_on' => 'processingTimeoutOn', + 'reference' => 'reference', + 'review_started_on' => 'reviewStartedOn', + 'reviewed_on' => 'reviewedOn', + 'reviewer' => 'reviewer', + 'source' => 'source', + 'source_entity_id' => 'sourceEntityId', + 'space_view_id' => 'spaceViewId', + 'state' => 'state', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'billing_address' => 'setBillingAddress', + 'closed_on' => 'setClosedOn', + 'collector_configuration' => 'setCollectorConfiguration', + 'contract_date' => 'setContractDate', + 'created_on' => 'setCreatedOn', + 'creator' => 'setCreator', + 'currency' => 'setCurrency', + 'due_date' => 'setDueDate', + 'environment' => 'setEnvironment', + 'external_id' => 'setExternalId', + 'failed_on' => 'setFailedOn', + 'failure_reason' => 'setFailureReason', + 'id' => 'setId', + 'labels' => 'setLabels', + 'language' => 'setLanguage', + 'line_items' => 'setLineItems', + 'linked_space_id' => 'setLinkedSpaceId', + 'next_attempt_on' => 'setNextAttemptOn', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'processing_started_on' => 'setProcessingStartedOn', + 'processing_timeout_on' => 'setProcessingTimeoutOn', + 'reference' => 'setReference', + 'review_started_on' => 'setReviewStartedOn', + 'reviewed_on' => 'setReviewedOn', + 'reviewer' => 'setReviewer', + 'source' => 'setSource', + 'source_entity_id' => 'setSourceEntityId', + 'space_view_id' => 'setSpaceViewId', + 'state' => 'setState', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'billing_address' => 'getBillingAddress', + 'closed_on' => 'getClosedOn', + 'collector_configuration' => 'getCollectorConfiguration', + 'contract_date' => 'getContractDate', + 'created_on' => 'getCreatedOn', + 'creator' => 'getCreator', + 'currency' => 'getCurrency', + 'due_date' => 'getDueDate', + 'environment' => 'getEnvironment', + 'external_id' => 'getExternalId', + 'failed_on' => 'getFailedOn', + 'failure_reason' => 'getFailureReason', + 'id' => 'getId', + 'labels' => 'getLabels', + 'language' => 'getLanguage', + 'line_items' => 'getLineItems', + 'linked_space_id' => 'getLinkedSpaceId', + 'next_attempt_on' => 'getNextAttemptOn', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'processing_started_on' => 'getProcessingStartedOn', + 'processing_timeout_on' => 'getProcessingTimeoutOn', + 'reference' => 'getReference', + 'review_started_on' => 'getReviewStartedOn', + 'reviewed_on' => 'getReviewedOn', + 'reviewer' => 'getReviewer', + 'source' => 'getSource', + 'source_entity_id' => 'getSourceEntityId', + 'space_view_id' => 'getSpaceViewId', + 'state' => 'getState', + 'version' => 'getVersion' + ]; + + + + /** + * 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['amount'] = isset($data['amount']) ? $data['amount'] : null; + + $this->container['billing_address'] = isset($data['billing_address']) ? $data['billing_address'] : null; + + $this->container['closed_on'] = isset($data['closed_on']) ? $data['closed_on'] : null; + + $this->container['collector_configuration'] = isset($data['collector_configuration']) ? $data['collector_configuration'] : null; + + $this->container['contract_date'] = isset($data['contract_date']) ? $data['contract_date'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['creator'] = isset($data['creator']) ? $data['creator'] : null; + + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + + $this->container['due_date'] = isset($data['due_date']) ? $data['due_date'] : null; + + $this->container['environment'] = isset($data['environment']) ? $data['environment'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['failed_on'] = isset($data['failed_on']) ? $data['failed_on'] : null; + + $this->container['failure_reason'] = isset($data['failure_reason']) ? $data['failure_reason'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['labels'] = isset($data['labels']) ? $data['labels'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['line_items'] = isset($data['line_items']) ? $data['line_items'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['next_attempt_on'] = isset($data['next_attempt_on']) ? $data['next_attempt_on'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['processing_started_on'] = isset($data['processing_started_on']) ? $data['processing_started_on'] : null; + + $this->container['processing_timeout_on'] = isset($data['processing_timeout_on']) ? $data['processing_timeout_on'] : null; + + $this->container['reference'] = isset($data['reference']) ? $data['reference'] : null; + + $this->container['review_started_on'] = isset($data['review_started_on']) ? $data['review_started_on'] : null; + + $this->container['reviewed_on'] = isset($data['reviewed_on']) ? $data['reviewed_on'] : null; + + $this->container['reviewer'] = isset($data['reviewer']) ? $data['reviewer'] : null; + + $this->container['source'] = isset($data['source']) ? $data['source'] : null; + + $this->container['source_entity_id'] = isset($data['source_entity_id']) ? $data['source_entity_id'] : null; + + $this->container['space_view_id'] = isset($data['space_view_id']) ? $data['space_view_id'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 amount + * + * @return float + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param float $amount The amount is the total amount of the not paid items. The amount cannot be change once the case is reviewed. + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + + /** + * Gets billing_address + * + * @return \Wallee\Sdk\Model\Address + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Wallee\Sdk\Model\Address $billing_address The billing address of the case identifies the debtor. + * + * @return $this + */ + public function setBillingAddress($billing_address) + { + $this->container['billing_address'] = $billing_address; + + return $this; + } + + + /** + * Gets closed_on + * + * @return \DateTime + */ + public function getClosedOn() + { + return $this->container['closed_on']; + } + + /** + * Sets closed_on + * + * @param \DateTime $closed_on The closed on date indicates when the case is closed on. + * + * @return $this + */ + public function setClosedOn($closed_on) + { + $this->container['closed_on'] = $closed_on; + + return $this; + } + + + /** + * Gets collector_configuration + * + * @return \Wallee\Sdk\Model\DebtCollectorConfiguration + */ + public function getCollectorConfiguration() + { + return $this->container['collector_configuration']; + } + + /** + * Sets collector_configuration + * + * @param \Wallee\Sdk\Model\DebtCollectorConfiguration $collector_configuration The collector configuration determines how the debt collection case is processed. + * + * @return $this + */ + public function setCollectorConfiguration($collector_configuration) + { + $this->container['collector_configuration'] = $collector_configuration; + + return $this; + } + + + /** + * Gets contract_date + * + * @return \DateTime + */ + public function getContractDate() + { + return $this->container['contract_date']; + } + + /** + * Sets contract_date + * + * @param \DateTime $contract_date The contract date is the date on which the contract with the debtor was signed on. + * + * @return $this + */ + public function setContractDate($contract_date) + { + $this->container['contract_date'] = $contract_date; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets creator + * + * @return int + */ + public function getCreator() + { + return $this->container['creator']; + } + + /** + * Sets creator + * + * @param int $creator The creator references the user which has created the debt collection case. + * + * @return $this + */ + public function setCreator($creator) + { + $this->container['creator'] = $creator; + + return $this; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The currency defines the billing currency of the debt collection case. + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + + /** + * Gets due_date + * + * @return \DateTime + */ + public function getDueDate() + { + return $this->container['due_date']; + } + + /** + * Sets due_date + * + * @param \DateTime $due_date The due date indicates the date on which the amount receivable was due. This date has to be always in the past. + * + * @return $this + */ + public function setDueDate($due_date) + { + $this->container['due_date'] = $due_date; + + return $this; + } + + + /** + * Gets environment + * + * @return \Wallee\Sdk\Model\DebtCollectionEnvironment + */ + public function getEnvironment() + { + return $this->container['environment']; + } + + /** + * Sets environment + * + * @param \Wallee\Sdk\Model\DebtCollectionEnvironment $environment The environment in which this case will be processed. There must be a debt collector configuration present which supports the chosen environment. + * + * @return $this + */ + public function setEnvironment($environment) + { + $this->container['environment'] = $environment; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets failed_on + * + * @return \DateTime + */ + public function getFailedOn() + { + return $this->container['failed_on']; + } + + /** + * Sets failed_on + * + * @param \DateTime $failed_on The failed on date indicates when the case is failed on. + * + * @return $this + */ + public function setFailedOn($failed_on) + { + $this->container['failed_on'] = $failed_on; + + return $this; + } + + + /** + * Gets failure_reason + * + * @return \Wallee\Sdk\Model\FailureReason + */ + public function getFailureReason() + { + return $this->container['failure_reason']; + } + + /** + * Sets failure_reason + * + * @param \Wallee\Sdk\Model\FailureReason $failure_reason + * + * @return $this + */ + public function setFailureReason($failure_reason) + { + $this->container['failure_reason'] = $failure_reason; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets labels + * + * @return \Wallee\Sdk\Model\Label[] + */ + public function getLabels() + { + return $this->container['labels']; + } + + /** + * Sets labels + * + * @param \Wallee\Sdk\Model\Label[] $labels + * + * @return $this + */ + public function setLabels($labels) + { + $this->container['labels'] = $labels; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language The language indicates the language to be used in the communication with the debtor. + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets line_items + * + * @return \Wallee\Sdk\Model\LineItem[] + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Wallee\Sdk\Model\LineItem[] $line_items The line items of the debt collection case will be shown on documents sent to the debtor and the total of them makes up total amount to collect. + * + * @return $this + */ + public function setLineItems($line_items) + { + $this->container['line_items'] = $line_items; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets next_attempt_on + * + * @return \DateTime + */ + public function getNextAttemptOn() + { + return $this->container['next_attempt_on']; + } + + /** + * Sets next_attempt_on + * + * @param \DateTime $next_attempt_on + * + * @return $this + */ + public function setNextAttemptOn($next_attempt_on) + { + $this->container['next_attempt_on'] = $next_attempt_on; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets processing_started_on + * + * @return \DateTime + */ + public function getProcessingStartedOn() + { + return $this->container['processing_started_on']; + } + + /** + * Sets processing_started_on + * + * @param \DateTime $processing_started_on The processing started on date indicates the date on which the processing of the case started on. + * + * @return $this + */ + public function setProcessingStartedOn($processing_started_on) + { + $this->container['processing_started_on'] = $processing_started_on; + + return $this; + } + + + /** + * Gets processing_timeout_on + * + * @return \DateTime + */ + public function getProcessingTimeoutOn() + { + return $this->container['processing_timeout_on']; + } + + /** + * Sets processing_timeout_on + * + * @param \DateTime $processing_timeout_on + * + * @return $this + */ + public function setProcessingTimeoutOn($processing_timeout_on) + { + $this->container['processing_timeout_on'] = $processing_timeout_on; + + return $this; + } + + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference The case reference is used in the communication with the debtor. It should be unique and it should be linkable with the source of the debt collection case. + * + * @return $this + */ + public function setReference($reference) + { + $this->container['reference'] = $reference; + + return $this; + } + + + /** + * Gets review_started_on + * + * @return \DateTime + */ + public function getReviewStartedOn() + { + return $this->container['review_started_on']; + } + + /** + * Sets review_started_on + * + * @param \DateTime $review_started_on + * + * @return $this + */ + public function setReviewStartedOn($review_started_on) + { + $this->container['review_started_on'] = $review_started_on; + + return $this; + } + + + /** + * Gets reviewed_on + * + * @return \DateTime + */ + public function getReviewedOn() + { + return $this->container['reviewed_on']; + } + + /** + * Sets reviewed_on + * + * @param \DateTime $reviewed_on The reviewed on date indicates when the review of the case was conducted on. + * + * @return $this + */ + public function setReviewedOn($reviewed_on) + { + $this->container['reviewed_on'] = $reviewed_on; + + return $this; + } + + + /** + * Gets reviewer + * + * @return int + */ + public function getReviewer() + { + return $this->container['reviewer']; + } + + /** + * Sets reviewer + * + * @param int $reviewer The reviewer references the user which has reviewed the case. + * + * @return $this + */ + public function setReviewer($reviewer) + { + $this->container['reviewer'] = $reviewer; + + return $this; + } + + + /** + * Gets source + * + * @return \Wallee\Sdk\Model\DebtCollectionCaseSource + */ + public function getSource() + { + return $this->container['source']; + } + + /** + * Sets source + * + * @param \Wallee\Sdk\Model\DebtCollectionCaseSource $source The source of the debt collection case indicates the origin of the amount receivable. + * + * @return $this + */ + public function setSource($source) + { + $this->container['source'] = $source; + + return $this; + } + + + /** + * Gets source_entity_id + * + * @return int + */ + public function getSourceEntityId() + { + return $this->container['source_entity_id']; + } + + /** + * Sets source_entity_id + * + * @param int $source_entity_id The source entity ID points to the object which is the origin of the debt collection case. This ID is only set when the case was triggered by an internal process. + * + * @return $this + */ + public function setSourceEntityId($source_entity_id) + { + $this->container['source_entity_id'] = $source_entity_id; + + return $this; + } + + + /** + * Gets space_view_id + * + * @return int + */ + public function getSpaceViewId() + { + return $this->container['space_view_id']; + } + + /** + * Sets space_view_id + * + * @param int $space_view_id + * + * @return $this + */ + public function setSpaceViewId($space_view_id) + { + $this->container['space_view_id'] = $space_view_id; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\DebtCollectionCaseState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\DebtCollectionCaseState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/DebtCollectionCaseCreate.php b/wallee-sdk/lib/Model/DebtCollectionCaseCreate.php index 634a6bc..b7cc843 100644 --- a/wallee-sdk/lib/Model/DebtCollectionCaseCreate.php +++ b/wallee-sdk/lib/Model/DebtCollectionCaseCreate.php @@ -1,10 +1,8 @@ 'int', - 'externalId' => 'string', - 'reference' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * The collector configuration determines how the debt collection case is processed. - * - * @var int - */ - private $collectorConfiguration; - - /** - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @var string - */ - private $externalId; - - /** - * The case reference is used in the communication with the debtor. It should be unique and it should be linkable with the source of the debt collection case. - * - * @var string - */ - private $reference; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['collectorConfiguration'])) { - $this->setCollectorConfiguration($data['collectorConfiguration']); - } - if (isset($data['externalId'])) { - $this->setExternalId($data['externalId']); - } - if (isset($data['reference'])) { - $this->setReference($data['reference']); - } - } - - - /** - * Returns collectorConfiguration. - * - * The collector configuration determines how the debt collection case is processed. - * - * @return int - */ - public function getCollectorConfiguration() { - return $this->collectorConfiguration; - } - - /** - * Sets collectorConfiguration. - * - * @param int $collectorConfiguration - * @return DebtCollectionCaseCreate - */ - public function setCollectorConfiguration($collectorConfiguration) { - $this->collectorConfiguration = $collectorConfiguration; - - return $this; - } - - /** - * Returns externalId. - * - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @return string - */ - public function getExternalId() { - return $this->externalId; - } - - /** - * Sets externalId. - * - * @param string $externalId - * @return DebtCollectionCaseCreate - */ - public function setExternalId($externalId) { - $this->externalId = $externalId; - - return $this; - } - - /** - * Returns reference. - * - * The case reference is used in the communication with the debtor. It should be unique and it should be linkable with the source of the debt collection case. - * - * @return string - */ - public function getReference() { - return $this->reference; - } - - /** - * Sets reference. - * - * @param string $reference - * @return DebtCollectionCaseCreate - */ - public function setReference($reference) { - $this->reference = $reference; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - if ($this->getExternalId() === null) { - throw new ValidationException("'externalId' can't be null", 'externalId', $this); - } - if ($this->getReference() === null) { - throw new ValidationException("'reference' can't be null", 'reference', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class DebtCollectionCaseCreate extends AbstractDebtCollectionCaseUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'DebtCollectionCase.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'collector_configuration' => 'int', + 'external_id' => 'string', + 'reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'collector_configuration' => 'int64', + 'external_id' => null, + 'reference' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'collector_configuration' => 'collectorConfiguration', + 'external_id' => 'externalId', + 'reference' => 'reference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'collector_configuration' => 'setCollectorConfiguration', + 'external_id' => 'setExternalId', + 'reference' => 'setReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'collector_configuration' => 'getCollectorConfiguration', + 'external_id' => 'getExternalId', + 'reference' => 'getReference' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['collector_configuration'] = isset($data['collector_configuration']) ? $data['collector_configuration'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['reference'] = isset($data['reference']) ? $data['reference'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['external_id'] === null) { + $invalidProperties[] = "'external_id' can't be null"; + } + if ($this->container['reference'] === null) { + $invalidProperties[] = "'reference' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 collector_configuration + * + * @return int + */ + public function getCollectorConfiguration() + { + return $this->container['collector_configuration']; + } + + /** + * Sets collector_configuration + * + * @param int $collector_configuration The collector configuration determines how the debt collection case is processed. + * + * @return $this + */ + public function setCollectorConfiguration($collector_configuration) + { + $this->container['collector_configuration'] = $collector_configuration; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference The case reference is used in the communication with the debtor. It should be unique and it should be linkable with the source of the debt collection case. + * + * @return $this + */ + public function setReference($reference) + { + $this->container['reference'] = $reference; + + 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/wallee-sdk/lib/Model/DebtCollectionCaseDocument.php b/wallee-sdk/lib/Model/DebtCollectionCaseDocument.php index f04c523..a7a160e 100644 --- a/wallee-sdk/lib/Model/DebtCollectionCaseDocument.php +++ b/wallee-sdk/lib/Model/DebtCollectionCaseDocument.php @@ -1,10 +1,8 @@ '\DateTime', - 'debtCollectionCase' => 'int', - 'fileName' => 'string', - 'id' => 'int', - 'labels' => '\Wallee\Sdk\Model\Label[]', - 'linkedSpaceId' => 'int', - 'mimeType' => 'string', - 'plannedPurgeDate' => '\DateTime', - 'storageId' => 'string', - 'uniqueId' => 'string', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The created on date indicates the date on which the entity was stored into the database. - * - * @var \DateTime - */ - private $createdOn; - - /** - * - * - * @var int - */ - private $debtCollectionCase; - - /** - * - * - * @var string - */ - private $fileName; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var \Wallee\Sdk\Model\Label[] - */ - private $labels; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * - * - * @var string - */ - private $mimeType; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var string - */ - private $storageId; - - /** - * - * - * @var string - */ - private $uniqueId; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['labels'])) { - $this->setLabels($data['labels']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns createdOn. - * - * The created on date indicates the date on which the entity was stored into the database. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return DebtCollectionCaseDocument - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns debtCollectionCase. - * - * - * - * @return int - */ - public function getDebtCollectionCase() { - return $this->debtCollectionCase; - } - - /** - * Sets debtCollectionCase. - * - * @param int $debtCollectionCase - * @return DebtCollectionCaseDocument - */ - protected function setDebtCollectionCase($debtCollectionCase) { - $this->debtCollectionCase = $debtCollectionCase; - - return $this; - } - - /** - * Returns fileName. - * - * - * - * @return string - */ - public function getFileName() { - return $this->fileName; - } - - /** - * Sets fileName. - * - * @param string $fileName - * @return DebtCollectionCaseDocument - */ - protected function setFileName($fileName) { - $this->fileName = $fileName; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return DebtCollectionCaseDocument - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns labels. - * - * - * - * @return \Wallee\Sdk\Model\Label[] - */ - public function getLabels() { - return $this->labels; - } - - /** - * Sets labels. - * - * @param \Wallee\Sdk\Model\Label[] $labels - * @return DebtCollectionCaseDocument - */ - public function setLabels($labels) { - $this->labels = $labels; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return DebtCollectionCaseDocument - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns mimeType. - * - * - * - * @return string - */ - public function getMimeType() { - return $this->mimeType; - } - - /** - * Sets mimeType. - * - * @param string $mimeType - * @return DebtCollectionCaseDocument - */ - protected function setMimeType($mimeType) { - $this->mimeType = $mimeType; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return DebtCollectionCaseDocument - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns storageId. - * - * - * - * @return string - */ - public function getStorageId() { - return $this->storageId; - } - - /** - * Sets storageId. - * - * @param string $storageId - * @return DebtCollectionCaseDocument - */ - protected function setStorageId($storageId) { - $this->storageId = $storageId; - - return $this; - } - - /** - * Returns uniqueId. - * - * - * - * @return string - */ - public function getUniqueId() { - return $this->uniqueId; - } - - /** - * Sets uniqueId. - * - * @param string $uniqueId - * @return DebtCollectionCaseDocument - */ - protected function setUniqueId($uniqueId) { - $this->uniqueId = $uniqueId; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return DebtCollectionCaseDocument - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class DebtCollectionCaseDocument implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'DebtCollectionCaseDocument'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'created_on' => '\DateTime', + 'debt_collection_case' => 'int', + 'file_name' => 'string', + 'id' => 'int', + 'labels' => '\Wallee\Sdk\Model\Label[]', + 'linked_space_id' => 'int', + 'mime_type' => 'string', + 'planned_purge_date' => '\DateTime', + 'storage_id' => 'string', + 'unique_id' => 'string', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'created_on' => 'date-time', + 'debt_collection_case' => 'int64', + 'file_name' => null, + 'id' => 'int64', + 'labels' => null, + 'linked_space_id' => 'int64', + 'mime_type' => null, + 'planned_purge_date' => 'date-time', + 'storage_id' => null, + 'unique_id' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'created_on' => 'createdOn', + 'debt_collection_case' => 'debtCollectionCase', + 'file_name' => 'fileName', + 'id' => 'id', + 'labels' => 'labels', + 'linked_space_id' => 'linkedSpaceId', + 'mime_type' => 'mimeType', + 'planned_purge_date' => 'plannedPurgeDate', + 'storage_id' => 'storageId', + 'unique_id' => 'uniqueId', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'created_on' => 'setCreatedOn', + 'debt_collection_case' => 'setDebtCollectionCase', + 'file_name' => 'setFileName', + 'id' => 'setId', + 'labels' => 'setLabels', + 'linked_space_id' => 'setLinkedSpaceId', + 'mime_type' => 'setMimeType', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'storage_id' => 'setStorageId', + 'unique_id' => 'setUniqueId', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'created_on' => 'getCreatedOn', + 'debt_collection_case' => 'getDebtCollectionCase', + 'file_name' => 'getFileName', + 'id' => 'getId', + 'labels' => 'getLabels', + 'linked_space_id' => 'getLinkedSpaceId', + 'mime_type' => 'getMimeType', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'storage_id' => 'getStorageId', + 'unique_id' => 'getUniqueId', + 'version' => 'getVersion' + ]; + + + + /** + * 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['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['debt_collection_case'] = isset($data['debt_collection_case']) ? $data['debt_collection_case'] : null; + + $this->container['file_name'] = isset($data['file_name']) ? $data['file_name'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['labels'] = isset($data['labels']) ? $data['labels'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['mime_type'] = isset($data['mime_type']) ? $data['mime_type'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['storage_id'] = isset($data['storage_id']) ? $data['storage_id'] : null; + + $this->container['unique_id'] = isset($data['unique_id']) ? $data['unique_id'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets debt_collection_case + * + * @return int + */ + public function getDebtCollectionCase() + { + return $this->container['debt_collection_case']; + } + + /** + * Sets debt_collection_case + * + * @param int $debt_collection_case + * + * @return $this + */ + public function setDebtCollectionCase($debt_collection_case) + { + $this->container['debt_collection_case'] = $debt_collection_case; + + return $this; + } + + + /** + * Gets file_name + * + * @return string + */ + public function getFileName() + { + return $this->container['file_name']; + } + + /** + * Sets file_name + * + * @param string $file_name + * + * @return $this + */ + public function setFileName($file_name) + { + $this->container['file_name'] = $file_name; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets labels + * + * @return \Wallee\Sdk\Model\Label[] + */ + public function getLabels() + { + return $this->container['labels']; + } + + /** + * Sets labels + * + * @param \Wallee\Sdk\Model\Label[] $labels + * + * @return $this + */ + public function setLabels($labels) + { + $this->container['labels'] = $labels; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets mime_type + * + * @return string + */ + public function getMimeType() + { + return $this->container['mime_type']; + } + + /** + * Sets mime_type + * + * @param string $mime_type + * + * @return $this + */ + public function setMimeType($mime_type) + { + $this->container['mime_type'] = $mime_type; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets storage_id + * + * @return string + */ + public function getStorageId() + { + return $this->container['storage_id']; + } + + /** + * Sets storage_id + * + * @param string $storage_id + * + * @return $this + */ + public function setStorageId($storage_id) + { + $this->container['storage_id'] = $storage_id; + + return $this; + } + + + /** + * Gets unique_id + * + * @return string + */ + public function getUniqueId() + { + return $this->container['unique_id']; + } + + /** + * Sets unique_id + * + * @param string $unique_id + * + * @return $this + */ + public function setUniqueId($unique_id) + { + $this->container['unique_id'] = $unique_id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/DebtCollectionCaseSource.php b/wallee-sdk/lib/Model/DebtCollectionCaseSource.php index 85b777d..a1d7561 100644 --- a/wallee-sdk/lib/Model/DebtCollectionCaseSource.php +++ b/wallee-sdk/lib/Model/DebtCollectionCaseSource.php @@ -1,10 +1,8 @@ 'map[string,string]', - 'forcedPreparingState' => 'bool', - 'id' => 'int', - 'name' => 'map[string,string]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * - * - * @var bool - */ - private $forcedPreparingState; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $name; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - } - - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return DebtCollectionCaseSource - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns forcedPreparingState. - * - * - * - * @return bool - */ - public function getForcedPreparingState() { - return $this->forcedPreparingState; - } - - /** - * Sets forcedPreparingState. - * - * @param bool $forcedPreparingState - * @return DebtCollectionCaseSource - */ - protected function setForcedPreparingState($forcedPreparingState) { - $this->forcedPreparingState = $forcedPreparingState; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return DebtCollectionCaseSource - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return DebtCollectionCaseSource - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class DebtCollectionCaseSource implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'DebtCollectionCaseSource'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'description' => 'map[string,string]', + 'forced_preparing_state' => 'bool', + 'id' => 'int', + 'name' => 'map[string,string]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'forced_preparing_state' => null, + 'id' => 'int64', + 'name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'forced_preparing_state' => 'forcedPreparingState', + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'forced_preparing_state' => 'setForcedPreparingState', + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'forced_preparing_state' => 'getForcedPreparingState', + 'id' => 'getId', + 'name' => 'getName' + ]; + + + + /** + * 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['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['forced_preparing_state'] = isset($data['forced_preparing_state']) ? $data['forced_preparing_state'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets forced_preparing_state + * + * @return bool + */ + public function getForcedPreparingState() + { + return $this->container['forced_preparing_state']; + } + + /** + * Sets forced_preparing_state + * + * @param bool $forced_preparing_state + * + * @return $this + */ + public function setForcedPreparingState($forced_preparing_state) + { + $this->container['forced_preparing_state'] = $forced_preparing_state; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + 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/wallee-sdk/lib/Model/DebtCollectionCaseState.php b/wallee-sdk/lib/Model/DebtCollectionCaseState.php index 98e5267..fe2ec77 100644 --- a/wallee-sdk/lib/Model/DebtCollectionCaseState.php +++ b/wallee-sdk/lib/Model/DebtCollectionCaseState.php @@ -1,10 +1,8 @@ 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return DebtCollectionCaseUpdate - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return DebtCollectionCaseUpdate - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - if ($this->getId() === null) { - throw new ValidationException("'id' can't be null", 'id', $this); - } - if ($this->getVersion() === null) { - throw new ValidationException("'version' can't be null", 'version', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class DebtCollectionCaseUpdate extends AbstractDebtCollectionCaseUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'DebtCollectionCase.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/DebtCollectionEnvironment.php b/wallee-sdk/lib/Model/DebtCollectionEnvironment.php index 1f2a6dc..6c3369d 100644 --- a/wallee-sdk/lib/Model/DebtCollectionEnvironment.php +++ b/wallee-sdk/lib/Model/DebtCollectionEnvironment.php @@ -1,10 +1,8 @@ 'float', - 'createdBy' => 'int', - 'createdOn' => '\DateTime', - 'debtCollectionCase' => 'int', - 'externalId' => 'string', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'plannedPurgeDate' => '\DateTime', - 'source' => 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var float - */ - private $amount; - - /** - * The created by field indicates the user which has created the receipt. - * - * @var int - */ - private $createdBy; - - /** - * The created on date indicates the date on which the entity was stored into the database. - * - * @var \DateTime - */ - private $createdOn; - - /** - * - * - * @var int - */ - private $debtCollectionCase; - - /** - * The external id is a unique identifier for the receipt. The external id has to be unique in combination with the debt collection case. When a receipt is sent with an existing external id the existing one is returned rather than a new one is created. - * - * @var string - */ - private $externalId; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var int - */ - private $source; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns amount. - * - * - * - * @return float - */ - public function getAmount() { - return $this->amount; - } - - /** - * Sets amount. - * - * @param float $amount - * @return DebtCollectionReceipt - */ - protected function setAmount($amount) { - $this->amount = $amount; - - return $this; - } - - /** - * Returns createdBy. - * - * The created by field indicates the user which has created the receipt. - * - * @return int - */ - public function getCreatedBy() { - return $this->createdBy; - } - - /** - * Sets createdBy. - * - * @param int $createdBy - * @return DebtCollectionReceipt - */ - protected function setCreatedBy($createdBy) { - $this->createdBy = $createdBy; - - return $this; - } - - /** - * Returns createdOn. - * - * The created on date indicates the date on which the entity was stored into the database. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return DebtCollectionReceipt - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns debtCollectionCase. - * - * - * - * @return int - */ - public function getDebtCollectionCase() { - return $this->debtCollectionCase; - } - - /** - * Sets debtCollectionCase. - * - * @param int $debtCollectionCase - * @return DebtCollectionReceipt - */ - protected function setDebtCollectionCase($debtCollectionCase) { - $this->debtCollectionCase = $debtCollectionCase; - - return $this; - } - - /** - * Returns externalId. - * - * The external id is a unique identifier for the receipt. The external id has to be unique in combination with the debt collection case. When a receipt is sent with an existing external id the existing one is returned rather than a new one is created. - * - * @return string - */ - public function getExternalId() { - return $this->externalId; - } - - /** - * Sets externalId. - * - * @param string $externalId - * @return DebtCollectionReceipt - */ - protected function setExternalId($externalId) { - $this->externalId = $externalId; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return DebtCollectionReceipt - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return DebtCollectionReceipt - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return DebtCollectionReceipt - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns source. - * - * - * - * @return int - */ - public function getSource() { - return $this->source; - } - - /** - * Sets source. - * - * @param int $source - * @return DebtCollectionReceipt - */ - protected function setSource($source) { - $this->source = $source; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return DebtCollectionReceipt - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class DebtCollectionReceipt implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'DebtCollectionReceipt'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'amount' => 'float', + 'created_by' => 'int', + 'created_on' => '\DateTime', + 'debt_collection_case' => 'int', + 'external_id' => 'string', + 'id' => 'int', + 'linked_space_id' => 'int', + 'planned_purge_date' => '\DateTime', + 'source' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'amount' => null, + 'created_by' => 'int64', + 'created_on' => 'date-time', + 'debt_collection_case' => 'int64', + 'external_id' => null, + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'planned_purge_date' => 'date-time', + 'source' => 'int64', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'created_by' => 'createdBy', + 'created_on' => 'createdOn', + 'debt_collection_case' => 'debtCollectionCase', + 'external_id' => 'externalId', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'planned_purge_date' => 'plannedPurgeDate', + 'source' => 'source', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'created_by' => 'setCreatedBy', + 'created_on' => 'setCreatedOn', + 'debt_collection_case' => 'setDebtCollectionCase', + 'external_id' => 'setExternalId', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'source' => 'setSource', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'created_by' => 'getCreatedBy', + 'created_on' => 'getCreatedOn', + 'debt_collection_case' => 'getDebtCollectionCase', + 'external_id' => 'getExternalId', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'source' => 'getSource', + 'version' => 'getVersion' + ]; + + + + /** + * 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['amount'] = isset($data['amount']) ? $data['amount'] : null; + + $this->container['created_by'] = isset($data['created_by']) ? $data['created_by'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['debt_collection_case'] = isset($data['debt_collection_case']) ? $data['debt_collection_case'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['source'] = isset($data['source']) ? $data['source'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 amount + * + * @return float + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param float $amount + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + + /** + * Gets created_by + * + * @return int + */ + public function getCreatedBy() + { + return $this->container['created_by']; + } + + /** + * Sets created_by + * + * @param int $created_by The created by field indicates the user which has created the receipt. + * + * @return $this + */ + public function setCreatedBy($created_by) + { + $this->container['created_by'] = $created_by; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets debt_collection_case + * + * @return int + */ + public function getDebtCollectionCase() + { + return $this->container['debt_collection_case']; + } + + /** + * Sets debt_collection_case + * + * @param int $debt_collection_case + * + * @return $this + */ + public function setDebtCollectionCase($debt_collection_case) + { + $this->container['debt_collection_case'] = $debt_collection_case; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id is a unique identifier for the receipt. The external id has to be unique in combination with the debt collection case. When a receipt is sent with an existing external id the existing one is returned rather than a new one is created. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets source + * + * @return int + */ + public function getSource() + { + return $this->container['source']; + } + + /** + * Sets source + * + * @param int $source + * + * @return $this + */ + public function setSource($source) + { + $this->container['source'] = $source; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/DebtCollectionReceiptSource.php b/wallee-sdk/lib/Model/DebtCollectionReceiptSource.php index 8eb0cbf..e416b01 100644 --- a/wallee-sdk/lib/Model/DebtCollectionReceiptSource.php +++ b/wallee-sdk/lib/Model/DebtCollectionReceiptSource.php @@ -1,10 +1,8 @@ 'map[string,string]', - 'id' => 'int', - 'name' => 'map[string,string]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $name; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - } - - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return DebtCollectionReceiptSource - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return DebtCollectionReceiptSource - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return DebtCollectionReceiptSource - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class DebtCollectionReceiptSource implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'DebtCollectionReceiptSource'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'description' => 'map[string,string]', + 'id' => 'int', + 'name' => 'map[string,string]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'id' => 'int64', + 'name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'name' => 'getName' + ]; + + + + /** + * 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['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + 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/wallee-sdk/lib/Model/DebtCollector.php b/wallee-sdk/lib/Model/DebtCollector.php index 5f8acb4..fca549c 100644 --- a/wallee-sdk/lib/Model/DebtCollector.php +++ b/wallee-sdk/lib/Model/DebtCollector.php @@ -1,10 +1,8 @@ 'map[string,string]', - 'id' => 'int', - 'name' => 'map[string,string]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $name; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - } - - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return DebtCollector - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return DebtCollector - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return DebtCollector - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class DebtCollector implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'DebtCollector'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'description' => 'map[string,string]', + 'id' => 'int', + 'name' => 'map[string,string]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'id' => 'int64', + 'name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'name' => 'getName' + ]; + + + + /** + * 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['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + 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/wallee-sdk/lib/Model/DebtCollectorCondition.php b/wallee-sdk/lib/Model/DebtCollectorCondition.php index b7a54c3..7a70dcb 100644 --- a/wallee-sdk/lib/Model/DebtCollectorCondition.php +++ b/wallee-sdk/lib/Model/DebtCollectorCondition.php @@ -1,10 +1,8 @@ 'int', - 'linkedSpaceId' => 'int', - 'name' => 'string', - 'plannedPurgeDate' => '\DateTime', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'type' => 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The condition name is used internally to identify the condition. For example the name is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The condition type determines the condition realization. - * - * @var int - */ - private $type; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return DebtCollectorCondition - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return DebtCollectorCondition - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * The condition name is used internally to identify the condition. For example the name is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return DebtCollectorCondition - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return DebtCollectorCondition - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return DebtCollectorCondition - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns type. - * - * The condition type determines the condition realization. - * - * @return int - */ - public function getType() { - return $this->type; - } - - /** - * Sets type. - * - * @param int $type - * @return DebtCollectorCondition - */ - protected function setType($type) { - $this->type = $type; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return DebtCollectorCondition - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class DebtCollectorCondition implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'DebtCollectorCondition'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'linked_space_id' => 'int', + 'name' => 'string', + 'planned_purge_date' => '\DateTime', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'type' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'name' => null, + 'planned_purge_date' => 'date-time', + 'state' => null, + 'type' => 'int64', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'planned_purge_date' => 'plannedPurgeDate', + 'state' => 'state', + 'type' => 'type', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'state' => 'setState', + 'type' => 'setType', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'state' => 'getState', + 'type' => 'getType', + 'version' => 'getVersion' + ]; + + + + /** + * 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['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The condition name is used internally to identify the condition. For example the name is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets type + * + * @return int + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param int $type The condition type determines the condition realization. + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/DebtCollectorConditionType.php b/wallee-sdk/lib/Model/DebtCollectorConditionType.php index 0bc0bef..50303e2 100644 --- a/wallee-sdk/lib/Model/DebtCollectorConditionType.php +++ b/wallee-sdk/lib/Model/DebtCollectorConditionType.php @@ -1,10 +1,8 @@ 'map[string,string]', - 'id' => 'int', - 'name' => 'map[string,string]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $name; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - } - - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return DebtCollectorConditionType - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return DebtCollectorConditionType - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return DebtCollectorConditionType - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class DebtCollectorConditionType implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'DebtCollectorConditionType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'description' => 'map[string,string]', + 'id' => 'int', + 'name' => 'map[string,string]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'id' => 'int64', + 'name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'name' => 'getName' + ]; + + + + /** + * 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['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + 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/wallee-sdk/lib/Model/DebtCollectorConfiguration.php b/wallee-sdk/lib/Model/DebtCollectorConfiguration.php index 0698408..0df1d12 100644 --- a/wallee-sdk/lib/Model/DebtCollectorConfiguration.php +++ b/wallee-sdk/lib/Model/DebtCollectorConfiguration.php @@ -1,10 +1,8 @@ 'int', - 'conditions' => 'int[]', - 'enabledSpaceViews' => 'int[]', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'name' => 'string', - 'plannedPurgeDate' => '\DateTime', - 'priority' => 'int', - 'skipReviewEnabled' => 'bool', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The collector handles the debt collection case based on the settings of this configuration. - * - * @var int - */ - private $collector; - - /** - * The conditions applied to the collector configuration restricts the application of this configuration onto a particular debt collection case. - * - * @var int[] - */ - private $conditions; - - /** - * The collector configuration is only enabled for the selected space views. In case the set is empty the collector configuration is enabled for all space views. - * - * @var int[] - */ - private $enabledSpaceViews; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The collector configuration name is used internally to identify a specific collector configuration. For example the name is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * The priority defines the order in which the collector configuration is tried to be applied onto a debt collection case. The higher the value the less likely the configuration is applied on a case. - * - * @var int - */ - private $priority; - - /** - * When the review is skipped there will be no review for cases which use this configuration. - * - * @var bool - */ - private $skipReviewEnabled; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['conditions'])) { - $this->setConditions($data['conditions']); - } - if (isset($data['enabledSpaceViews'])) { - $this->setEnabledSpaceViews($data['enabledSpaceViews']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns collector. - * - * The collector handles the debt collection case based on the settings of this configuration. - * - * @return int - */ - public function getCollector() { - return $this->collector; - } - - /** - * Sets collector. - * - * @param int $collector - * @return DebtCollectorConfiguration - */ - protected function setCollector($collector) { - $this->collector = $collector; - - return $this; - } - - /** - * Returns conditions. - * - * The conditions applied to the collector configuration restricts the application of this configuration onto a particular debt collection case. - * - * @return int[] - */ - public function getConditions() { - return $this->conditions; - } - - /** - * Sets conditions. - * - * @param int[] $conditions - * @return DebtCollectorConfiguration - */ - public function setConditions($conditions) { - $this->conditions = $conditions; - - return $this; - } - - /** - * Returns enabledSpaceViews. - * - * The collector configuration is only enabled for the selected space views. In case the set is empty the collector configuration is enabled for all space views. - * - * @return int[] - */ - public function getEnabledSpaceViews() { - return $this->enabledSpaceViews; - } - - /** - * Sets enabledSpaceViews. - * - * @param int[] $enabledSpaceViews - * @return DebtCollectorConfiguration - */ - public function setEnabledSpaceViews($enabledSpaceViews) { - $this->enabledSpaceViews = $enabledSpaceViews; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return DebtCollectorConfiguration - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return DebtCollectorConfiguration - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * The collector configuration name is used internally to identify a specific collector configuration. For example the name is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return DebtCollectorConfiguration - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return DebtCollectorConfiguration - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns priority. - * - * The priority defines the order in which the collector configuration is tried to be applied onto a debt collection case. The higher the value the less likely the configuration is applied on a case. - * - * @return int - */ - public function getPriority() { - return $this->priority; - } - - /** - * Sets priority. - * - * @param int $priority - * @return DebtCollectorConfiguration - */ - protected function setPriority($priority) { - $this->priority = $priority; - - return $this; - } - - /** - * Returns skipReviewEnabled. - * - * When the review is skipped there will be no review for cases which use this configuration. - * - * @return bool - */ - public function getSkipReviewEnabled() { - return $this->skipReviewEnabled; - } - - /** - * Sets skipReviewEnabled. - * - * @param bool $skipReviewEnabled - * @return DebtCollectorConfiguration - */ - protected function setSkipReviewEnabled($skipReviewEnabled) { - $this->skipReviewEnabled = $skipReviewEnabled; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return DebtCollectorConfiguration - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return DebtCollectorConfiguration - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class DebtCollectorConfiguration implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'DebtCollectorConfiguration'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'collector' => 'int', + 'conditions' => 'int[]', + 'enabled_space_views' => 'int[]', + 'id' => 'int', + 'linked_space_id' => 'int', + 'name' => 'string', + 'planned_purge_date' => '\DateTime', + 'priority' => 'int', + 'skip_review_enabled' => 'bool', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'collector' => 'int64', + 'conditions' => 'int64', + 'enabled_space_views' => 'int64', + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'name' => null, + 'planned_purge_date' => 'date-time', + 'priority' => 'int32', + 'skip_review_enabled' => null, + 'state' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'collector' => 'collector', + 'conditions' => 'conditions', + 'enabled_space_views' => 'enabledSpaceViews', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'planned_purge_date' => 'plannedPurgeDate', + 'priority' => 'priority', + 'skip_review_enabled' => 'skipReviewEnabled', + 'state' => 'state', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'collector' => 'setCollector', + 'conditions' => 'setConditions', + 'enabled_space_views' => 'setEnabledSpaceViews', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'priority' => 'setPriority', + 'skip_review_enabled' => 'setSkipReviewEnabled', + 'state' => 'setState', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'collector' => 'getCollector', + 'conditions' => 'getConditions', + 'enabled_space_views' => 'getEnabledSpaceViews', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'priority' => 'getPriority', + 'skip_review_enabled' => 'getSkipReviewEnabled', + 'state' => 'getState', + 'version' => 'getVersion' + ]; + + + + /** + * 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['collector'] = isset($data['collector']) ? $data['collector'] : null; + + $this->container['conditions'] = isset($data['conditions']) ? $data['conditions'] : null; + + $this->container['enabled_space_views'] = isset($data['enabled_space_views']) ? $data['enabled_space_views'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['priority'] = isset($data['priority']) ? $data['priority'] : null; + + $this->container['skip_review_enabled'] = isset($data['skip_review_enabled']) ? $data['skip_review_enabled'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 collector + * + * @return int + */ + public function getCollector() + { + return $this->container['collector']; + } + + /** + * Sets collector + * + * @param int $collector The collector handles the debt collection case based on the settings of this configuration. + * + * @return $this + */ + public function setCollector($collector) + { + $this->container['collector'] = $collector; + + return $this; + } + + + /** + * Gets conditions + * + * @return int[] + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param int[] $conditions The conditions applied to the collector configuration restricts the application of this configuration onto a particular debt collection case. + * + * @return $this + */ + public function setConditions($conditions) + { + $this->container['conditions'] = $conditions; + + return $this; + } + + + /** + * Gets enabled_space_views + * + * @return int[] + */ + public function getEnabledSpaceViews() + { + return $this->container['enabled_space_views']; + } + + /** + * Sets enabled_space_views + * + * @param int[] $enabled_space_views The collector configuration is only enabled for the selected space views. In case the set is empty the collector configuration is enabled for all space views. + * + * @return $this + */ + public function setEnabledSpaceViews($enabled_space_views) + { + $this->container['enabled_space_views'] = $enabled_space_views; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The collector configuration name is used internally to identify a specific collector configuration. For example the name is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets priority + * + * @return int + */ + public function getPriority() + { + return $this->container['priority']; + } + + /** + * Sets priority + * + * @param int $priority The priority defines the order in which the collector configuration is tried to be applied onto a debt collection case. The higher the value the less likely the configuration is applied on a case. + * + * @return $this + */ + public function setPriority($priority) + { + $this->container['priority'] = $priority; + + return $this; + } + + + /** + * Gets skip_review_enabled + * + * @return bool + */ + public function getSkipReviewEnabled() + { + return $this->container['skip_review_enabled']; + } + + /** + * Sets skip_review_enabled + * + * @param bool $skip_review_enabled When the review is skipped there will be no review for cases which use this configuration. + * + * @return $this + */ + public function setSkipReviewEnabled($skip_review_enabled) + { + $this->container['skip_review_enabled'] = $skip_review_enabled; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/DeliveryIndication.php b/wallee-sdk/lib/Model/DeliveryIndication.php index d614774..0677ff1 100644 --- a/wallee-sdk/lib/Model/DeliveryIndication.php +++ b/wallee-sdk/lib/Model/DeliveryIndication.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\DeliveryIndicationDecisionReason', - 'automaticallyDecidedOn' => '\DateTime', - 'createdOn' => '\DateTime', - 'manualDecisionTimeoutOn' => '\DateTime', - 'manuallyDecidedBy' => 'int', - 'manuallyDecidedOn' => '\DateTime', - 'plannedPurgeDate' => '\DateTime', - 'state' => '\Wallee\Sdk\Model\DeliveryIndicationState', - 'timeoutOn' => '\DateTime', - 'transaction' => '\Wallee\Sdk\Model\Transaction' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\DeliveryIndicationDecisionReason - */ - private $automaticDecisionReason; - - /** - * - * - * @var \DateTime - */ - private $automaticallyDecidedOn; - - /** - * The created on date indicates the date on which the entity was stored into the database. - * - * @var \DateTime - */ - private $createdOn; - - /** - * - * - * @var \DateTime - */ - private $manualDecisionTimeoutOn; - - /** - * - * - * @var int - */ - private $manuallyDecidedBy; - - /** - * - * - * @var \DateTime - */ - private $manuallyDecidedOn; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var \Wallee\Sdk\Model\DeliveryIndicationState - */ - private $state; - - /** - * - * - * @var \DateTime - */ - private $timeoutOn; - - /** - * - * - * @var \Wallee\Sdk\Model\Transaction - */ - private $transaction; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['automaticDecisionReason'])) { - $this->setAutomaticDecisionReason($data['automaticDecisionReason']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['transaction'])) { - $this->setTransaction($data['transaction']); - } - } - - - /** - * Returns automaticDecisionReason. - * - * - * - * @return \Wallee\Sdk\Model\DeliveryIndicationDecisionReason - */ - public function getAutomaticDecisionReason() { - return $this->automaticDecisionReason; - } - - /** - * Sets automaticDecisionReason. - * - * @param \Wallee\Sdk\Model\DeliveryIndicationDecisionReason $automaticDecisionReason - * @return DeliveryIndication - */ - public function setAutomaticDecisionReason($automaticDecisionReason) { - $this->automaticDecisionReason = $automaticDecisionReason; - - return $this; - } - - /** - * Returns automaticallyDecidedOn. - * - * - * - * @return \DateTime - */ - public function getAutomaticallyDecidedOn() { - return $this->automaticallyDecidedOn; - } - - /** - * Sets automaticallyDecidedOn. - * - * @param \DateTime $automaticallyDecidedOn - * @return DeliveryIndication - */ - protected function setAutomaticallyDecidedOn($automaticallyDecidedOn) { - $this->automaticallyDecidedOn = $automaticallyDecidedOn; - - return $this; - } - - /** - * Returns createdOn. - * - * The created on date indicates the date on which the entity was stored into the database. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return DeliveryIndication - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns manualDecisionTimeoutOn. - * - * - * - * @return \DateTime - */ - public function getManualDecisionTimeoutOn() { - return $this->manualDecisionTimeoutOn; - } - - /** - * Sets manualDecisionTimeoutOn. - * - * @param \DateTime $manualDecisionTimeoutOn - * @return DeliveryIndication - */ - protected function setManualDecisionTimeoutOn($manualDecisionTimeoutOn) { - $this->manualDecisionTimeoutOn = $manualDecisionTimeoutOn; - - return $this; - } - - /** - * Returns manuallyDecidedBy. - * - * - * - * @return int - */ - public function getManuallyDecidedBy() { - return $this->manuallyDecidedBy; - } - - /** - * Sets manuallyDecidedBy. - * - * @param int $manuallyDecidedBy - * @return DeliveryIndication - */ - protected function setManuallyDecidedBy($manuallyDecidedBy) { - $this->manuallyDecidedBy = $manuallyDecidedBy; - - return $this; - } - - /** - * Returns manuallyDecidedOn. - * - * - * - * @return \DateTime - */ - public function getManuallyDecidedOn() { - return $this->manuallyDecidedOn; - } - - /** - * Sets manuallyDecidedOn. - * - * @param \DateTime $manuallyDecidedOn - * @return DeliveryIndication - */ - protected function setManuallyDecidedOn($manuallyDecidedOn) { - $this->manuallyDecidedOn = $manuallyDecidedOn; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return DeliveryIndication - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\DeliveryIndicationState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\DeliveryIndicationState $state - * @return DeliveryIndication - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns timeoutOn. - * - * - * - * @return \DateTime - */ - public function getTimeoutOn() { - return $this->timeoutOn; - } - - /** - * Sets timeoutOn. - * - * @param \DateTime $timeoutOn - * @return DeliveryIndication - */ - protected function setTimeoutOn($timeoutOn) { - $this->timeoutOn = $timeoutOn; - - return $this; - } - - /** - * Returns transaction. - * - * - * - * @return \Wallee\Sdk\Model\Transaction - */ - public function getTransaction() { - return $this->transaction; - } - - /** - * Sets transaction. - * - * @param \Wallee\Sdk\Model\Transaction $transaction - * @return DeliveryIndication - */ - public function setTransaction($transaction) { - $this->transaction = $transaction; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class DeliveryIndication extends TransactionAwareEntity +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'DeliveryIndication'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'automatic_decision_reason' => '\Wallee\Sdk\Model\DeliveryIndicationDecisionReason', + 'automatically_decided_on' => '\DateTime', + 'completion' => 'int', + 'created_on' => '\DateTime', + 'manual_decision_timeout_on' => '\DateTime', + 'manually_decided_by' => 'int', + 'manually_decided_on' => '\DateTime', + 'planned_purge_date' => '\DateTime', + 'state' => '\Wallee\Sdk\Model\DeliveryIndicationState', + 'timeout_on' => '\DateTime', + 'transaction' => '\Wallee\Sdk\Model\Transaction' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'automatic_decision_reason' => null, + 'automatically_decided_on' => 'date-time', + 'completion' => 'int64', + 'created_on' => 'date-time', + 'manual_decision_timeout_on' => 'date-time', + 'manually_decided_by' => 'int64', + 'manually_decided_on' => 'date-time', + 'planned_purge_date' => 'date-time', + 'state' => null, + 'timeout_on' => 'date-time', + 'transaction' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'automatic_decision_reason' => 'automaticDecisionReason', + 'automatically_decided_on' => 'automaticallyDecidedOn', + 'completion' => 'completion', + 'created_on' => 'createdOn', + 'manual_decision_timeout_on' => 'manualDecisionTimeoutOn', + 'manually_decided_by' => 'manuallyDecidedBy', + 'manually_decided_on' => 'manuallyDecidedOn', + 'planned_purge_date' => 'plannedPurgeDate', + 'state' => 'state', + 'timeout_on' => 'timeoutOn', + 'transaction' => 'transaction' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'automatic_decision_reason' => 'setAutomaticDecisionReason', + 'automatically_decided_on' => 'setAutomaticallyDecidedOn', + 'completion' => 'setCompletion', + 'created_on' => 'setCreatedOn', + 'manual_decision_timeout_on' => 'setManualDecisionTimeoutOn', + 'manually_decided_by' => 'setManuallyDecidedBy', + 'manually_decided_on' => 'setManuallyDecidedOn', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'state' => 'setState', + 'timeout_on' => 'setTimeoutOn', + 'transaction' => 'setTransaction' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'automatic_decision_reason' => 'getAutomaticDecisionReason', + 'automatically_decided_on' => 'getAutomaticallyDecidedOn', + 'completion' => 'getCompletion', + 'created_on' => 'getCreatedOn', + 'manual_decision_timeout_on' => 'getManualDecisionTimeoutOn', + 'manually_decided_by' => 'getManuallyDecidedBy', + 'manually_decided_on' => 'getManuallyDecidedOn', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'state' => 'getState', + 'timeout_on' => 'getTimeoutOn', + 'transaction' => 'getTransaction' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['automatic_decision_reason'] = isset($data['automatic_decision_reason']) ? $data['automatic_decision_reason'] : null; + + $this->container['automatically_decided_on'] = isset($data['automatically_decided_on']) ? $data['automatically_decided_on'] : null; + + $this->container['completion'] = isset($data['completion']) ? $data['completion'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['manual_decision_timeout_on'] = isset($data['manual_decision_timeout_on']) ? $data['manual_decision_timeout_on'] : null; + + $this->container['manually_decided_by'] = isset($data['manually_decided_by']) ? $data['manually_decided_by'] : null; + + $this->container['manually_decided_on'] = isset($data['manually_decided_on']) ? $data['manually_decided_on'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['timeout_on'] = isset($data['timeout_on']) ? $data['timeout_on'] : null; + + $this->container['transaction'] = isset($data['transaction']) ? $data['transaction'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 automatic_decision_reason + * + * @return \Wallee\Sdk\Model\DeliveryIndicationDecisionReason + */ + public function getAutomaticDecisionReason() + { + return $this->container['automatic_decision_reason']; + } + + /** + * Sets automatic_decision_reason + * + * @param \Wallee\Sdk\Model\DeliveryIndicationDecisionReason $automatic_decision_reason + * + * @return $this + */ + public function setAutomaticDecisionReason($automatic_decision_reason) + { + $this->container['automatic_decision_reason'] = $automatic_decision_reason; + + return $this; + } + + + /** + * Gets automatically_decided_on + * + * @return \DateTime + */ + public function getAutomaticallyDecidedOn() + { + return $this->container['automatically_decided_on']; + } + + /** + * Sets automatically_decided_on + * + * @param \DateTime $automatically_decided_on + * + * @return $this + */ + public function setAutomaticallyDecidedOn($automatically_decided_on) + { + $this->container['automatically_decided_on'] = $automatically_decided_on; + + return $this; + } + + + /** + * Gets completion + * + * @return int + */ + public function getCompletion() + { + return $this->container['completion']; + } + + /** + * Sets completion + * + * @param int $completion + * + * @return $this + */ + public function setCompletion($completion) + { + $this->container['completion'] = $completion; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets manual_decision_timeout_on + * + * @return \DateTime + */ + public function getManualDecisionTimeoutOn() + { + return $this->container['manual_decision_timeout_on']; + } + + /** + * Sets manual_decision_timeout_on + * + * @param \DateTime $manual_decision_timeout_on + * + * @return $this + */ + public function setManualDecisionTimeoutOn($manual_decision_timeout_on) + { + $this->container['manual_decision_timeout_on'] = $manual_decision_timeout_on; + + return $this; + } + + + /** + * Gets manually_decided_by + * + * @return int + */ + public function getManuallyDecidedBy() + { + return $this->container['manually_decided_by']; + } + + /** + * Sets manually_decided_by + * + * @param int $manually_decided_by + * + * @return $this + */ + public function setManuallyDecidedBy($manually_decided_by) + { + $this->container['manually_decided_by'] = $manually_decided_by; + + return $this; + } + + + /** + * Gets manually_decided_on + * + * @return \DateTime + */ + public function getManuallyDecidedOn() + { + return $this->container['manually_decided_on']; + } + + /** + * Sets manually_decided_on + * + * @param \DateTime $manually_decided_on + * + * @return $this + */ + public function setManuallyDecidedOn($manually_decided_on) + { + $this->container['manually_decided_on'] = $manually_decided_on; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\DeliveryIndicationState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\DeliveryIndicationState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets timeout_on + * + * @return \DateTime + */ + public function getTimeoutOn() + { + return $this->container['timeout_on']; + } + + /** + * Sets timeout_on + * + * @param \DateTime $timeout_on + * + * @return $this + */ + public function setTimeoutOn($timeout_on) + { + $this->container['timeout_on'] = $timeout_on; + + return $this; + } + + + /** + * Gets transaction + * + * @return \Wallee\Sdk\Model\Transaction + */ + public function getTransaction() + { + return $this->container['transaction']; + } + + /** + * Sets transaction + * + * @param \Wallee\Sdk\Model\Transaction $transaction + * + * @return $this + */ + public function setTransaction($transaction) + { + $this->container['transaction'] = $transaction; + + 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/wallee-sdk/lib/Model/DeliveryIndicationDecisionReason.php b/wallee-sdk/lib/Model/DeliveryIndicationDecisionReason.php index 511045b..83ce362 100644 --- a/wallee-sdk/lib/Model/DeliveryIndicationDecisionReason.php +++ b/wallee-sdk/lib/Model/DeliveryIndicationDecisionReason.php @@ -1,10 +1,8 @@ 'map[string,string]', - 'id' => 'int', - 'name' => 'map[string,string]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $name; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - } - - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return DeliveryIndicationDecisionReason - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return DeliveryIndicationDecisionReason - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return DeliveryIndicationDecisionReason - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class DeliveryIndicationDecisionReason implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'DeliveryIndicationDecisionReason'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'description' => 'map[string,string]', + 'id' => 'int', + 'name' => 'map[string,string]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'id' => 'int64', + 'name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'name' => 'getName' + ]; + + + + /** + * 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['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + 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/wallee-sdk/lib/Model/DeliveryIndicationState.php b/wallee-sdk/lib/Model/DeliveryIndicationState.php index a44fa15..1f3525d 100644 --- a/wallee-sdk/lib/Model/DeliveryIndicationState.php +++ b/wallee-sdk/lib/Model/DeliveryIndicationState.php @@ -1,10 +1,8 @@ 'bool', - 'deliveryEnabled' => 'bool', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'name' => 'string', - 'plannedPurgeDate' => '\DateTime', - 'spaceId' => 'int', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'templateResource' => '\Wallee\Sdk\Model\ModelResourcePath', - 'type' => 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The default document template is used whenever no specific template is specified for a particular template type. - * - * @var bool - */ - private $defaultTemplate; - - /** - * - * - * @var bool - */ - private $deliveryEnabled; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * - * - * @var string - */ - private $name; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var int - */ - private $spaceId; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * - * - * @var \Wallee\Sdk\Model\ModelResourcePath - */ - private $templateResource; - - /** - * - * - * @var int - */ - private $type; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['templateResource'])) { - $this->setTemplateResource($data['templateResource']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns defaultTemplate. - * - * The default document template is used whenever no specific template is specified for a particular template type. - * - * @return bool - */ - public function getDefaultTemplate() { - return $this->defaultTemplate; - } - - /** - * Sets defaultTemplate. - * - * @param bool $defaultTemplate - * @return DocumentTemplate - */ - protected function setDefaultTemplate($defaultTemplate) { - $this->defaultTemplate = $defaultTemplate; - - return $this; - } - - /** - * Returns deliveryEnabled. - * - * - * - * @return bool - */ - public function getDeliveryEnabled() { - return $this->deliveryEnabled; - } - - /** - * Sets deliveryEnabled. - * - * @param bool $deliveryEnabled - * @return DocumentTemplate - */ - protected function setDeliveryEnabled($deliveryEnabled) { - $this->deliveryEnabled = $deliveryEnabled; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return DocumentTemplate - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return DocumentTemplate - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return DocumentTemplate - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return DocumentTemplate - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns spaceId. - * - * - * - * @return int - */ - public function getSpaceId() { - return $this->spaceId; - } - - /** - * Sets spaceId. - * - * @param int $spaceId - * @return DocumentTemplate - */ - protected function setSpaceId($spaceId) { - $this->spaceId = $spaceId; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return DocumentTemplate - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns templateResource. - * - * - * - * @return \Wallee\Sdk\Model\ModelResourcePath - */ - public function getTemplateResource() { - return $this->templateResource; - } - - /** - * Sets templateResource. - * - * @param \Wallee\Sdk\Model\ModelResourcePath $templateResource - * @return DocumentTemplate - */ - public function setTemplateResource($templateResource) { - $this->templateResource = $templateResource; - - return $this; - } - - /** - * Returns type. - * - * - * - * @return int - */ - public function getType() { - return $this->type; - } - - /** - * Sets type. - * - * @param int $type - * @return DocumentTemplate - */ - protected function setType($type) { - $this->type = $type; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return DocumentTemplate - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class DocumentTemplate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'DocumentTemplate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'default_template' => 'bool', + 'delivery_enabled' => 'bool', + 'id' => 'int', + 'linked_space_id' => 'int', + 'name' => 'string', + 'planned_purge_date' => '\DateTime', + 'space_id' => 'int', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'template_resource' => '\Wallee\Sdk\Model\ModelResourcePath', + 'type' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'default_template' => null, + 'delivery_enabled' => null, + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'name' => null, + 'planned_purge_date' => 'date-time', + 'space_id' => 'int64', + 'state' => null, + 'template_resource' => null, + 'type' => 'int64', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'default_template' => 'defaultTemplate', + 'delivery_enabled' => 'deliveryEnabled', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'planned_purge_date' => 'plannedPurgeDate', + 'space_id' => 'spaceId', + 'state' => 'state', + 'template_resource' => 'templateResource', + 'type' => 'type', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'default_template' => 'setDefaultTemplate', + 'delivery_enabled' => 'setDeliveryEnabled', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'space_id' => 'setSpaceId', + 'state' => 'setState', + 'template_resource' => 'setTemplateResource', + 'type' => 'setType', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'default_template' => 'getDefaultTemplate', + 'delivery_enabled' => 'getDeliveryEnabled', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'space_id' => 'getSpaceId', + 'state' => 'getState', + 'template_resource' => 'getTemplateResource', + 'type' => 'getType', + 'version' => 'getVersion' + ]; + + + + /** + * 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['default_template'] = isset($data['default_template']) ? $data['default_template'] : null; + + $this->container['delivery_enabled'] = isset($data['delivery_enabled']) ? $data['delivery_enabled'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['space_id'] = isset($data['space_id']) ? $data['space_id'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['template_resource'] = isset($data['template_resource']) ? $data['template_resource'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 default_template + * + * @return bool + */ + public function getDefaultTemplate() + { + return $this->container['default_template']; + } + + /** + * Sets default_template + * + * @param bool $default_template The default document template is used whenever no specific template is specified for a particular template type. + * + * @return $this + */ + public function setDefaultTemplate($default_template) + { + $this->container['default_template'] = $default_template; + + return $this; + } + + + /** + * Gets delivery_enabled + * + * @return bool + */ + public function getDeliveryEnabled() + { + return $this->container['delivery_enabled']; + } + + /** + * Sets delivery_enabled + * + * @param bool $delivery_enabled + * + * @return $this + */ + public function setDeliveryEnabled($delivery_enabled) + { + $this->container['delivery_enabled'] = $delivery_enabled; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets space_id + * + * @return int + */ + public function getSpaceId() + { + return $this->container['space_id']; + } + + /** + * Sets space_id + * + * @param int $space_id + * + * @return $this + */ + public function setSpaceId($space_id) + { + $this->container['space_id'] = $space_id; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets template_resource + * + * @return \Wallee\Sdk\Model\ModelResourcePath + */ + public function getTemplateResource() + { + return $this->container['template_resource']; + } + + /** + * Sets template_resource + * + * @param \Wallee\Sdk\Model\ModelResourcePath $template_resource + * + * @return $this + */ + public function setTemplateResource($template_resource) + { + $this->container['template_resource'] = $template_resource; + + return $this; + } + + + /** + * Gets type + * + * @return int + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param int $type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/DocumentTemplateType.php b/wallee-sdk/lib/Model/DocumentTemplateType.php index ccda913..0648082 100644 --- a/wallee-sdk/lib/Model/DocumentTemplateType.php +++ b/wallee-sdk/lib/Model/DocumentTemplateType.php @@ -1,10 +1,8 @@ 'map[string,string]', - 'feature' => 'int', - 'group' => '\Wallee\Sdk\Model\DocumentTemplateTypeGroup', - 'id' => 'int', - 'title' => 'map[string,string]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * - * - * @var int - */ - private $feature; - - /** - * - * - * @var \Wallee\Sdk\Model\DocumentTemplateTypeGroup - */ - private $group; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $title; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['group'])) { - $this->setGroup($data['group']); - } - if (isset($data['title'])) { - $this->setTitle($data['title']); - } - } - - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return DocumentTemplateType - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns feature. - * - * - * - * @return int - */ - public function getFeature() { - return $this->feature; - } - - /** - * Sets feature. - * - * @param int $feature - * @return DocumentTemplateType - */ - protected function setFeature($feature) { - $this->feature = $feature; - - return $this; - } - - /** - * Returns group. - * - * - * - * @return \Wallee\Sdk\Model\DocumentTemplateTypeGroup - */ - public function getGroup() { - return $this->group; - } - - /** - * Sets group. - * - * @param \Wallee\Sdk\Model\DocumentTemplateTypeGroup $group - * @return DocumentTemplateType - */ - public function setGroup($group) { - $this->group = $group; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return DocumentTemplateType - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns title. - * - * - * - * @return map[string,string] - */ - public function getTitle() { - return $this->title; - } - - /** - * Sets title. - * - * @param map[string,string] $title - * @return DocumentTemplateType - */ - public function setTitle($title) { - if (is_array($title) && empty($title)) { - $this->title = new \stdClass; - } else { - $this->title = $title; - } - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class DocumentTemplateType implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'DocumentTemplateType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'description' => 'map[string,string]', + 'feature' => 'int', + 'group' => '\Wallee\Sdk\Model\DocumentTemplateTypeGroup', + 'id' => 'int', + 'title' => 'map[string,string]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'feature' => 'int64', + 'group' => null, + 'id' => 'int64', + 'title' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'feature' => 'feature', + 'group' => 'group', + 'id' => 'id', + 'title' => 'title' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'feature' => 'setFeature', + 'group' => 'setGroup', + 'id' => 'setId', + 'title' => 'setTitle' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'feature' => 'getFeature', + 'group' => 'getGroup', + 'id' => 'getId', + 'title' => 'getTitle' + ]; + + + + /** + * 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['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['feature'] = isset($data['feature']) ? $data['feature'] : null; + + $this->container['group'] = isset($data['group']) ? $data['group'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['title'] = isset($data['title']) ? $data['title'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets feature + * + * @return int + */ + public function getFeature() + { + return $this->container['feature']; + } + + /** + * Sets feature + * + * @param int $feature + * + * @return $this + */ + public function setFeature($feature) + { + $this->container['feature'] = $feature; + + return $this; + } + + + /** + * Gets group + * + * @return \Wallee\Sdk\Model\DocumentTemplateTypeGroup + */ + public function getGroup() + { + return $this->container['group']; + } + + /** + * Sets group + * + * @param \Wallee\Sdk\Model\DocumentTemplateTypeGroup $group + * + * @return $this + */ + public function setGroup($group) + { + $this->container['group'] = $group; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets title + * + * @return map[string,string] + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param map[string,string] $title + * + * @return $this + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + 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/wallee-sdk/lib/Model/DocumentTemplateTypeGroup.php b/wallee-sdk/lib/Model/DocumentTemplateTypeGroup.php index 647fb7b..060f942 100644 --- a/wallee-sdk/lib/Model/DocumentTemplateTypeGroup.php +++ b/wallee-sdk/lib/Model/DocumentTemplateTypeGroup.php @@ -1,10 +1,8 @@ 'int', - 'title' => 'map[string,string]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $title; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['title'])) { - $this->setTitle($data['title']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return DocumentTemplateTypeGroup - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns title. - * - * - * - * @return map[string,string] - */ - public function getTitle() { - return $this->title; - } - - /** - * Sets title. - * - * @param map[string,string] $title - * @return DocumentTemplateTypeGroup - */ - public function setTitle($title) { - if (is_array($title) && empty($title)) { - $this->title = new \stdClass; - } else { - $this->title = $title; - } - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class DocumentTemplateTypeGroup implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'DocumentTemplateTypeGroup'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'title' => 'map[string,string]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'title' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'title' => 'title' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'title' => 'setTitle' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'title' => 'getTitle' + ]; + + + + /** + * 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['title'] = isset($data['title']) ? $data['title'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets title + * + * @return map[string,string] + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param map[string,string] $title + * + * @return $this + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + 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/wallee-sdk/lib/Model/EmailSender.php b/wallee-sdk/lib/Model/EmailSender.php deleted file mode 100644 index 77e663b..0000000 --- a/wallee-sdk/lib/Model/EmailSender.php +++ /dev/null @@ -1,401 +0,0 @@ - 'bool', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'plannedPurgeDate' => '\DateTime', - 'senderAddress' => 'string', - 'senderName' => '\Wallee\Sdk\Model\DatabaseTranslatedString', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'type' => 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The default email sender is used whenever not different sender is specified in the space. - * - * @var bool - */ - private $defaultSender; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * The sender address is the email address from which you want to send the email to the customer. - * - * @var string - */ - private $senderAddress; - - /** - * The sender name is shown in the email. Choose an appropriate name as it will be displayed to your customer. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedString - */ - private $senderName; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * - * - * @var int - */ - private $type; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id']) && $data['id'] != null) { - $this->setId($data['id']); - } - if (isset($data['senderName']) && $data['senderName'] != null) { - $this->setSenderName($data['senderName']); - } - if (isset($data['state']) && $data['state'] != null) { - $this->setState($data['state']); - } - if (isset($data['version']) && $data['version'] != null) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns defaultSender. - * - * The default email sender is used whenever not different sender is specified in the space. - * - * @return bool - */ - public function getDefaultSender() { - return $this->defaultSender; - } - - /** - * Sets defaultSender. - * - * @param bool $defaultSender - * @return EmailSender - */ - protected function setDefaultSender($defaultSender) { - $this->defaultSender = $defaultSender; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return EmailSender - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return EmailSender - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return EmailSender - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns senderAddress. - * - * The sender address is the email address from which you want to send the email to the customer. - * - * @return string - */ - public function getSenderAddress() { - return $this->senderAddress; - } - - /** - * Sets senderAddress. - * - * @param string $senderAddress - * @return EmailSender - */ - protected function setSenderAddress($senderAddress) { - $this->senderAddress = $senderAddress; - - return $this; - } - - /** - * Returns senderName. - * - * The sender name is shown in the email. Choose an appropriate name as it will be displayed to your customer. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedString - */ - public function getSenderName() { - return $this->senderName; - } - - /** - * Sets senderName. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedString $senderName - * @return EmailSender - */ - public function setSenderName($senderName) { - $this->senderName = $senderName; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return EmailSender - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns type. - * - * - * - * @return int - */ - public function getType() { - return $this->type; - } - - /** - * Sets type. - * - * @param int $type - * @return EmailSender - */ - protected function setType($type) { - $this->type = $type; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return EmailSender - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - -} - diff --git a/wallee-sdk/lib/Model/EmailSenderType.php b/wallee-sdk/lib/Model/EmailSenderType.php deleted file mode 100644 index f9272b0..0000000 --- a/wallee-sdk/lib/Model/EmailSenderType.php +++ /dev/null @@ -1,240 +0,0 @@ - 'map[string,string]', - 'feature' => 'int', - 'id' => 'int', - 'name' => 'map[string,string]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * - * - * @var int - */ - private $feature; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $name; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description']) && $data['description'] != null) { - $this->setDescription($data['description']); - } - if (isset($data['name']) && $data['name'] != null) { - $this->setName($data['name']); - } - } - - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return EmailSenderType - */ - public function setDescription($description) { - $this->description = $description; - - return $this; - } - - /** - * Returns feature. - * - * - * - * @return int - */ - public function getFeature() { - return $this->feature; - } - - /** - * Sets feature. - * - * @param int $feature - * @return EmailSenderType - */ - protected function setFeature($feature) { - $this->feature = $feature; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return EmailSenderType - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return EmailSenderType - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - -} - diff --git a/wallee-sdk/lib/Model/EmailTemplate.php b/wallee-sdk/lib/Model/EmailTemplate.php deleted file mode 100644 index eaf867c..0000000 --- a/wallee-sdk/lib/Model/EmailTemplate.php +++ /dev/null @@ -1,540 +0,0 @@ - '\Wallee\Sdk\Model\DocumentTemplateType[]', - 'blindCarbonCopyRecipients' => 'string[]', - 'carbonCopyRecipients' => 'string[]', - 'htmlBodyTemplateResource' => '\Wallee\Sdk\Model\ModelResourcePath', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'name' => 'string', - 'plannedPurgeDate' => '\DateTime', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'subject' => '\Wallee\Sdk\Model\DatabaseTranslatedString', - 'textBodyTemplateResource' => '\Wallee\Sdk\Model\ModelResourcePath', - 'type' => 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\DocumentTemplateType[] - */ - private $attachedDocumentTemplateTypes; - - /** - * - * - * @var string[] - */ - private $blindCarbonCopyRecipients; - - /** - * - * - * @var string[] - */ - private $carbonCopyRecipients; - - /** - * The HTML body resource is used to produce the actual HTML message of the email. - * - * @var \Wallee\Sdk\Model\ModelResourcePath - */ - private $htmlBodyTemplateResource; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The template name is used internally to identify the template in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The subject is going to be shown to the customer as a title. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedString - */ - private $subject; - - /** - * The HTML body resource is used to produce the actual text message of the email. In case no resource is selected the HTML message is translated into the text format. - * - * @var \Wallee\Sdk\Model\ModelResourcePath - */ - private $textBodyTemplateResource; - - /** - * - * - * @var int - */ - private $type; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['attachedDocumentTemplateTypes']) && $data['attachedDocumentTemplateTypes'] != null) { - $this->setAttachedDocumentTemplateTypes($data['attachedDocumentTemplateTypes']); - } - if (isset($data['blindCarbonCopyRecipients']) && $data['blindCarbonCopyRecipients'] != null) { - $this->setBlindCarbonCopyRecipients($data['blindCarbonCopyRecipients']); - } - if (isset($data['carbonCopyRecipients']) && $data['carbonCopyRecipients'] != null) { - $this->setCarbonCopyRecipients($data['carbonCopyRecipients']); - } - if (isset($data['htmlBodyTemplateResource']) && $data['htmlBodyTemplateResource'] != null) { - $this->setHtmlBodyTemplateResource($data['htmlBodyTemplateResource']); - } - if (isset($data['id']) && $data['id'] != null) { - $this->setId($data['id']); - } - if (isset($data['state']) && $data['state'] != null) { - $this->setState($data['state']); - } - if (isset($data['subject']) && $data['subject'] != null) { - $this->setSubject($data['subject']); - } - if (isset($data['textBodyTemplateResource']) && $data['textBodyTemplateResource'] != null) { - $this->setTextBodyTemplateResource($data['textBodyTemplateResource']); - } - if (isset($data['version']) && $data['version'] != null) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns attachedDocumentTemplateTypes. - * - * - * - * @return \Wallee\Sdk\Model\DocumentTemplateType[] - */ - public function getAttachedDocumentTemplateTypes() { - return $this->attachedDocumentTemplateTypes; - } - - /** - * Sets attachedDocumentTemplateTypes. - * - * @param \Wallee\Sdk\Model\DocumentTemplateType[] $attachedDocumentTemplateTypes - * @return EmailTemplate - */ - public function setAttachedDocumentTemplateTypes($attachedDocumentTemplateTypes) { - $this->attachedDocumentTemplateTypes = $attachedDocumentTemplateTypes; - - return $this; - } - - /** - * Returns blindCarbonCopyRecipients. - * - * - * - * @return string[] - */ - public function getBlindCarbonCopyRecipients() { - return $this->blindCarbonCopyRecipients; - } - - /** - * Sets blindCarbonCopyRecipients. - * - * @param string[] $blindCarbonCopyRecipients - * @return EmailTemplate - */ - public function setBlindCarbonCopyRecipients($blindCarbonCopyRecipients) { - $this->blindCarbonCopyRecipients = $blindCarbonCopyRecipients; - - return $this; - } - - /** - * Returns carbonCopyRecipients. - * - * - * - * @return string[] - */ - public function getCarbonCopyRecipients() { - return $this->carbonCopyRecipients; - } - - /** - * Sets carbonCopyRecipients. - * - * @param string[] $carbonCopyRecipients - * @return EmailTemplate - */ - public function setCarbonCopyRecipients($carbonCopyRecipients) { - $this->carbonCopyRecipients = $carbonCopyRecipients; - - return $this; - } - - /** - * Returns htmlBodyTemplateResource. - * - * The HTML body resource is used to produce the actual HTML message of the email. - * - * @return \Wallee\Sdk\Model\ModelResourcePath - */ - public function getHtmlBodyTemplateResource() { - return $this->htmlBodyTemplateResource; - } - - /** - * Sets htmlBodyTemplateResource. - * - * @param \Wallee\Sdk\Model\ModelResourcePath $htmlBodyTemplateResource - * @return EmailTemplate - */ - public function setHtmlBodyTemplateResource($htmlBodyTemplateResource) { - $this->htmlBodyTemplateResource = $htmlBodyTemplateResource; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return EmailTemplate - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return EmailTemplate - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * The template name is used internally to identify the template in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return EmailTemplate - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return EmailTemplate - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return EmailTemplate - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns subject. - * - * The subject is going to be shown to the customer as a title. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedString - */ - public function getSubject() { - return $this->subject; - } - - /** - * Sets subject. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedString $subject - * @return EmailTemplate - */ - public function setSubject($subject) { - $this->subject = $subject; - - return $this; - } - - /** - * Returns textBodyTemplateResource. - * - * The HTML body resource is used to produce the actual text message of the email. In case no resource is selected the HTML message is translated into the text format. - * - * @return \Wallee\Sdk\Model\ModelResourcePath - */ - public function getTextBodyTemplateResource() { - return $this->textBodyTemplateResource; - } - - /** - * Sets textBodyTemplateResource. - * - * @param \Wallee\Sdk\Model\ModelResourcePath $textBodyTemplateResource - * @return EmailTemplate - */ - public function setTextBodyTemplateResource($textBodyTemplateResource) { - $this->textBodyTemplateResource = $textBodyTemplateResource; - - return $this; - } - - /** - * Returns type. - * - * - * - * @return int - */ - public function getType() { - return $this->type; - } - - /** - * Sets type. - * - * @param int $type - * @return EmailTemplate - */ - protected function setType($type) { - $this->type = $type; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return EmailTemplate - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - -} - diff --git a/wallee-sdk/lib/Model/EmailTemplateType.php b/wallee-sdk/lib/Model/EmailTemplateType.php deleted file mode 100644 index 3f1bd0b..0000000 --- a/wallee-sdk/lib/Model/EmailTemplateType.php +++ /dev/null @@ -1,404 +0,0 @@ - '\Wallee\Sdk\Model\AttachmentResource[]', - 'description' => 'map[string,string]', - 'documentAttachments' => '\Wallee\Sdk\Model\DocumentTemplateType[]', - 'feature' => 'int', - 'htmlBodyTemplateResource' => 'string', - 'id' => 'int', - 'name' => 'map[string,string]', - 'subject' => 'map[string,string]', - 'textBodyTemplateResource' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\AttachmentResource[] - */ - private $attachmentResources; - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * - * - * @var \Wallee\Sdk\Model\DocumentTemplateType[] - */ - private $documentAttachments; - - /** - * - * - * @var int - */ - private $feature; - - /** - * - * - * @var string - */ - private $htmlBodyTemplateResource; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $name; - - /** - * - * - * @var map[string,string] - */ - private $subject; - - /** - * - * - * @var string - */ - private $textBodyTemplateResource; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['attachmentResources']) && $data['attachmentResources'] != null) { - $this->setAttachmentResources($data['attachmentResources']); - } - if (isset($data['description']) && $data['description'] != null) { - $this->setDescription($data['description']); - } - if (isset($data['documentAttachments']) && $data['documentAttachments'] != null) { - $this->setDocumentAttachments($data['documentAttachments']); - } - if (isset($data['name']) && $data['name'] != null) { - $this->setName($data['name']); - } - if (isset($data['subject']) && $data['subject'] != null) { - $this->setSubject($data['subject']); - } - } - - - /** - * Returns attachmentResources. - * - * - * - * @return \Wallee\Sdk\Model\AttachmentResource[] - */ - public function getAttachmentResources() { - return $this->attachmentResources; - } - - /** - * Sets attachmentResources. - * - * @param \Wallee\Sdk\Model\AttachmentResource[] $attachmentResources - * @return EmailTemplateType - */ - public function setAttachmentResources($attachmentResources) { - $this->attachmentResources = $attachmentResources; - - return $this; - } - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return EmailTemplateType - */ - public function setDescription($description) { - $this->description = $description; - - return $this; - } - - /** - * Returns documentAttachments. - * - * - * - * @return \Wallee\Sdk\Model\DocumentTemplateType[] - */ - public function getDocumentAttachments() { - return $this->documentAttachments; - } - - /** - * Sets documentAttachments. - * - * @param \Wallee\Sdk\Model\DocumentTemplateType[] $documentAttachments - * @return EmailTemplateType - */ - public function setDocumentAttachments($documentAttachments) { - $this->documentAttachments = $documentAttachments; - - return $this; - } - - /** - * Returns feature. - * - * - * - * @return int - */ - public function getFeature() { - return $this->feature; - } - - /** - * Sets feature. - * - * @param int $feature - * @return EmailTemplateType - */ - protected function setFeature($feature) { - $this->feature = $feature; - - return $this; - } - - /** - * Returns htmlBodyTemplateResource. - * - * - * - * @return string - */ - public function getHtmlBodyTemplateResource() { - return $this->htmlBodyTemplateResource; - } - - /** - * Sets htmlBodyTemplateResource. - * - * @param string $htmlBodyTemplateResource - * @return EmailTemplateType - */ - protected function setHtmlBodyTemplateResource($htmlBodyTemplateResource) { - $this->htmlBodyTemplateResource = $htmlBodyTemplateResource; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return EmailTemplateType - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return EmailTemplateType - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns subject. - * - * - * - * @return map[string,string] - */ - public function getSubject() { - return $this->subject; - } - - /** - * Sets subject. - * - * @param map[string,string] $subject - * @return EmailTemplateType - */ - public function setSubject($subject) { - $this->subject = $subject; - - return $this; - } - - /** - * Returns textBodyTemplateResource. - * - * - * - * @return string - */ - public function getTextBodyTemplateResource() { - return $this->textBodyTemplateResource; - } - - /** - * Sets textBodyTemplateResource. - * - * @param string $textBodyTemplateResource - * @return EmailTemplateType - */ - protected function setTextBodyTemplateResource($textBodyTemplateResource) { - $this->textBodyTemplateResource = $textBodyTemplateResource; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - -} - diff --git a/wallee-sdk/lib/Model/EntityExportRequest.php b/wallee-sdk/lib/Model/EntityExportRequest.php index 145a0dd..a9655c0 100644 --- a/wallee-sdk/lib/Model/EntityExportRequest.php +++ b/wallee-sdk/lib/Model/EntityExportRequest.php @@ -1,10 +1,8 @@ 'string[]', - 'query' => '\Wallee\Sdk\Model\EntityQuery' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The properties is a list of property paths which should be exported. - * - * @var string[] - */ - private $properties; - - /** - * The query limits the returned entries. The query allows to restrict the entries to return and it allows to control the order of them. - * - * @var \Wallee\Sdk\Model\EntityQuery - */ - private $query; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['properties'])) { - $this->setProperties($data['properties']); - } - if (isset($data['query'])) { - $this->setQuery($data['query']); - } - } - - - /** - * Returns properties. - * - * The properties is a list of property paths which should be exported. - * - * @return string[] - */ - public function getProperties() { - return $this->properties; - } - - /** - * Sets properties. - * - * @param string[] $properties - * @return EntityExportRequest - */ - public function setProperties($properties) { - $this->properties = $properties; - - return $this; - } - - /** - * Returns query. - * - * The query limits the returned entries. The query allows to restrict the entries to return and it allows to control the order of them. - * - * @return \Wallee\Sdk\Model\EntityQuery - */ - public function getQuery() { - return $this->query; - } - - /** - * Sets query. - * - * @param \Wallee\Sdk\Model\EntityQuery $query - * @return EntityExportRequest - */ - public function setQuery($query) { - $this->query = $query; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getProperties() === null) { - throw new ValidationException("'properties' can't be null", 'properties', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class EntityExportRequest implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'EntityExportRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'properties' => 'string[]', + 'query' => '\Wallee\Sdk\Model\EntityQuery' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'properties' => null, + 'query' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'properties' => 'properties', + 'query' => 'query' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'properties' => 'setProperties', + 'query' => 'setQuery' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'properties' => 'getProperties', + 'query' => 'getQuery' + ]; + + + + /** + * 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['properties'] = isset($data['properties']) ? $data['properties'] : null; + + $this->container['query'] = isset($data['query']) ? $data['query'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['properties'] === null) { + $invalidProperties[] = "'properties' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 properties + * + * @return string[] + */ + public function getProperties() + { + return $this->container['properties']; + } + + /** + * Sets properties + * + * @param string[] $properties The properties is a list of property paths which should be exported. + * + * @return $this + */ + public function setProperties($properties) + { + $this->container['properties'] = $properties; + + return $this; + } + + + /** + * Gets query + * + * @return \Wallee\Sdk\Model\EntityQuery + */ + public function getQuery() + { + return $this->container['query']; + } + + /** + * Sets query + * + * @param \Wallee\Sdk\Model\EntityQuery $query The query limits the returned entries. The query allows to restrict the entries to return and it allows to control the order of them. + * + * @return $this + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + 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/wallee-sdk/lib/Model/EntityQuery.php b/wallee-sdk/lib/Model/EntityQuery.php index 4970e03..387501f 100644 --- a/wallee-sdk/lib/Model/EntityQuery.php +++ b/wallee-sdk/lib/Model/EntityQuery.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\EntityQueryFilter', - 'language' => 'string', - 'numberOfEntities' => 'int', - 'orderBys' => '\Wallee\Sdk\Model\EntityQueryOrderBy[]', - 'startingEntity' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The filter node defines the root filter node of the query. The root node may contain multiple sub nodes with different filters in it. - * - * @var \Wallee\Sdk\Model\EntityQueryFilter - */ - private $filter; - - /** - * The language is applied to the ordering of the entities returned. Some entity fields are language dependent and hence the language is required to order them. - * - * @var string - */ - private $language; - - /** - * The number of entities defines how many entities should be returned. There is a maximum of 100 entities. - * - * @var int - */ - private $numberOfEntities; - - /** - * The order bys allows to define the ordering of the entities returned by the search. - * - * @var \Wallee\Sdk\Model\EntityQueryOrderBy[] - */ - private $orderBys; - - /** - * The 'starting entity' defines the entity number at which the returned result should start. The entity number is the consecutive number of the entity as returned and it is not the entity id. - * - * @var int - */ - private $startingEntity; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['filter'])) { - $this->setFilter($data['filter']); - } - if (isset($data['language'])) { - $this->setLanguage($data['language']); - } - if (isset($data['numberOfEntities'])) { - $this->setNumberOfEntities($data['numberOfEntities']); - } - if (isset($data['orderBys'])) { - $this->setOrderBys($data['orderBys']); - } - if (isset($data['startingEntity'])) { - $this->setStartingEntity($data['startingEntity']); - } - } - - - /** - * Returns filter. - * - * The filter node defines the root filter node of the query. The root node may contain multiple sub nodes with different filters in it. - * - * @return \Wallee\Sdk\Model\EntityQueryFilter - */ - public function getFilter() { - return $this->filter; - } - - /** - * Sets filter. - * - * @param \Wallee\Sdk\Model\EntityQueryFilter $filter - * @return EntityQuery - */ - public function setFilter($filter) { - $this->filter = $filter; - - return $this; - } - - /** - * Returns language. - * - * The language is applied to the ordering of the entities returned. Some entity fields are language dependent and hence the language is required to order them. - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return EntityQuery - */ - public function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns numberOfEntities. - * - * The number of entities defines how many entities should be returned. There is a maximum of 100 entities. - * - * @return int - */ - public function getNumberOfEntities() { - return $this->numberOfEntities; - } - - /** - * Sets numberOfEntities. - * - * @param int $numberOfEntities - * @return EntityQuery - */ - public function setNumberOfEntities($numberOfEntities) { - $this->numberOfEntities = $numberOfEntities; - - return $this; - } - - /** - * Returns orderBys. - * - * The order bys allows to define the ordering of the entities returned by the search. - * - * @return \Wallee\Sdk\Model\EntityQueryOrderBy[] - */ - public function getOrderBys() { - return $this->orderBys; - } - - /** - * Sets orderBys. - * - * @param \Wallee\Sdk\Model\EntityQueryOrderBy[] $orderBys - * @return EntityQuery - */ - public function setOrderBys($orderBys) { - $this->orderBys = $orderBys; - - return $this; - } - - /** - * Returns startingEntity. - * - * The 'starting entity' defines the entity number at which the returned result should start. The entity number is the consecutive number of the entity as returned and it is not the entity id. - * - * @return int - */ - public function getStartingEntity() { - return $this->startingEntity; - } - - /** - * Sets startingEntity. - * - * @param int $startingEntity - * @return EntityQuery - */ - public function setStartingEntity($startingEntity) { - $this->startingEntity = $startingEntity; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class EntityQuery implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'EntityQuery'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'filter' => '\Wallee\Sdk\Model\EntityQueryFilter', + 'language' => 'string', + 'number_of_entities' => 'int', + 'order_bys' => '\Wallee\Sdk\Model\EntityQueryOrderBy[]', + 'starting_entity' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'filter' => null, + 'language' => null, + 'number_of_entities' => 'int32', + 'order_bys' => null, + 'starting_entity' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'filter' => 'filter', + 'language' => 'language', + 'number_of_entities' => 'numberOfEntities', + 'order_bys' => 'orderBys', + 'starting_entity' => 'startingEntity' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'filter' => 'setFilter', + 'language' => 'setLanguage', + 'number_of_entities' => 'setNumberOfEntities', + 'order_bys' => 'setOrderBys', + 'starting_entity' => 'setStartingEntity' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'filter' => 'getFilter', + 'language' => 'getLanguage', + 'number_of_entities' => 'getNumberOfEntities', + 'order_bys' => 'getOrderBys', + 'starting_entity' => 'getStartingEntity' + ]; + + + + /** + * 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['filter'] = isset($data['filter']) ? $data['filter'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['number_of_entities'] = isset($data['number_of_entities']) ? $data['number_of_entities'] : null; + + $this->container['order_bys'] = isset($data['order_bys']) ? $data['order_bys'] : null; + + $this->container['starting_entity'] = isset($data['starting_entity']) ? $data['starting_entity'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 filter + * + * @return \Wallee\Sdk\Model\EntityQueryFilter + */ + public function getFilter() + { + return $this->container['filter']; + } + + /** + * Sets filter + * + * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter node defines the root filter node of the query. The root node may contain multiple sub nodes with different filters in it. + * + * @return $this + */ + public function setFilter($filter) + { + $this->container['filter'] = $filter; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language The language is applied to the ordering of the entities returned. Some entity fields are language dependent and hence the language is required to order them. + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets number_of_entities + * + * @return int + */ + public function getNumberOfEntities() + { + return $this->container['number_of_entities']; + } + + /** + * Sets number_of_entities + * + * @param int $number_of_entities The number of entities defines how many entities should be returned. There is a maximum of 100 entities. + * + * @return $this + */ + public function setNumberOfEntities($number_of_entities) + { + $this->container['number_of_entities'] = $number_of_entities; + + return $this; + } + + + /** + * Gets order_bys + * + * @return \Wallee\Sdk\Model\EntityQueryOrderBy[] + */ + public function getOrderBys() + { + return $this->container['order_bys']; + } + + /** + * Sets order_bys + * + * @param \Wallee\Sdk\Model\EntityQueryOrderBy[] $order_bys The order bys allows to define the ordering of the entities returned by the search. + * + * @return $this + */ + public function setOrderBys($order_bys) + { + $this->container['order_bys'] = $order_bys; + + return $this; + } + + + /** + * Gets starting_entity + * + * @return int + */ + public function getStartingEntity() + { + return $this->container['starting_entity']; + } + + /** + * Sets starting_entity + * + * @param int $starting_entity The 'starting entity' defines the entity number at which the returned result should start. The entity number is the consecutive number of the entity as returned and it is not the entity id. + * + * @return $this + */ + public function setStartingEntity($starting_entity) + { + $this->container['starting_entity'] = $starting_entity; + + 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/wallee-sdk/lib/Model/EntityQueryFilter.php b/wallee-sdk/lib/Model/EntityQueryFilter.php index ce7eb73..e29e3f9 100644 --- a/wallee-sdk/lib/Model/EntityQueryFilter.php +++ b/wallee-sdk/lib/Model/EntityQueryFilter.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\EntityQueryFilter[]', - 'fieldName' => 'string', - 'operator' => '\Wallee\Sdk\Model\CriteriaOperator', - 'type' => '\Wallee\Sdk\Model\EntityQueryFilterType', - 'value' => 'object' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The 'children' can contain other filter nodes which are applied to the query. This property is only applicable on filter types 'OR' and 'AND'. - * - * @var \Wallee\Sdk\Model\EntityQueryFilter[] - */ - private $children; - - /** - * The 'fieldName' indicates the property on the entity which should be filtered. This property is only applicable on filter type 'LEAF'. - * - * @var string - */ - private $fieldName; - - /** - * The 'operator' indicates what kind of filtering on the 'fieldName' is executed on. This property is only applicable on filter type 'LEAF'. - * - * @var \Wallee\Sdk\Model\CriteriaOperator - */ - private $operator; - - /** - * The filter type controls how the query node is interpreted. I.e. if the node acts as leaf node or as a filter group. - * - * @var \Wallee\Sdk\Model\EntityQueryFilterType - */ - private $type; - - /** - * The 'value' is used to compare with the 'fieldName' as defined by the 'operator'. This property is only applicable on filter type 'LEAF'. - * - * @var object - */ - private $value; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['children'])) { - $this->setChildren($data['children']); - } - if (isset($data['fieldName'])) { - $this->setFieldName($data['fieldName']); - } - if (isset($data['operator'])) { - $this->setOperator($data['operator']); - } - if (isset($data['type'])) { - $this->setType($data['type']); - } - if (isset($data['value'])) { - $this->setValue($data['value']); - } - } - - - /** - * Returns children. - * - * The 'children' can contain other filter nodes which are applied to the query. This property is only applicable on filter types 'OR' and 'AND'. - * - * @return \Wallee\Sdk\Model\EntityQueryFilter[] - */ - public function getChildren() { - return $this->children; - } - - /** - * Sets children. - * - * @param \Wallee\Sdk\Model\EntityQueryFilter[] $children - * @return EntityQueryFilter - */ - public function setChildren($children) { - $this->children = $children; - - return $this; - } - - /** - * Returns fieldName. - * - * The 'fieldName' indicates the property on the entity which should be filtered. This property is only applicable on filter type 'LEAF'. - * - * @return string - */ - public function getFieldName() { - return $this->fieldName; - } - - /** - * Sets fieldName. - * - * @param string $fieldName - * @return EntityQueryFilter - */ - public function setFieldName($fieldName) { - $this->fieldName = $fieldName; - - return $this; - } - - /** - * Returns operator. - * - * The 'operator' indicates what kind of filtering on the 'fieldName' is executed on. This property is only applicable on filter type 'LEAF'. - * - * @return \Wallee\Sdk\Model\CriteriaOperator - */ - public function getOperator() { - return $this->operator; - } - - /** - * Sets operator. - * - * @param \Wallee\Sdk\Model\CriteriaOperator $operator - * @return EntityQueryFilter - */ - public function setOperator($operator) { - $this->operator = $operator; - - return $this; - } - - /** - * Returns type. - * - * The filter type controls how the query node is interpreted. I.e. if the node acts as leaf node or as a filter group. - * - * @return \Wallee\Sdk\Model\EntityQueryFilterType - */ - public function getType() { - return $this->type; - } - - /** - * Sets type. - * - * @param \Wallee\Sdk\Model\EntityQueryFilterType $type - * @return EntityQueryFilter - */ - public function setType($type) { - $this->type = $type; - - return $this; - } - - /** - * Returns value. - * - * The 'value' is used to compare with the 'fieldName' as defined by the 'operator'. This property is only applicable on filter type 'LEAF'. - * - * @return object - */ - public function getValue() { - return $this->value; - } - - /** - * Sets value. - * - * @param object $value - * @return EntityQueryFilter - */ - public function setValue($value) { - $this->value = $value; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getType() === null) { - throw new ValidationException("'type' can't be null", 'type', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class EntityQueryFilter implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'EntityQueryFilter'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'children' => '\Wallee\Sdk\Model\EntityQueryFilter[]', + 'field_name' => 'string', + 'operator' => '\Wallee\Sdk\Model\CriteriaOperator', + 'type' => '\Wallee\Sdk\Model\EntityQueryFilterType', + 'value' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'children' => null, + 'field_name' => null, + 'operator' => null, + 'type' => null, + 'value' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'children' => 'children', + 'field_name' => 'fieldName', + 'operator' => 'operator', + 'type' => 'type', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'children' => 'setChildren', + 'field_name' => 'setFieldName', + 'operator' => 'setOperator', + 'type' => 'setType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'children' => 'getChildren', + 'field_name' => 'getFieldName', + 'operator' => 'getOperator', + 'type' => 'getType', + 'value' => 'getValue' + ]; + + + + /** + * 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['children'] = isset($data['children']) ? $data['children'] : null; + + $this->container['field_name'] = isset($data['field_name']) ? $data['field_name'] : null; + + $this->container['operator'] = isset($data['operator']) ? $data['operator'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + $this->container['value'] = isset($data['value']) ? $data['value'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 children + * + * @return \Wallee\Sdk\Model\EntityQueryFilter[] + */ + public function getChildren() + { + return $this->container['children']; + } + + /** + * Sets children + * + * @param \Wallee\Sdk\Model\EntityQueryFilter[] $children The 'children' can contain other filter nodes which are applied to the query. This property is only applicable on filter types 'OR' and 'AND'. + * + * @return $this + */ + public function setChildren($children) + { + $this->container['children'] = $children; + + return $this; + } + + + /** + * Gets field_name + * + * @return string + */ + public function getFieldName() + { + return $this->container['field_name']; + } + + /** + * Sets field_name + * + * @param string $field_name The 'fieldName' indicates the property on the entity which should be filtered. This property is only applicable on filter type 'LEAF'. + * + * @return $this + */ + public function setFieldName($field_name) + { + $this->container['field_name'] = $field_name; + + return $this; + } + + + /** + * Gets operator + * + * @return \Wallee\Sdk\Model\CriteriaOperator + */ + public function getOperator() + { + return $this->container['operator']; + } + + /** + * Sets operator + * + * @param \Wallee\Sdk\Model\CriteriaOperator $operator The 'operator' indicates what kind of filtering on the 'fieldName' is executed on. This property is only applicable on filter type 'LEAF'. + * + * @return $this + */ + public function setOperator($operator) + { + $this->container['operator'] = $operator; + + return $this; + } + + + /** + * Gets type + * + * @return \Wallee\Sdk\Model\EntityQueryFilterType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Wallee\Sdk\Model\EntityQueryFilterType $type The filter type controls how the query node is interpreted. I.e. if the node acts as leaf node or as a filter group. + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + + /** + * Gets value + * + * @return object + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param object $value The 'value' is used to compare with the 'fieldName' as defined by the 'operator'. This property is only applicable on filter type 'LEAF'. + * + * @return $this + */ + public function setValue($value) + { + $this->container['value'] = $value; + + 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/wallee-sdk/lib/Model/EntityQueryFilterType.php b/wallee-sdk/lib/Model/EntityQueryFilterType.php index 6b8fbd9..51dbaa2 100644 --- a/wallee-sdk/lib/Model/EntityQueryFilterType.php +++ b/wallee-sdk/lib/Model/EntityQueryFilterType.php @@ -1,10 +1,8 @@ 'string', - 'sorting' => '\Wallee\Sdk\Model\EntityQueryOrderByType' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var string - */ - private $fieldName; - - /** - * - * - * @var \Wallee\Sdk\Model\EntityQueryOrderByType - */ - private $sorting; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['fieldName'])) { - $this->setFieldName($data['fieldName']); - } - if (isset($data['sorting'])) { - $this->setSorting($data['sorting']); - } - } - - - /** - * Returns fieldName. - * - * - * - * @return string - */ - public function getFieldName() { - return $this->fieldName; - } - - /** - * Sets fieldName. - * - * @param string $fieldName - * @return EntityQueryOrderBy - */ - public function setFieldName($fieldName) { - $this->fieldName = $fieldName; - - return $this; - } - - /** - * Returns sorting. - * - * - * - * @return \Wallee\Sdk\Model\EntityQueryOrderByType - */ - public function getSorting() { - return $this->sorting; - } - - /** - * Sets sorting. - * - * @param \Wallee\Sdk\Model\EntityQueryOrderByType $sorting - * @return EntityQueryOrderBy - */ - public function setSorting($sorting) { - $this->sorting = $sorting; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getFieldName() === null) { - throw new ValidationException("'fieldName' can't be null", 'fieldName', $this); - } - if ($this->getSorting() === null) { - throw new ValidationException("'sorting' can't be null", 'sorting', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class EntityQueryOrderBy implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'EntityQueryOrderBy'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'field_name' => 'string', + 'sorting' => '\Wallee\Sdk\Model\EntityQueryOrderByType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'field_name' => null, + 'sorting' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'field_name' => 'fieldName', + 'sorting' => 'sorting' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'field_name' => 'setFieldName', + 'sorting' => 'setSorting' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'field_name' => 'getFieldName', + 'sorting' => 'getSorting' + ]; + + + + /** + * 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['field_name'] = isset($data['field_name']) ? $data['field_name'] : null; + + $this->container['sorting'] = isset($data['sorting']) ? $data['sorting'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['field_name'] === null) { + $invalidProperties[] = "'field_name' can't be null"; + } + if ($this->container['sorting'] === null) { + $invalidProperties[] = "'sorting' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 field_name + * + * @return string + */ + public function getFieldName() + { + return $this->container['field_name']; + } + + /** + * Sets field_name + * + * @param string $field_name + * + * @return $this + */ + public function setFieldName($field_name) + { + $this->container['field_name'] = $field_name; + + return $this; + } + + + /** + * Gets sorting + * + * @return \Wallee\Sdk\Model\EntityQueryOrderByType + */ + public function getSorting() + { + return $this->container['sorting']; + } + + /** + * Sets sorting + * + * @param \Wallee\Sdk\Model\EntityQueryOrderByType $sorting + * + * @return $this + */ + public function setSorting($sorting) + { + $this->container['sorting'] = $sorting; + + 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/wallee-sdk/lib/Model/EntityQueryOrderByType.php b/wallee-sdk/lib/Model/EntityQueryOrderByType.php index de5af3a..329820b 100644 --- a/wallee-sdk/lib/Model/EntityQueryOrderByType.php +++ b/wallee-sdk/lib/Model/EntityQueryOrderByType.php @@ -1,10 +1,8 @@ validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - -} - diff --git a/wallee-sdk/lib/Model/Environment.php b/wallee-sdk/lib/Model/Environment.php index d1c20d4..8728c54 100644 --- a/wallee-sdk/lib/Model/Environment.php +++ b/wallee-sdk/lib/Model/Environment.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\FailureCategory', - 'description' => 'map[string,string]', - 'features' => 'int[]', - 'id' => 'int', - 'name' => 'map[string,string]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\FailureCategory - */ - private $category; - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * - * - * @var int[] - */ - private $features; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $name; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['category'])) { - $this->setCategory($data['category']); - } - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['features'])) { - $this->setFeatures($data['features']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - } - - - /** - * Returns category. - * - * - * - * @return \Wallee\Sdk\Model\FailureCategory - */ - public function getCategory() { - return $this->category; - } - - /** - * Sets category. - * - * @param \Wallee\Sdk\Model\FailureCategory $category - * @return FailureReason - */ - public function setCategory($category) { - $this->category = $category; - - return $this; - } - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return FailureReason - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns features. - * - * - * - * @return int[] - */ - public function getFeatures() { - return $this->features; - } - - /** - * Sets features. - * - * @param int[] $features - * @return FailureReason - */ - public function setFeatures($features) { - $this->features = $features; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return FailureReason - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return FailureReason - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class FailureReason implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'FailureReason'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'category' => '\Wallee\Sdk\Model\FailureCategory', + 'description' => 'map[string,string]', + 'features' => 'int[]', + 'id' => 'int', + 'name' => 'map[string,string]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'category' => null, + 'description' => null, + 'features' => 'int64', + 'id' => 'int64', + 'name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'category' => 'category', + 'description' => 'description', + 'features' => 'features', + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'category' => 'setCategory', + 'description' => 'setDescription', + 'features' => 'setFeatures', + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'category' => 'getCategory', + 'description' => 'getDescription', + 'features' => 'getFeatures', + 'id' => 'getId', + 'name' => 'getName' + ]; + + + + /** + * 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['category'] = isset($data['category']) ? $data['category'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['features'] = isset($data['features']) ? $data['features'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets category + * + * @return \Wallee\Sdk\Model\FailureCategory + */ + public function getCategory() + { + return $this->container['category']; + } + + /** + * Sets category + * + * @param \Wallee\Sdk\Model\FailureCategory $category + * + * @return $this + */ + public function setCategory($category) + { + $this->container['category'] = $category; + + return $this; + } + + + /** + * Gets description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets features + * + * @return int[] + */ + public function getFeatures() + { + return $this->container['features']; + } + + /** + * Sets features + * + * @param int[] $features + * + * @return $this + */ + public function setFeatures($features) + { + $this->container['features'] = $features; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + 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/wallee-sdk/lib/Model/Feature.php b/wallee-sdk/lib/Model/Feature.php index 22c6f74..a82d41c 100644 --- a/wallee-sdk/lib/Model/Feature.php +++ b/wallee-sdk/lib/Model/Feature.php @@ -1,10 +1,8 @@ 'bool', - 'description' => 'map[string,string]', - 'id' => 'int', - 'logoPath' => 'string', - 'name' => 'map[string,string]', - 'requiredFeatures' => 'int[]', - 'sortOrder' => 'int', - 'visible' => 'bool' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var bool - */ - private $beta; - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var string - */ - private $logoPath; - - /** - * - * - * @var map[string,string] - */ - private $name; - - /** - * - * - * @var int[] - */ - private $requiredFeatures; - - /** - * - * - * @var int - */ - private $sortOrder; - - /** - * - * - * @var bool - */ - private $visible; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['requiredFeatures'])) { - $this->setRequiredFeatures($data['requiredFeatures']); - } - } - - - /** - * Returns beta. - * - * - * - * @return bool - */ - public function getBeta() { - return $this->beta; - } - - /** - * Sets beta. - * - * @param bool $beta - * @return Feature - */ - protected function setBeta($beta) { - $this->beta = $beta; - - return $this; - } - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return Feature - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return Feature - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns logoPath. - * - * - * - * @return string - */ - public function getLogoPath() { - return $this->logoPath; - } - - /** - * Sets logoPath. - * - * @param string $logoPath - * @return Feature - */ - protected function setLogoPath($logoPath) { - $this->logoPath = $logoPath; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return Feature - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Returns requiredFeatures. - * - * - * - * @return int[] - */ - public function getRequiredFeatures() { - return $this->requiredFeatures; - } - - /** - * Sets requiredFeatures. - * - * @param int[] $requiredFeatures - * @return Feature - */ - public function setRequiredFeatures($requiredFeatures) { - $this->requiredFeatures = $requiredFeatures; - - return $this; - } - - /** - * Returns sortOrder. - * - * - * - * @return int - */ - public function getSortOrder() { - return $this->sortOrder; - } - - /** - * Sets sortOrder. - * - * @param int $sortOrder - * @return Feature - */ - protected function setSortOrder($sortOrder) { - $this->sortOrder = $sortOrder; - - return $this; - } - - /** - * Returns visible. - * - * - * - * @return bool - */ - public function getVisible() { - return $this->visible; - } - - /** - * Sets visible. - * - * @param bool $visible - * @return Feature - */ - protected function setVisible($visible) { - $this->visible = $visible; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class Feature implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Feature'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'beta' => 'bool', + 'description' => 'map[string,string]', + 'id' => 'int', + 'logo_path' => 'string', + 'name' => 'map[string,string]', + 'required_features' => 'int[]', + 'sort_order' => 'int', + 'visible' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'beta' => null, + 'description' => null, + 'id' => 'int64', + 'logo_path' => null, + 'name' => null, + 'required_features' => 'int64', + 'sort_order' => 'int32', + 'visible' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'beta' => 'beta', + 'description' => 'description', + 'id' => 'id', + 'logo_path' => 'logoPath', + 'name' => 'name', + 'required_features' => 'requiredFeatures', + 'sort_order' => 'sortOrder', + 'visible' => 'visible' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'beta' => 'setBeta', + 'description' => 'setDescription', + 'id' => 'setId', + 'logo_path' => 'setLogoPath', + 'name' => 'setName', + 'required_features' => 'setRequiredFeatures', + 'sort_order' => 'setSortOrder', + 'visible' => 'setVisible' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'beta' => 'getBeta', + 'description' => 'getDescription', + 'id' => 'getId', + 'logo_path' => 'getLogoPath', + 'name' => 'getName', + 'required_features' => 'getRequiredFeatures', + 'sort_order' => 'getSortOrder', + 'visible' => 'getVisible' + ]; + + + + /** + * 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['beta'] = isset($data['beta']) ? $data['beta'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['logo_path'] = isset($data['logo_path']) ? $data['logo_path'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['required_features'] = isset($data['required_features']) ? $data['required_features'] : null; + + $this->container['sort_order'] = isset($data['sort_order']) ? $data['sort_order'] : null; + + $this->container['visible'] = isset($data['visible']) ? $data['visible'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 beta + * + * @return bool + */ + public function getBeta() + { + return $this->container['beta']; + } + + /** + * Sets beta + * + * @param bool $beta + * + * @return $this + */ + public function setBeta($beta) + { + $this->container['beta'] = $beta; + + return $this; + } + + + /** + * Gets description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets logo_path + * + * @return string + */ + public function getLogoPath() + { + return $this->container['logo_path']; + } + + /** + * Sets logo_path + * + * @param string $logo_path + * + * @return $this + */ + public function setLogoPath($logo_path) + { + $this->container['logo_path'] = $logo_path; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets required_features + * + * @return int[] + */ + public function getRequiredFeatures() + { + return $this->container['required_features']; + } + + /** + * Sets required_features + * + * @param int[] $required_features + * + * @return $this + */ + public function setRequiredFeatures($required_features) + { + $this->container['required_features'] = $required_features; + + return $this; + } + + + /** + * Gets sort_order + * + * @return int + */ + public function getSortOrder() + { + return $this->container['sort_order']; + } + + /** + * Sets sort_order + * + * @param int $sort_order + * + * @return $this + */ + public function setSortOrder($sort_order) + { + $this->container['sort_order'] = $sort_order; + + return $this; + } + + + /** + * Gets visible + * + * @return bool + */ + public function getVisible() + { + return $this->container['visible']; + } + + /** + * Sets visible + * + * @param bool $visible + * + * @return $this + */ + public function setVisible($visible) + { + $this->container['visible'] = $visible; + + 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/wallee-sdk/lib/Model/Gender.php b/wallee-sdk/lib/Model/Gender.php index 2beec19..fdf7112 100644 --- a/wallee-sdk/lib/Model/Gender.php +++ b/wallee-sdk/lib/Model/Gender.php @@ -1,10 +1,8 @@ 'string', - 'emailAddressVerified' => 'bool', - 'firstname' => 'string', - 'language' => 'string', - 'lastname' => 'string', - 'mobilePhoneNumber' => 'string', - 'mobilePhoneVerified' => 'bool', - 'primaryAccount' => '\Wallee\Sdk\Model\Account', - 'scope' => '\Wallee\Sdk\Model\Scope', - 'timeZone' => 'string', - 'twoFactorEnabled' => 'bool', - 'twoFactorType' => '\Wallee\Sdk\Model\TwoFactorAuthenticationType' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The email address of the user. - * - * @var string - */ - private $emailAddress; - - /** - * Defines whether a user is verified or not. - * - * @var bool - */ - private $emailAddressVerified; - - /** - * The first name of the user. - * - * @var string - */ - private $firstname; - - /** - * The preferred language of the user. - * - * @var string - */ - private $language; - - /** - * The last name of the user. - * - * @var string - */ - private $lastname; - - /** - * - * - * @var string - */ - private $mobilePhoneNumber; - - /** - * Defines whether a users mobile phone number is verified or not. - * - * @var bool - */ - private $mobilePhoneVerified; - - /** - * The primary account links the user to a specific account. - * - * @var \Wallee\Sdk\Model\Account - */ - private $primaryAccount; - - /** - * The scope to which the user belongs to. - * - * @var \Wallee\Sdk\Model\Scope - */ - private $scope; - - /** - * The time zone which is applied for the user. If no timezone is specified the browser is used to determine an appropriate time zone. - * - * @var string - */ - private $timeZone; - - /** - * Defines whether two-factor authentication is enabled for this user. - * - * @var bool - */ - private $twoFactorEnabled; - - /** - * - * - * @var \Wallee\Sdk\Model\TwoFactorAuthenticationType - */ - private $twoFactorType; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['primaryAccount'])) { - $this->setPrimaryAccount($data['primaryAccount']); - } - if (isset($data['scope'])) { - $this->setScope($data['scope']); - } - if (isset($data['twoFactorType'])) { - $this->setTwoFactorType($data['twoFactorType']); - } - } - - - /** - * Returns emailAddress. - * - * The email address of the user. - * - * @return string - */ - public function getEmailAddress() { - return $this->emailAddress; - } - - /** - * Sets emailAddress. - * - * @param string $emailAddress - * @return HumanUser - */ - protected function setEmailAddress($emailAddress) { - $this->emailAddress = $emailAddress; - - return $this; - } - - /** - * Returns emailAddressVerified. - * - * Defines whether a user is verified or not. - * - * @return bool - */ - public function getEmailAddressVerified() { - return $this->emailAddressVerified; - } - - /** - * Sets emailAddressVerified. - * - * @param bool $emailAddressVerified - * @return HumanUser - */ - protected function setEmailAddressVerified($emailAddressVerified) { - $this->emailAddressVerified = $emailAddressVerified; - - return $this; - } - - /** - * Returns firstname. - * - * The first name of the user. - * - * @return string - */ - public function getFirstname() { - return $this->firstname; - } - - /** - * Sets firstname. - * - * @param string $firstname - * @return HumanUser - */ - protected function setFirstname($firstname) { - $this->firstname = $firstname; - - return $this; - } - - /** - * Returns language. - * - * The preferred language of the user. - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return HumanUser - */ - protected function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns lastname. - * - * The last name of the user. - * - * @return string - */ - public function getLastname() { - return $this->lastname; - } - - /** - * Sets lastname. - * - * @param string $lastname - * @return HumanUser - */ - protected function setLastname($lastname) { - $this->lastname = $lastname; - - return $this; - } - - /** - * Returns mobilePhoneNumber. - * - * - * - * @return string - */ - public function getMobilePhoneNumber() { - return $this->mobilePhoneNumber; - } - - /** - * Sets mobilePhoneNumber. - * - * @param string $mobilePhoneNumber - * @return HumanUser - */ - protected function setMobilePhoneNumber($mobilePhoneNumber) { - $this->mobilePhoneNumber = $mobilePhoneNumber; - - return $this; - } - - /** - * Returns mobilePhoneVerified. - * - * Defines whether a users mobile phone number is verified or not. - * - * @return bool - */ - public function getMobilePhoneVerified() { - return $this->mobilePhoneVerified; - } - - /** - * Sets mobilePhoneVerified. - * - * @param bool $mobilePhoneVerified - * @return HumanUser - */ - protected function setMobilePhoneVerified($mobilePhoneVerified) { - $this->mobilePhoneVerified = $mobilePhoneVerified; - - return $this; - } - - /** - * Returns primaryAccount. - * - * The primary account links the user to a specific account. - * - * @return \Wallee\Sdk\Model\Account - */ - public function getPrimaryAccount() { - return $this->primaryAccount; - } - - /** - * Sets primaryAccount. - * - * @param \Wallee\Sdk\Model\Account $primaryAccount - * @return HumanUser - */ - public function setPrimaryAccount($primaryAccount) { - $this->primaryAccount = $primaryAccount; - - return $this; - } - - /** - * Returns scope. - * - * The scope to which the user belongs to. - * - * @return \Wallee\Sdk\Model\Scope - */ - public function getScope() { - return $this->scope; - } - - /** - * Sets scope. - * - * @param \Wallee\Sdk\Model\Scope $scope - * @return HumanUser - */ - public function setScope($scope) { - $this->scope = $scope; - - return $this; - } - - /** - * Returns timeZone. - * - * The time zone which is applied for the user. If no timezone is specified the browser is used to determine an appropriate time zone. - * - * @return string - */ - public function getTimeZone() { - return $this->timeZone; - } - - /** - * Sets timeZone. - * - * @param string $timeZone - * @return HumanUser - */ - protected function setTimeZone($timeZone) { - $this->timeZone = $timeZone; - - return $this; - } - - /** - * Returns twoFactorEnabled. - * - * Defines whether two-factor authentication is enabled for this user. - * - * @return bool - */ - public function getTwoFactorEnabled() { - return $this->twoFactorEnabled; - } - - /** - * Sets twoFactorEnabled. - * - * @param bool $twoFactorEnabled - * @return HumanUser - */ - protected function setTwoFactorEnabled($twoFactorEnabled) { - $this->twoFactorEnabled = $twoFactorEnabled; - - return $this; - } - - /** - * Returns twoFactorType. - * - * - * - * @return \Wallee\Sdk\Model\TwoFactorAuthenticationType - */ - public function getTwoFactorType() { - return $this->twoFactorType; - } - - /** - * Sets twoFactorType. - * - * @param \Wallee\Sdk\Model\TwoFactorAuthenticationType $twoFactorType - * @return HumanUser - */ - public function setTwoFactorType($twoFactorType) { - $this->twoFactorType = $twoFactorType; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class HumanUser implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'HumanUser'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'email_address' => 'string', + 'email_address_verified' => 'bool', + 'firstname' => 'string', + 'language' => 'string', + 'lastname' => 'string', + 'mobile_phone_number' => 'string', + 'mobile_phone_verified' => 'bool', + 'primary_account' => '\Wallee\Sdk\Model\Account', + 'scope' => '\Wallee\Sdk\Model\Scope', + 'time_zone' => 'string', + 'two_factor_enabled' => 'bool', + 'two_factor_type' => '\Wallee\Sdk\Model\TwoFactorAuthenticationType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'email_address' => null, + 'email_address_verified' => null, + 'firstname' => null, + 'language' => null, + 'lastname' => null, + 'mobile_phone_number' => null, + 'mobile_phone_verified' => null, + 'primary_account' => null, + 'scope' => null, + 'time_zone' => null, + 'two_factor_enabled' => null, + 'two_factor_type' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email_address' => 'emailAddress', + 'email_address_verified' => 'emailAddressVerified', + 'firstname' => 'firstname', + 'language' => 'language', + 'lastname' => 'lastname', + 'mobile_phone_number' => 'mobilePhoneNumber', + 'mobile_phone_verified' => 'mobilePhoneVerified', + 'primary_account' => 'primaryAccount', + 'scope' => 'scope', + 'time_zone' => 'timeZone', + 'two_factor_enabled' => 'twoFactorEnabled', + 'two_factor_type' => 'twoFactorType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email_address' => 'setEmailAddress', + 'email_address_verified' => 'setEmailAddressVerified', + 'firstname' => 'setFirstname', + 'language' => 'setLanguage', + 'lastname' => 'setLastname', + 'mobile_phone_number' => 'setMobilePhoneNumber', + 'mobile_phone_verified' => 'setMobilePhoneVerified', + 'primary_account' => 'setPrimaryAccount', + 'scope' => 'setScope', + 'time_zone' => 'setTimeZone', + 'two_factor_enabled' => 'setTwoFactorEnabled', + 'two_factor_type' => 'setTwoFactorType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email_address' => 'getEmailAddress', + 'email_address_verified' => 'getEmailAddressVerified', + 'firstname' => 'getFirstname', + 'language' => 'getLanguage', + 'lastname' => 'getLastname', + 'mobile_phone_number' => 'getMobilePhoneNumber', + 'mobile_phone_verified' => 'getMobilePhoneVerified', + 'primary_account' => 'getPrimaryAccount', + 'scope' => 'getScope', + 'time_zone' => 'getTimeZone', + 'two_factor_enabled' => 'getTwoFactorEnabled', + 'two_factor_type' => 'getTwoFactorType' + ]; + + + + /** + * 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['email_address'] = isset($data['email_address']) ? $data['email_address'] : null; + + $this->container['email_address_verified'] = isset($data['email_address_verified']) ? $data['email_address_verified'] : null; + + $this->container['firstname'] = isset($data['firstname']) ? $data['firstname'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['lastname'] = isset($data['lastname']) ? $data['lastname'] : null; + + $this->container['mobile_phone_number'] = isset($data['mobile_phone_number']) ? $data['mobile_phone_number'] : null; + + $this->container['mobile_phone_verified'] = isset($data['mobile_phone_verified']) ? $data['mobile_phone_verified'] : null; + + $this->container['primary_account'] = isset($data['primary_account']) ? $data['primary_account'] : null; + + $this->container['scope'] = isset($data['scope']) ? $data['scope'] : null; + + $this->container['time_zone'] = isset($data['time_zone']) ? $data['time_zone'] : null; + + $this->container['two_factor_enabled'] = isset($data['two_factor_enabled']) ? $data['two_factor_enabled'] : null; + + $this->container['two_factor_type'] = isset($data['two_factor_type']) ? $data['two_factor_type'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 email_address + * + * @return string + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string $email_address The email address of the user. + * + * @return $this + */ + public function setEmailAddress($email_address) + { + $this->container['email_address'] = $email_address; + + return $this; + } + + + /** + * Gets email_address_verified + * + * @return bool + */ + public function getEmailAddressVerified() + { + return $this->container['email_address_verified']; + } + + /** + * Sets email_address_verified + * + * @param bool $email_address_verified Defines whether a user is verified or not. + * + * @return $this + */ + public function setEmailAddressVerified($email_address_verified) + { + $this->container['email_address_verified'] = $email_address_verified; + + return $this; + } + + + /** + * Gets firstname + * + * @return string + */ + public function getFirstname() + { + return $this->container['firstname']; + } + + /** + * Sets firstname + * + * @param string $firstname The first name of the user. + * + * @return $this + */ + public function setFirstname($firstname) + { + $this->container['firstname'] = $firstname; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language The preferred language of the user. + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets lastname + * + * @return string + */ + public function getLastname() + { + return $this->container['lastname']; + } + + /** + * Sets lastname + * + * @param string $lastname The last name of the user. + * + * @return $this + */ + public function setLastname($lastname) + { + $this->container['lastname'] = $lastname; + + return $this; + } + + + /** + * Gets mobile_phone_number + * + * @return string + */ + public function getMobilePhoneNumber() + { + return $this->container['mobile_phone_number']; + } + + /** + * Sets mobile_phone_number + * + * @param string $mobile_phone_number + * + * @return $this + */ + public function setMobilePhoneNumber($mobile_phone_number) + { + $this->container['mobile_phone_number'] = $mobile_phone_number; + + return $this; + } + + + /** + * Gets mobile_phone_verified + * + * @return bool + */ + public function getMobilePhoneVerified() + { + return $this->container['mobile_phone_verified']; + } + + /** + * Sets mobile_phone_verified + * + * @param bool $mobile_phone_verified Defines whether a users mobile phone number is verified or not. + * + * @return $this + */ + public function setMobilePhoneVerified($mobile_phone_verified) + { + $this->container['mobile_phone_verified'] = $mobile_phone_verified; + + return $this; + } + + + /** + * Gets primary_account + * + * @return \Wallee\Sdk\Model\Account + */ + public function getPrimaryAccount() + { + return $this->container['primary_account']; + } + + /** + * Sets primary_account + * + * @param \Wallee\Sdk\Model\Account $primary_account The primary account links the user to a specific account. + * + * @return $this + */ + public function setPrimaryAccount($primary_account) + { + $this->container['primary_account'] = $primary_account; + + return $this; + } + + + /** + * Gets scope + * + * @return \Wallee\Sdk\Model\Scope + */ + public function getScope() + { + return $this->container['scope']; + } + + /** + * Sets scope + * + * @param \Wallee\Sdk\Model\Scope $scope The scope to which the user belongs to. + * + * @return $this + */ + public function setScope($scope) + { + $this->container['scope'] = $scope; + + return $this; + } + + + /** + * Gets time_zone + * + * @return string + */ + public function getTimeZone() + { + return $this->container['time_zone']; + } + + /** + * Sets time_zone + * + * @param string $time_zone The time zone which is applied for the user. If no timezone is specified the browser is used to determine an appropriate time zone. + * + * @return $this + */ + public function setTimeZone($time_zone) + { + $this->container['time_zone'] = $time_zone; + + return $this; + } + + + /** + * Gets two_factor_enabled + * + * @return bool + */ + public function getTwoFactorEnabled() + { + return $this->container['two_factor_enabled']; + } + + /** + * Sets two_factor_enabled + * + * @param bool $two_factor_enabled Defines whether two-factor authentication is enabled for this user. + * + * @return $this + */ + public function setTwoFactorEnabled($two_factor_enabled) + { + $this->container['two_factor_enabled'] = $two_factor_enabled; + + return $this; + } + + + /** + * Gets two_factor_type + * + * @return \Wallee\Sdk\Model\TwoFactorAuthenticationType + */ + public function getTwoFactorType() + { + return $this->container['two_factor_type']; + } + + /** + * Sets two_factor_type + * + * @param \Wallee\Sdk\Model\TwoFactorAuthenticationType $two_factor_type + * + * @return $this + */ + public function setTwoFactorType($two_factor_type) + { + $this->container['two_factor_type'] = $two_factor_type; + + 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/wallee-sdk/lib/Model/HumanUserCreate.php b/wallee-sdk/lib/Model/HumanUserCreate.php index edea178..31e0929 100644 --- a/wallee-sdk/lib/Model/HumanUserCreate.php +++ b/wallee-sdk/lib/Model/HumanUserCreate.php @@ -1,10 +1,8 @@ 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * The primary account links the user to a specific account. - * - * @var int - */ - private $primaryAccount; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['primaryAccount'])) { - $this->setPrimaryAccount($data['primaryAccount']); - } - } - - - /** - * Returns primaryAccount. - * - * The primary account links the user to a specific account. - * - * @return int - */ - public function getPrimaryAccount() { - return $this->primaryAccount; - } - - /** - * Sets primaryAccount. - * - * @param int $primaryAccount - * @return HumanUserCreate - */ - public function setPrimaryAccount($primaryAccount) { - $this->primaryAccount = $primaryAccount; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class HumanUserCreate extends AbstractHumanUserUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'HumanUser.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'primary_account' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'primary_account' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'primary_account' => 'primaryAccount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'primary_account' => 'setPrimaryAccount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'primary_account' => 'getPrimaryAccount' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['primary_account'] = isset($data['primary_account']) ? $data['primary_account'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 primary_account + * + * @return int + */ + public function getPrimaryAccount() + { + return $this->container['primary_account']; + } + + /** + * Sets primary_account + * + * @param int $primary_account The primary account links the user to a specific account. + * + * @return $this + */ + public function setPrimaryAccount($primary_account) + { + $this->container['primary_account'] = $primary_account; + + 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/wallee-sdk/lib/Model/HumanUserUpdate.php b/wallee-sdk/lib/Model/HumanUserUpdate.php index a5bd338..e043af3 100644 --- a/wallee-sdk/lib/Model/HumanUserUpdate.php +++ b/wallee-sdk/lib/Model/HumanUserUpdate.php @@ -1,10 +1,8 @@ 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return HumanUserUpdate - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return HumanUserUpdate - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - if ($this->getId() === null) { - throw new ValidationException("'id' can't be null", 'id', $this); - } - if ($this->getVersion() === null) { - throw new ValidationException("'version' can't be null", 'version', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class HumanUserUpdate extends AbstractHumanUserUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'HumanUser.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/IEnum.php b/wallee-sdk/lib/Model/IEnum.php deleted file mode 100644 index d16c161..0000000 --- a/wallee-sdk/lib/Model/IEnum.php +++ /dev/null @@ -1,34 +0,0 @@ - '\Wallee\Sdk\Model\InstallmentPlanConfiguration', - 'paymentMethodConfigurations' => '\Wallee\Sdk\Model\PaymentMethodConfiguration[]', - 'slices' => '\Wallee\Sdk\Model\InstallmentCalculatedSlice[]', - 'totalAmount' => 'float', - 'transaction' => '\Wallee\Sdk\Model\Transaction' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\InstallmentPlanConfiguration - */ - private $configuration; - - /** - * - * - * @var \Wallee\Sdk\Model\PaymentMethodConfiguration[] - */ - private $paymentMethodConfigurations; - - /** - * - * - * @var \Wallee\Sdk\Model\InstallmentCalculatedSlice[] - */ - private $slices; - - /** - * - * - * @var float - */ - private $totalAmount; - - /** - * - * - * @var \Wallee\Sdk\Model\Transaction - */ - private $transaction; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['configuration'])) { - $this->setConfiguration($data['configuration']); - } - if (isset($data['paymentMethodConfigurations'])) { - $this->setPaymentMethodConfigurations($data['paymentMethodConfigurations']); - } - if (isset($data['slices'])) { - $this->setSlices($data['slices']); - } - if (isset($data['transaction'])) { - $this->setTransaction($data['transaction']); - } - } - - - /** - * Returns configuration. - * - * - * - * @return \Wallee\Sdk\Model\InstallmentPlanConfiguration - */ - public function getConfiguration() { - return $this->configuration; - } - - /** - * Sets configuration. - * - * @param \Wallee\Sdk\Model\InstallmentPlanConfiguration $configuration - * @return InstallmentCalculatedPlan - */ - public function setConfiguration($configuration) { - $this->configuration = $configuration; - - return $this; - } - - /** - * Returns paymentMethodConfigurations. - * - * - * - * @return \Wallee\Sdk\Model\PaymentMethodConfiguration[] - */ - public function getPaymentMethodConfigurations() { - return $this->paymentMethodConfigurations; - } - - /** - * Sets paymentMethodConfigurations. - * - * @param \Wallee\Sdk\Model\PaymentMethodConfiguration[] $paymentMethodConfigurations - * @return InstallmentCalculatedPlan - */ - public function setPaymentMethodConfigurations($paymentMethodConfigurations) { - $this->paymentMethodConfigurations = $paymentMethodConfigurations; - - return $this; - } - - /** - * Returns slices. - * - * - * - * @return \Wallee\Sdk\Model\InstallmentCalculatedSlice[] - */ - public function getSlices() { - return $this->slices; - } - - /** - * Sets slices. - * - * @param \Wallee\Sdk\Model\InstallmentCalculatedSlice[] $slices - * @return InstallmentCalculatedPlan - */ - public function setSlices($slices) { - $this->slices = $slices; - - return $this; - } - - /** - * Returns totalAmount. - * - * - * - * @return float - */ - public function getTotalAmount() { - return $this->totalAmount; - } - - /** - * Sets totalAmount. - * - * @param float $totalAmount - * @return InstallmentCalculatedPlan - */ - protected function setTotalAmount($totalAmount) { - $this->totalAmount = $totalAmount; - - return $this; - } - - /** - * Returns transaction. - * - * - * - * @return \Wallee\Sdk\Model\Transaction - */ - public function getTransaction() { - return $this->transaction; - } - - /** - * Sets transaction. - * - * @param \Wallee\Sdk\Model\Transaction $transaction - * @return InstallmentCalculatedPlan - */ - public function setTransaction($transaction) { - $this->transaction = $transaction; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class InstallmentCalculatedPlan implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'InstallmentCalculatedPlan'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'configuration' => '\Wallee\Sdk\Model\InstallmentPlanConfiguration', + 'payment_method_configurations' => '\Wallee\Sdk\Model\PaymentMethodConfiguration[]', + 'slices' => '\Wallee\Sdk\Model\InstallmentCalculatedSlice[]', + 'total_amount' => 'float', + 'transaction' => '\Wallee\Sdk\Model\Transaction' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'configuration' => null, + 'payment_method_configurations' => null, + 'slices' => null, + 'total_amount' => null, + 'transaction' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'configuration' => 'configuration', + 'payment_method_configurations' => 'paymentMethodConfigurations', + 'slices' => 'slices', + 'total_amount' => 'totalAmount', + 'transaction' => 'transaction' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'configuration' => 'setConfiguration', + 'payment_method_configurations' => 'setPaymentMethodConfigurations', + 'slices' => 'setSlices', + 'total_amount' => 'setTotalAmount', + 'transaction' => 'setTransaction' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'configuration' => 'getConfiguration', + 'payment_method_configurations' => 'getPaymentMethodConfigurations', + 'slices' => 'getSlices', + 'total_amount' => 'getTotalAmount', + 'transaction' => 'getTransaction' + ]; + + + + /** + * 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['configuration'] = isset($data['configuration']) ? $data['configuration'] : null; + + $this->container['payment_method_configurations'] = isset($data['payment_method_configurations']) ? $data['payment_method_configurations'] : null; + + $this->container['slices'] = isset($data['slices']) ? $data['slices'] : null; + + $this->container['total_amount'] = isset($data['total_amount']) ? $data['total_amount'] : null; + + $this->container['transaction'] = isset($data['transaction']) ? $data['transaction'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 configuration + * + * @return \Wallee\Sdk\Model\InstallmentPlanConfiguration + */ + public function getConfiguration() + { + return $this->container['configuration']; + } + + /** + * Sets configuration + * + * @param \Wallee\Sdk\Model\InstallmentPlanConfiguration $configuration + * + * @return $this + */ + public function setConfiguration($configuration) + { + $this->container['configuration'] = $configuration; + + return $this; + } + + + /** + * Gets payment_method_configurations + * + * @return \Wallee\Sdk\Model\PaymentMethodConfiguration[] + */ + public function getPaymentMethodConfigurations() + { + return $this->container['payment_method_configurations']; + } + + /** + * Sets payment_method_configurations + * + * @param \Wallee\Sdk\Model\PaymentMethodConfiguration[] $payment_method_configurations + * + * @return $this + */ + public function setPaymentMethodConfigurations($payment_method_configurations) + { + $this->container['payment_method_configurations'] = $payment_method_configurations; + + return $this; + } + + + /** + * Gets slices + * + * @return \Wallee\Sdk\Model\InstallmentCalculatedSlice[] + */ + public function getSlices() + { + return $this->container['slices']; + } + + /** + * Sets slices + * + * @param \Wallee\Sdk\Model\InstallmentCalculatedSlice[] $slices + * + * @return $this + */ + public function setSlices($slices) + { + $this->container['slices'] = $slices; + + return $this; + } + + + /** + * Gets total_amount + * + * @return float + */ + public function getTotalAmount() + { + return $this->container['total_amount']; + } + + /** + * Sets total_amount + * + * @param float $total_amount + * + * @return $this + */ + public function setTotalAmount($total_amount) + { + $this->container['total_amount'] = $total_amount; + + return $this; + } + + + /** + * Gets transaction + * + * @return \Wallee\Sdk\Model\Transaction + */ + public function getTransaction() + { + return $this->container['transaction']; + } + + /** + * Sets transaction + * + * @param \Wallee\Sdk\Model\Transaction $transaction + * + * @return $this + */ + public function setTransaction($transaction) + { + $this->container['transaction'] = $transaction; + + 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/wallee-sdk/lib/Model/InstallmentCalculatedSlice.php b/wallee-sdk/lib/Model/InstallmentCalculatedSlice.php index 1fbda5e..a58abbe 100644 --- a/wallee-sdk/lib/Model/InstallmentCalculatedSlice.php +++ b/wallee-sdk/lib/Model/InstallmentCalculatedSlice.php @@ -1,10 +1,8 @@ 'float', - 'dueOn' => '\DateTime', - 'lineItems' => '\Wallee\Sdk\Model\LineItem[]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var float - */ - private $amountIncludingTax; - - /** - * - * - * @var \DateTime - */ - private $dueOn; - - /** - * - * - * @var \Wallee\Sdk\Model\LineItem[] - */ - private $lineItems; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['lineItems'])) { - $this->setLineItems($data['lineItems']); - } - } - - - /** - * Returns amountIncludingTax. - * - * - * - * @return float - */ - public function getAmountIncludingTax() { - return $this->amountIncludingTax; - } - - /** - * Sets amountIncludingTax. - * - * @param float $amountIncludingTax - * @return InstallmentCalculatedSlice - */ - protected function setAmountIncludingTax($amountIncludingTax) { - $this->amountIncludingTax = $amountIncludingTax; - - return $this; - } - - /** - * Returns dueOn. - * - * - * - * @return \DateTime - */ - public function getDueOn() { - return $this->dueOn; - } - - /** - * Sets dueOn. - * - * @param \DateTime $dueOn - * @return InstallmentCalculatedSlice - */ - protected function setDueOn($dueOn) { - $this->dueOn = $dueOn; - - return $this; - } - - /** - * Returns lineItems. - * - * - * - * @return \Wallee\Sdk\Model\LineItem[] - */ - public function getLineItems() { - return $this->lineItems; - } - - /** - * Sets lineItems. - * - * @param \Wallee\Sdk\Model\LineItem[] $lineItems - * @return InstallmentCalculatedSlice - */ - public function setLineItems($lineItems) { - $this->lineItems = $lineItems; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class InstallmentCalculatedSlice implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'InstallmentCalculatedSlice'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'amount_including_tax' => 'float', + 'due_on' => '\DateTime', + 'line_items' => '\Wallee\Sdk\Model\LineItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'amount_including_tax' => null, + 'due_on' => 'date-time', + 'line_items' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount_including_tax' => 'amountIncludingTax', + 'due_on' => 'dueOn', + 'line_items' => 'lineItems' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount_including_tax' => 'setAmountIncludingTax', + 'due_on' => 'setDueOn', + 'line_items' => 'setLineItems' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount_including_tax' => 'getAmountIncludingTax', + 'due_on' => 'getDueOn', + 'line_items' => 'getLineItems' + ]; + + + + /** + * 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['amount_including_tax'] = isset($data['amount_including_tax']) ? $data['amount_including_tax'] : null; + + $this->container['due_on'] = isset($data['due_on']) ? $data['due_on'] : null; + + $this->container['line_items'] = isset($data['line_items']) ? $data['line_items'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 amount_including_tax + * + * @return float + */ + public function getAmountIncludingTax() + { + return $this->container['amount_including_tax']; + } + + /** + * Sets amount_including_tax + * + * @param float $amount_including_tax + * + * @return $this + */ + public function setAmountIncludingTax($amount_including_tax) + { + $this->container['amount_including_tax'] = $amount_including_tax; + + return $this; + } + + + /** + * Gets due_on + * + * @return \DateTime + */ + public function getDueOn() + { + return $this->container['due_on']; + } + + /** + * Sets due_on + * + * @param \DateTime $due_on + * + * @return $this + */ + public function setDueOn($due_on) + { + $this->container['due_on'] = $due_on; + + return $this; + } + + + /** + * Gets line_items + * + * @return \Wallee\Sdk\Model\LineItem[] + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Wallee\Sdk\Model\LineItem[] $line_items + * + * @return $this + */ + public function setLineItems($line_items) + { + $this->container['line_items'] = $line_items; + + 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/wallee-sdk/lib/Model/InstallmentPayment.php b/wallee-sdk/lib/Model/InstallmentPayment.php index 954b589..fe08716 100644 --- a/wallee-sdk/lib/Model/InstallmentPayment.php +++ b/wallee-sdk/lib/Model/InstallmentPayment.php @@ -1,10 +1,8 @@ '\DateTime', - 'id' => 'int', - 'initialTransaction' => '\Wallee\Sdk\Model\Transaction', - 'lineItems' => '\Wallee\Sdk\Model\LineItem[]', - 'linkedSpaceId' => 'int', - 'planConfiguration' => 'int', - 'plannedPurgeDate' => '\DateTime', - 'state' => '\Wallee\Sdk\Model\InstallmentPaymentState', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The created on date indicates the date on which the entity was stored into the database. - * - * @var \DateTime - */ - private $createdOn; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var \Wallee\Sdk\Model\Transaction - */ - private $initialTransaction; - - /** - * - * - * @var \Wallee\Sdk\Model\LineItem[] - */ - private $lineItems; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * - * - * @var int - */ - private $planConfiguration; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var \Wallee\Sdk\Model\InstallmentPaymentState - */ - private $state; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['initialTransaction'])) { - $this->setInitialTransaction($data['initialTransaction']); - } - if (isset($data['lineItems'])) { - $this->setLineItems($data['lineItems']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns createdOn. - * - * The created on date indicates the date on which the entity was stored into the database. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return InstallmentPayment - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return InstallmentPayment - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns initialTransaction. - * - * - * - * @return \Wallee\Sdk\Model\Transaction - */ - public function getInitialTransaction() { - return $this->initialTransaction; - } - - /** - * Sets initialTransaction. - * - * @param \Wallee\Sdk\Model\Transaction $initialTransaction - * @return InstallmentPayment - */ - public function setInitialTransaction($initialTransaction) { - $this->initialTransaction = $initialTransaction; - - return $this; - } - - /** - * Returns lineItems. - * - * - * - * @return \Wallee\Sdk\Model\LineItem[] - */ - public function getLineItems() { - return $this->lineItems; - } - - /** - * Sets lineItems. - * - * @param \Wallee\Sdk\Model\LineItem[] $lineItems - * @return InstallmentPayment - */ - public function setLineItems($lineItems) { - $this->lineItems = $lineItems; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return InstallmentPayment - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns planConfiguration. - * - * - * - * @return int - */ - public function getPlanConfiguration() { - return $this->planConfiguration; - } - - /** - * Sets planConfiguration. - * - * @param int $planConfiguration - * @return InstallmentPayment - */ - protected function setPlanConfiguration($planConfiguration) { - $this->planConfiguration = $planConfiguration; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return InstallmentPayment - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\InstallmentPaymentState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\InstallmentPaymentState $state - * @return InstallmentPayment - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return InstallmentPayment - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class InstallmentPayment implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'InstallmentPayment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'created_on' => '\DateTime', + 'id' => 'int', + 'initial_transaction' => '\Wallee\Sdk\Model\Transaction', + 'line_items' => '\Wallee\Sdk\Model\LineItem[]', + 'linked_space_id' => 'int', + 'plan_configuration' => 'int', + 'planned_purge_date' => '\DateTime', + 'state' => '\Wallee\Sdk\Model\InstallmentPaymentState', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'created_on' => 'date-time', + 'id' => 'int64', + 'initial_transaction' => null, + 'line_items' => null, + 'linked_space_id' => 'int64', + 'plan_configuration' => 'int64', + 'planned_purge_date' => 'date-time', + 'state' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'created_on' => 'createdOn', + 'id' => 'id', + 'initial_transaction' => 'initialTransaction', + 'line_items' => 'lineItems', + 'linked_space_id' => 'linkedSpaceId', + 'plan_configuration' => 'planConfiguration', + 'planned_purge_date' => 'plannedPurgeDate', + 'state' => 'state', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'created_on' => 'setCreatedOn', + 'id' => 'setId', + 'initial_transaction' => 'setInitialTransaction', + 'line_items' => 'setLineItems', + 'linked_space_id' => 'setLinkedSpaceId', + 'plan_configuration' => 'setPlanConfiguration', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'state' => 'setState', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'created_on' => 'getCreatedOn', + 'id' => 'getId', + 'initial_transaction' => 'getInitialTransaction', + 'line_items' => 'getLineItems', + 'linked_space_id' => 'getLinkedSpaceId', + 'plan_configuration' => 'getPlanConfiguration', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'state' => 'getState', + 'version' => 'getVersion' + ]; + + + + /** + * 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['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['initial_transaction'] = isset($data['initial_transaction']) ? $data['initial_transaction'] : null; + + $this->container['line_items'] = isset($data['line_items']) ? $data['line_items'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['plan_configuration'] = isset($data['plan_configuration']) ? $data['plan_configuration'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets initial_transaction + * + * @return \Wallee\Sdk\Model\Transaction + */ + public function getInitialTransaction() + { + return $this->container['initial_transaction']; + } + + /** + * Sets initial_transaction + * + * @param \Wallee\Sdk\Model\Transaction $initial_transaction + * + * @return $this + */ + public function setInitialTransaction($initial_transaction) + { + $this->container['initial_transaction'] = $initial_transaction; + + return $this; + } + + + /** + * Gets line_items + * + * @return \Wallee\Sdk\Model\LineItem[] + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Wallee\Sdk\Model\LineItem[] $line_items + * + * @return $this + */ + public function setLineItems($line_items) + { + $this->container['line_items'] = $line_items; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets plan_configuration + * + * @return int + */ + public function getPlanConfiguration() + { + return $this->container['plan_configuration']; + } + + /** + * Sets plan_configuration + * + * @param int $plan_configuration + * + * @return $this + */ + public function setPlanConfiguration($plan_configuration) + { + $this->container['plan_configuration'] = $plan_configuration; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\InstallmentPaymentState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\InstallmentPaymentState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/InstallmentPaymentSlice.php b/wallee-sdk/lib/Model/InstallmentPaymentSlice.php index 4a45b52..dad7724 100644 --- a/wallee-sdk/lib/Model/InstallmentPaymentSlice.php +++ b/wallee-sdk/lib/Model/InstallmentPaymentSlice.php @@ -1,10 +1,8 @@ '\DateTime', - 'createdOn' => '\DateTime', - 'installmentPayment' => '\Wallee\Sdk\Model\InstallmentPayment', - 'lineItems' => '\Wallee\Sdk\Model\LineItem[]', - 'plannedPurgeDate' => '\DateTime', - 'state' => '\Wallee\Sdk\Model\InstallmentPaymentSliceState', - 'transaction' => '\Wallee\Sdk\Model\Transaction', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * - * - * @var \DateTime - */ - private $chargeOn; - - /** - * The created on date indicates the date on which the entity was stored into the database. - * - * @var \DateTime - */ - private $createdOn; - - /** - * - * - * @var \Wallee\Sdk\Model\InstallmentPayment - */ - private $installmentPayment; - - /** - * - * - * @var \Wallee\Sdk\Model\LineItem[] - */ - private $lineItems; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var \Wallee\Sdk\Model\InstallmentPaymentSliceState - */ - private $state; - - /** - * - * - * @var \Wallee\Sdk\Model\Transaction - */ - private $transaction; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['installmentPayment'])) { - $this->setInstallmentPayment($data['installmentPayment']); - } - if (isset($data['lineItems'])) { - $this->setLineItems($data['lineItems']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['transaction'])) { - $this->setTransaction($data['transaction']); - } - } - - - /** - * Returns chargeOn. - * - * - * - * @return \DateTime - */ - public function getChargeOn() { - return $this->chargeOn; - } - - /** - * Sets chargeOn. - * - * @param \DateTime $chargeOn - * @return InstallmentPaymentSlice - */ - protected function setChargeOn($chargeOn) { - $this->chargeOn = $chargeOn; - - return $this; - } - - /** - * Returns createdOn. - * - * The created on date indicates the date on which the entity was stored into the database. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return InstallmentPaymentSlice - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns installmentPayment. - * - * - * - * @return \Wallee\Sdk\Model\InstallmentPayment - */ - public function getInstallmentPayment() { - return $this->installmentPayment; - } - - /** - * Sets installmentPayment. - * - * @param \Wallee\Sdk\Model\InstallmentPayment $installmentPayment - * @return InstallmentPaymentSlice - */ - public function setInstallmentPayment($installmentPayment) { - $this->installmentPayment = $installmentPayment; - - return $this; - } - - /** - * Returns lineItems. - * - * - * - * @return \Wallee\Sdk\Model\LineItem[] - */ - public function getLineItems() { - return $this->lineItems; - } - - /** - * Sets lineItems. - * - * @param \Wallee\Sdk\Model\LineItem[] $lineItems - * @return InstallmentPaymentSlice - */ - public function setLineItems($lineItems) { - $this->lineItems = $lineItems; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return InstallmentPaymentSlice - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\InstallmentPaymentSliceState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\InstallmentPaymentSliceState $state - * @return InstallmentPaymentSlice - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns transaction. - * - * - * - * @return \Wallee\Sdk\Model\Transaction - */ - public function getTransaction() { - return $this->transaction; - } - - /** - * Sets transaction. - * - * @param \Wallee\Sdk\Model\Transaction $transaction - * @return InstallmentPaymentSlice - */ - public function setTransaction($transaction) { - $this->transaction = $transaction; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return InstallmentPaymentSlice - */ - protected function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class InstallmentPaymentSlice extends TransactionAwareEntity +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'InstallmentPaymentSlice'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'charge_on' => '\DateTime', + 'created_on' => '\DateTime', + 'installment_payment' => '\Wallee\Sdk\Model\InstallmentPayment', + 'line_items' => '\Wallee\Sdk\Model\LineItem[]', + 'planned_purge_date' => '\DateTime', + 'state' => '\Wallee\Sdk\Model\InstallmentPaymentSliceState', + 'transaction' => '\Wallee\Sdk\Model\Transaction', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'charge_on' => 'date-time', + 'created_on' => 'date-time', + 'installment_payment' => null, + 'line_items' => null, + 'planned_purge_date' => 'date-time', + 'state' => null, + 'transaction' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'charge_on' => 'chargeOn', + 'created_on' => 'createdOn', + 'installment_payment' => 'installmentPayment', + 'line_items' => 'lineItems', + 'planned_purge_date' => 'plannedPurgeDate', + 'state' => 'state', + 'transaction' => 'transaction', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'charge_on' => 'setChargeOn', + 'created_on' => 'setCreatedOn', + 'installment_payment' => 'setInstallmentPayment', + 'line_items' => 'setLineItems', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'state' => 'setState', + 'transaction' => 'setTransaction', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'charge_on' => 'getChargeOn', + 'created_on' => 'getCreatedOn', + 'installment_payment' => 'getInstallmentPayment', + 'line_items' => 'getLineItems', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'state' => 'getState', + 'transaction' => 'getTransaction', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['charge_on'] = isset($data['charge_on']) ? $data['charge_on'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['installment_payment'] = isset($data['installment_payment']) ? $data['installment_payment'] : null; + + $this->container['line_items'] = isset($data['line_items']) ? $data['line_items'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['transaction'] = isset($data['transaction']) ? $data['transaction'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 charge_on + * + * @return \DateTime + */ + public function getChargeOn() + { + return $this->container['charge_on']; + } + + /** + * Sets charge_on + * + * @param \DateTime $charge_on + * + * @return $this + */ + public function setChargeOn($charge_on) + { + $this->container['charge_on'] = $charge_on; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets installment_payment + * + * @return \Wallee\Sdk\Model\InstallmentPayment + */ + public function getInstallmentPayment() + { + return $this->container['installment_payment']; + } + + /** + * Sets installment_payment + * + * @param \Wallee\Sdk\Model\InstallmentPayment $installment_payment + * + * @return $this + */ + public function setInstallmentPayment($installment_payment) + { + $this->container['installment_payment'] = $installment_payment; + + return $this; + } + + + /** + * Gets line_items + * + * @return \Wallee\Sdk\Model\LineItem[] + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Wallee\Sdk\Model\LineItem[] $line_items + * + * @return $this + */ + public function setLineItems($line_items) + { + $this->container['line_items'] = $line_items; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\InstallmentPaymentSliceState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\InstallmentPaymentSliceState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets transaction + * + * @return \Wallee\Sdk\Model\Transaction + */ + public function getTransaction() + { + return $this->container['transaction']; + } + + /** + * Sets transaction + * + * @param \Wallee\Sdk\Model\Transaction $transaction + * + * @return $this + */ + public function setTransaction($transaction) + { + $this->container['transaction'] = $transaction; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/InstallmentPaymentSliceState.php b/wallee-sdk/lib/Model/InstallmentPaymentSliceState.php index 6c786f7..f627a85 100644 --- a/wallee-sdk/lib/Model/InstallmentPaymentSliceState.php +++ b/wallee-sdk/lib/Model/InstallmentPaymentSliceState.php @@ -1,10 +1,8 @@ 'string', - 'conditions' => 'int[]', - 'id' => 'int', - 'installmentFee' => 'float', - 'interestRate' => 'float', - 'linkedSpaceId' => 'int', - 'minimalAmount' => 'float', - 'name' => 'string', - 'paymentMethodConfigurations' => 'int[]', - 'plannedPurgeDate' => '\DateTime', - 'sortOrder' => 'int', - 'spaceReference' => '\Wallee\Sdk\Model\SpaceReference', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'taxClass' => '\Wallee\Sdk\Model\TaxClass', - 'termsAndConditions' => '\Wallee\Sdk\Model\ModelResourcePath', - 'title' => '\Wallee\Sdk\Model\DatabaseTranslatedString', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The base currency in which the installment fee and minimal amount are defined. - * - * @var string - */ - private $baseCurrency; - - /** - * If a transaction meets all selected conditions the installment plan will be available to the customer to be selected. - * - * @var int[] - */ - private $conditions; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The installment fee is a fixed amount that is charged additionally when applying this installment plan. - * - * @var float - */ - private $installmentFee; - - /** - * The interest rate is a percentage of the total amount that is charged additionally when applying this installment plan. - * - * @var float - */ - private $interestRate; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The installment plan can only be applied if the orders total is at least the defined minimal amount. - * - * @var float - */ - private $minimalAmount; - - /** - * The installment plan name is used internally to identify the plan in administrative interfaces.For example it is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * A installment plan can be enabled only for specific payment method configurations. Other payment methods will not be selectable by the buyer. - * - * @var int[] - */ - private $paymentMethodConfigurations; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * The sort order controls in which order the installation plans are listed. The sort order is used to order the plans in ascending order. - * - * @var int - */ - private $sortOrder; - - /** - * - * - * @var \Wallee\Sdk\Model\SpaceReference - */ - private $spaceReference; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The tax class determines the taxes which are applicable on all fees linked to the installment plan. - * - * @var \Wallee\Sdk\Model\TaxClass - */ - private $taxClass; - - /** - * The terms and conditions will be displayed to the customer when he or she selects this installment plan. - * - * @var \Wallee\Sdk\Model\ModelResourcePath - */ - private $termsAndConditions; - - /** - * The title of the installment plan is used within the payment process. The title is visible to the buyer. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedString - */ - private $title; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['conditions'])) { - $this->setConditions($data['conditions']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['paymentMethodConfigurations'])) { - $this->setPaymentMethodConfigurations($data['paymentMethodConfigurations']); - } - if (isset($data['spaceReference'])) { - $this->setSpaceReference($data['spaceReference']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['taxClass'])) { - $this->setTaxClass($data['taxClass']); - } - if (isset($data['termsAndConditions'])) { - $this->setTermsAndConditions($data['termsAndConditions']); - } - if (isset($data['title'])) { - $this->setTitle($data['title']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns baseCurrency. - * - * The base currency in which the installment fee and minimal amount are defined. - * - * @return string - */ - public function getBaseCurrency() { - return $this->baseCurrency; - } - - /** - * Sets baseCurrency. - * - * @param string $baseCurrency - * @return InstallmentPlanConfiguration - */ - protected function setBaseCurrency($baseCurrency) { - $this->baseCurrency = $baseCurrency; - - return $this; - } - - /** - * Returns conditions. - * - * If a transaction meets all selected conditions the installment plan will be available to the customer to be selected. - * - * @return int[] - */ - public function getConditions() { - return $this->conditions; - } - - /** - * Sets conditions. - * - * @param int[] $conditions - * @return InstallmentPlanConfiguration - */ - public function setConditions($conditions) { - $this->conditions = $conditions; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return InstallmentPlanConfiguration - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns installmentFee. - * - * The installment fee is a fixed amount that is charged additionally when applying this installment plan. - * - * @return float - */ - public function getInstallmentFee() { - return $this->installmentFee; - } - - /** - * Sets installmentFee. - * - * @param float $installmentFee - * @return InstallmentPlanConfiguration - */ - protected function setInstallmentFee($installmentFee) { - $this->installmentFee = $installmentFee; - - return $this; - } - - /** - * Returns interestRate. - * - * The interest rate is a percentage of the total amount that is charged additionally when applying this installment plan. - * - * @return float - */ - public function getInterestRate() { - return $this->interestRate; - } - - /** - * Sets interestRate. - * - * @param float $interestRate - * @return InstallmentPlanConfiguration - */ - protected function setInterestRate($interestRate) { - $this->interestRate = $interestRate; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return InstallmentPlanConfiguration - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns minimalAmount. - * - * The installment plan can only be applied if the orders total is at least the defined minimal amount. - * - * @return float - */ - public function getMinimalAmount() { - return $this->minimalAmount; - } - - /** - * Sets minimalAmount. - * - * @param float $minimalAmount - * @return InstallmentPlanConfiguration - */ - protected function setMinimalAmount($minimalAmount) { - $this->minimalAmount = $minimalAmount; - - return $this; - } - - /** - * Returns name. - * - * The installment plan name is used internally to identify the plan in administrative interfaces.For example it is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return InstallmentPlanConfiguration - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns paymentMethodConfigurations. - * - * A installment plan can be enabled only for specific payment method configurations. Other payment methods will not be selectable by the buyer. - * - * @return int[] - */ - public function getPaymentMethodConfigurations() { - return $this->paymentMethodConfigurations; - } - - /** - * Sets paymentMethodConfigurations. - * - * @param int[] $paymentMethodConfigurations - * @return InstallmentPlanConfiguration - */ - public function setPaymentMethodConfigurations($paymentMethodConfigurations) { - $this->paymentMethodConfigurations = $paymentMethodConfigurations; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return InstallmentPlanConfiguration - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns sortOrder. - * - * The sort order controls in which order the installation plans are listed. The sort order is used to order the plans in ascending order. - * - * @return int - */ - public function getSortOrder() { - return $this->sortOrder; - } - - /** - * Sets sortOrder. - * - * @param int $sortOrder - * @return InstallmentPlanConfiguration - */ - protected function setSortOrder($sortOrder) { - $this->sortOrder = $sortOrder; - - return $this; - } - - /** - * Returns spaceReference. - * - * - * - * @return \Wallee\Sdk\Model\SpaceReference - */ - public function getSpaceReference() { - return $this->spaceReference; - } - - /** - * Sets spaceReference. - * - * @param \Wallee\Sdk\Model\SpaceReference $spaceReference - * @return InstallmentPlanConfiguration - */ - public function setSpaceReference($spaceReference) { - $this->spaceReference = $spaceReference; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return InstallmentPlanConfiguration - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns taxClass. - * - * The tax class determines the taxes which are applicable on all fees linked to the installment plan. - * - * @return \Wallee\Sdk\Model\TaxClass - */ - public function getTaxClass() { - return $this->taxClass; - } - - /** - * Sets taxClass. - * - * @param \Wallee\Sdk\Model\TaxClass $taxClass - * @return InstallmentPlanConfiguration - */ - public function setTaxClass($taxClass) { - $this->taxClass = $taxClass; - - return $this; - } - - /** - * Returns termsAndConditions. - * - * The terms and conditions will be displayed to the customer when he or she selects this installment plan. - * - * @return \Wallee\Sdk\Model\ModelResourcePath - */ - public function getTermsAndConditions() { - return $this->termsAndConditions; - } - - /** - * Sets termsAndConditions. - * - * @param \Wallee\Sdk\Model\ModelResourcePath $termsAndConditions - * @return InstallmentPlanConfiguration - */ - public function setTermsAndConditions($termsAndConditions) { - $this->termsAndConditions = $termsAndConditions; - - return $this; - } - - /** - * Returns title. - * - * The title of the installment plan is used within the payment process. The title is visible to the buyer. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedString - */ - public function getTitle() { - return $this->title; - } - - /** - * Sets title. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedString $title - * @return InstallmentPlanConfiguration - */ - public function setTitle($title) { - $this->title = $title; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return InstallmentPlanConfiguration - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class InstallmentPlanConfiguration implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'InstallmentPlanConfiguration'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'base_currency' => 'string', + 'conditions' => 'int[]', + 'id' => 'int', + 'installment_fee' => 'float', + 'interest_rate' => 'float', + 'linked_space_id' => 'int', + 'minimal_amount' => 'float', + 'name' => 'string', + 'payment_method_configurations' => 'int[]', + 'planned_purge_date' => '\DateTime', + 'sort_order' => 'int', + 'space_reference' => '\Wallee\Sdk\Model\SpaceReference', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'tax_class' => '\Wallee\Sdk\Model\TaxClass', + 'terms_and_conditions' => '\Wallee\Sdk\Model\ModelResourcePath', + 'title' => '\Wallee\Sdk\Model\DatabaseTranslatedString', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'base_currency' => null, + 'conditions' => 'int64', + 'id' => 'int64', + 'installment_fee' => null, + 'interest_rate' => null, + 'linked_space_id' => 'int64', + 'minimal_amount' => null, + 'name' => null, + 'payment_method_configurations' => 'int64', + 'planned_purge_date' => 'date-time', + 'sort_order' => 'int32', + 'space_reference' => null, + 'state' => null, + 'tax_class' => null, + 'terms_and_conditions' => null, + 'title' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'base_currency' => 'baseCurrency', + 'conditions' => 'conditions', + 'id' => 'id', + 'installment_fee' => 'installmentFee', + 'interest_rate' => 'interestRate', + 'linked_space_id' => 'linkedSpaceId', + 'minimal_amount' => 'minimalAmount', + 'name' => 'name', + 'payment_method_configurations' => 'paymentMethodConfigurations', + 'planned_purge_date' => 'plannedPurgeDate', + 'sort_order' => 'sortOrder', + 'space_reference' => 'spaceReference', + 'state' => 'state', + 'tax_class' => 'taxClass', + 'terms_and_conditions' => 'termsAndConditions', + 'title' => 'title', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'base_currency' => 'setBaseCurrency', + 'conditions' => 'setConditions', + 'id' => 'setId', + 'installment_fee' => 'setInstallmentFee', + 'interest_rate' => 'setInterestRate', + 'linked_space_id' => 'setLinkedSpaceId', + 'minimal_amount' => 'setMinimalAmount', + 'name' => 'setName', + 'payment_method_configurations' => 'setPaymentMethodConfigurations', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'sort_order' => 'setSortOrder', + 'space_reference' => 'setSpaceReference', + 'state' => 'setState', + 'tax_class' => 'setTaxClass', + 'terms_and_conditions' => 'setTermsAndConditions', + 'title' => 'setTitle', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'base_currency' => 'getBaseCurrency', + 'conditions' => 'getConditions', + 'id' => 'getId', + 'installment_fee' => 'getInstallmentFee', + 'interest_rate' => 'getInterestRate', + 'linked_space_id' => 'getLinkedSpaceId', + 'minimal_amount' => 'getMinimalAmount', + 'name' => 'getName', + 'payment_method_configurations' => 'getPaymentMethodConfigurations', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'sort_order' => 'getSortOrder', + 'space_reference' => 'getSpaceReference', + 'state' => 'getState', + 'tax_class' => 'getTaxClass', + 'terms_and_conditions' => 'getTermsAndConditions', + 'title' => 'getTitle', + 'version' => 'getVersion' + ]; + + + + /** + * 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['base_currency'] = isset($data['base_currency']) ? $data['base_currency'] : null; + + $this->container['conditions'] = isset($data['conditions']) ? $data['conditions'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['installment_fee'] = isset($data['installment_fee']) ? $data['installment_fee'] : null; + + $this->container['interest_rate'] = isset($data['interest_rate']) ? $data['interest_rate'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['minimal_amount'] = isset($data['minimal_amount']) ? $data['minimal_amount'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['payment_method_configurations'] = isset($data['payment_method_configurations']) ? $data['payment_method_configurations'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['sort_order'] = isset($data['sort_order']) ? $data['sort_order'] : null; + + $this->container['space_reference'] = isset($data['space_reference']) ? $data['space_reference'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['tax_class'] = isset($data['tax_class']) ? $data['tax_class'] : null; + + $this->container['terms_and_conditions'] = isset($data['terms_and_conditions']) ? $data['terms_and_conditions'] : null; + + $this->container['title'] = isset($data['title']) ? $data['title'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 base_currency + * + * @return string + */ + public function getBaseCurrency() + { + return $this->container['base_currency']; + } + + /** + * Sets base_currency + * + * @param string $base_currency The base currency in which the installment fee and minimal amount are defined. + * + * @return $this + */ + public function setBaseCurrency($base_currency) + { + $this->container['base_currency'] = $base_currency; + + return $this; + } + + + /** + * Gets conditions + * + * @return int[] + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param int[] $conditions If a transaction meets all selected conditions the installment plan will be available to the customer to be selected. + * + * @return $this + */ + public function setConditions($conditions) + { + $this->container['conditions'] = $conditions; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets installment_fee + * + * @return float + */ + public function getInstallmentFee() + { + return $this->container['installment_fee']; + } + + /** + * Sets installment_fee + * + * @param float $installment_fee The installment fee is a fixed amount that is charged additionally when applying this installment plan. + * + * @return $this + */ + public function setInstallmentFee($installment_fee) + { + $this->container['installment_fee'] = $installment_fee; + + return $this; + } + + + /** + * Gets interest_rate + * + * @return float + */ + public function getInterestRate() + { + return $this->container['interest_rate']; + } + + /** + * Sets interest_rate + * + * @param float $interest_rate The interest rate is a percentage of the total amount that is charged additionally when applying this installment plan. + * + * @return $this + */ + public function setInterestRate($interest_rate) + { + $this->container['interest_rate'] = $interest_rate; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets minimal_amount + * + * @return float + */ + public function getMinimalAmount() + { + return $this->container['minimal_amount']; + } + + /** + * Sets minimal_amount + * + * @param float $minimal_amount The installment plan can only be applied if the orders total is at least the defined minimal amount. + * + * @return $this + */ + public function setMinimalAmount($minimal_amount) + { + $this->container['minimal_amount'] = $minimal_amount; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The installment plan name is used internally to identify the plan in administrative interfaces.For example it is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets payment_method_configurations + * + * @return int[] + */ + public function getPaymentMethodConfigurations() + { + return $this->container['payment_method_configurations']; + } + + /** + * Sets payment_method_configurations + * + * @param int[] $payment_method_configurations A installment plan can be enabled only for specific payment method configurations. Other payment methods will not be selectable by the buyer. + * + * @return $this + */ + public function setPaymentMethodConfigurations($payment_method_configurations) + { + $this->container['payment_method_configurations'] = $payment_method_configurations; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets sort_order + * + * @return int + */ + public function getSortOrder() + { + return $this->container['sort_order']; + } + + /** + * Sets sort_order + * + * @param int $sort_order The sort order controls in which order the installation plans are listed. The sort order is used to order the plans in ascending order. + * + * @return $this + */ + public function setSortOrder($sort_order) + { + $this->container['sort_order'] = $sort_order; + + return $this; + } + + + /** + * Gets space_reference + * + * @return \Wallee\Sdk\Model\SpaceReference + */ + public function getSpaceReference() + { + return $this->container['space_reference']; + } + + /** + * Sets space_reference + * + * @param \Wallee\Sdk\Model\SpaceReference $space_reference + * + * @return $this + */ + public function setSpaceReference($space_reference) + { + $this->container['space_reference'] = $space_reference; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets tax_class + * + * @return \Wallee\Sdk\Model\TaxClass + */ + public function getTaxClass() + { + return $this->container['tax_class']; + } + + /** + * Sets tax_class + * + * @param \Wallee\Sdk\Model\TaxClass $tax_class The tax class determines the taxes which are applicable on all fees linked to the installment plan. + * + * @return $this + */ + public function setTaxClass($tax_class) + { + $this->container['tax_class'] = $tax_class; + + return $this; + } + + + /** + * Gets terms_and_conditions + * + * @return \Wallee\Sdk\Model\ModelResourcePath + */ + public function getTermsAndConditions() + { + return $this->container['terms_and_conditions']; + } + + /** + * Sets terms_and_conditions + * + * @param \Wallee\Sdk\Model\ModelResourcePath $terms_and_conditions The terms and conditions will be displayed to the customer when he or she selects this installment plan. + * + * @return $this + */ + public function setTermsAndConditions($terms_and_conditions) + { + $this->container['terms_and_conditions'] = $terms_and_conditions; + + return $this; + } + + + /** + * Gets title + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedString + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedString $title The title of the installment plan is used within the payment process. The title is visible to the buyer. + * + * @return $this + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/InstallmentPlanSliceConfiguration.php b/wallee-sdk/lib/Model/InstallmentPlanSliceConfiguration.php index f523104..7d348cc 100644 --- a/wallee-sdk/lib/Model/InstallmentPlanSliceConfiguration.php +++ b/wallee-sdk/lib/Model/InstallmentPlanSliceConfiguration.php @@ -1,10 +1,8 @@ 'int', - 'lineItemTitle' => '\Wallee\Sdk\Model\DatabaseTranslatedString', - 'linkedSpaceId' => 'int', - 'period' => 'string', - 'plan' => '\Wallee\Sdk\Model\InstallmentPlanConfiguration', - 'plannedPurgeDate' => '\DateTime', - 'priority' => 'int', - 'proportion' => 'float', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The title of this slices line items. The title is visible to the buyer. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedString - */ - private $lineItemTitle; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The period defines how much time passes between the last slice and this slice. The charge is triggered at the end of the period. When the slice should be charged immediately the period needs to be zero. - * - * @var string - */ - private $period; - - /** - * The installment plan this slice belongs to. - * - * @var \Wallee\Sdk\Model\InstallmentPlanConfiguration - */ - private $plan; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * The priority controls in which order the slices are applied. The lower the value the higher the precedence. - * - * @var int - */ - private $priority; - - /** - * The proportion defines how much of the total installment payment has to be paid in this slice. The value is summed up with the other slices and the ratio of all proportions compared to proportion of this slice determines how much the buyer has to pay in this slice. - * - * @var float - */ - private $proportion; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['lineItemTitle'])) { - $this->setLineItemTitle($data['lineItemTitle']); - } - if (isset($data['plan'])) { - $this->setPlan($data['plan']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return InstallmentPlanSliceConfiguration - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns lineItemTitle. - * - * The title of this slices line items. The title is visible to the buyer. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedString - */ - public function getLineItemTitle() { - return $this->lineItemTitle; - } - - /** - * Sets lineItemTitle. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedString $lineItemTitle - * @return InstallmentPlanSliceConfiguration - */ - public function setLineItemTitle($lineItemTitle) { - $this->lineItemTitle = $lineItemTitle; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return InstallmentPlanSliceConfiguration - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns period. - * - * The period defines how much time passes between the last slice and this slice. The charge is triggered at the end of the period. When the slice should be charged immediately the period needs to be zero. - * - * @return string - */ - public function getPeriod() { - return $this->period; - } - - /** - * Sets period. - * - * @param string $period - * @return InstallmentPlanSliceConfiguration - */ - protected function setPeriod($period) { - $this->period = $period; - - return $this; - } - - /** - * Returns plan. - * - * The installment plan this slice belongs to. - * - * @return \Wallee\Sdk\Model\InstallmentPlanConfiguration - */ - public function getPlan() { - return $this->plan; - } - - /** - * Sets plan. - * - * @param \Wallee\Sdk\Model\InstallmentPlanConfiguration $plan - * @return InstallmentPlanSliceConfiguration - */ - public function setPlan($plan) { - $this->plan = $plan; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return InstallmentPlanSliceConfiguration - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns priority. - * - * The priority controls in which order the slices are applied. The lower the value the higher the precedence. - * - * @return int - */ - public function getPriority() { - return $this->priority; - } - - /** - * Sets priority. - * - * @param int $priority - * @return InstallmentPlanSliceConfiguration - */ - protected function setPriority($priority) { - $this->priority = $priority; - - return $this; - } - - /** - * Returns proportion. - * - * The proportion defines how much of the total installment payment has to be paid in this slice. The value is summed up with the other slices and the ratio of all proportions compared to proportion of this slice determines how much the buyer has to pay in this slice. - * - * @return float - */ - public function getProportion() { - return $this->proportion; - } - - /** - * Sets proportion. - * - * @param float $proportion - * @return InstallmentPlanSliceConfiguration - */ - protected function setProportion($proportion) { - $this->proportion = $proportion; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return InstallmentPlanSliceConfiguration - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return InstallmentPlanSliceConfiguration - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class InstallmentPlanSliceConfiguration implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'InstallmentPlanSliceConfiguration'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'line_item_title' => '\Wallee\Sdk\Model\DatabaseTranslatedString', + 'linked_space_id' => 'int', + 'period' => 'string', + 'plan' => '\Wallee\Sdk\Model\InstallmentPlanConfiguration', + 'planned_purge_date' => '\DateTime', + 'priority' => 'int', + 'proportion' => 'float', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'line_item_title' => null, + 'linked_space_id' => 'int64', + 'period' => null, + 'plan' => null, + 'planned_purge_date' => 'date-time', + 'priority' => 'int32', + 'proportion' => null, + 'state' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'line_item_title' => 'lineItemTitle', + 'linked_space_id' => 'linkedSpaceId', + 'period' => 'period', + 'plan' => 'plan', + 'planned_purge_date' => 'plannedPurgeDate', + 'priority' => 'priority', + 'proportion' => 'proportion', + 'state' => 'state', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'line_item_title' => 'setLineItemTitle', + 'linked_space_id' => 'setLinkedSpaceId', + 'period' => 'setPeriod', + 'plan' => 'setPlan', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'priority' => 'setPriority', + 'proportion' => 'setProportion', + 'state' => 'setState', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'line_item_title' => 'getLineItemTitle', + 'linked_space_id' => 'getLinkedSpaceId', + 'period' => 'getPeriod', + 'plan' => 'getPlan', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'priority' => 'getPriority', + 'proportion' => 'getProportion', + 'state' => 'getState', + 'version' => 'getVersion' + ]; + + + + /** + * 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['line_item_title'] = isset($data['line_item_title']) ? $data['line_item_title'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['period'] = isset($data['period']) ? $data['period'] : null; + + $this->container['plan'] = isset($data['plan']) ? $data['plan'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['priority'] = isset($data['priority']) ? $data['priority'] : null; + + $this->container['proportion'] = isset($data['proportion']) ? $data['proportion'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets line_item_title + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedString + */ + public function getLineItemTitle() + { + return $this->container['line_item_title']; + } + + /** + * Sets line_item_title + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedString $line_item_title The title of this slices line items. The title is visible to the buyer. + * + * @return $this + */ + public function setLineItemTitle($line_item_title) + { + $this->container['line_item_title'] = $line_item_title; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets period + * + * @return string + */ + public function getPeriod() + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param string $period The period defines how much time passes between the last slice and this slice. The charge is triggered at the end of the period. When the slice should be charged immediately the period needs to be zero. + * + * @return $this + */ + public function setPeriod($period) + { + $this->container['period'] = $period; + + return $this; + } + + + /** + * Gets plan + * + * @return \Wallee\Sdk\Model\InstallmentPlanConfiguration + */ + public function getPlan() + { + return $this->container['plan']; + } + + /** + * Sets plan + * + * @param \Wallee\Sdk\Model\InstallmentPlanConfiguration $plan The installment plan this slice belongs to. + * + * @return $this + */ + public function setPlan($plan) + { + $this->container['plan'] = $plan; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets priority + * + * @return int + */ + public function getPriority() + { + return $this->container['priority']; + } + + /** + * Sets priority + * + * @param int $priority The priority controls in which order the slices are applied. The lower the value the higher the precedence. + * + * @return $this + */ + public function setPriority($priority) + { + $this->container['priority'] = $priority; + + return $this; + } + + + /** + * Gets proportion + * + * @return float + */ + public function getProportion() + { + return $this->container['proportion']; + } + + /** + * Sets proportion + * + * @param float $proportion The proportion defines how much of the total installment payment has to be paid in this slice. The value is summed up with the other slices and the ratio of all proportions compared to proportion of this slice determines how much the buyer has to pay in this slice. + * + * @return $this + */ + public function setProportion($proportion) + { + $this->container['proportion'] = $proportion; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/Label.php b/wallee-sdk/lib/Model/Label.php index cae9c51..bdaf535 100644 --- a/wallee-sdk/lib/Model/Label.php +++ b/wallee-sdk/lib/Model/Label.php @@ -1,10 +1,8 @@ 'object', - 'contentAsString' => 'string', - 'descriptor' => '\Wallee\Sdk\Model\LabelDescriptor', - 'id' => 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var object - */ - private $content; - - /** - * - * - * @var string - */ - private $contentAsString; - - /** - * - * - * @var \Wallee\Sdk\Model\LabelDescriptor - */ - private $descriptor; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['content'])) { - $this->setContent($data['content']); - } - if (isset($data['descriptor'])) { - $this->setDescriptor($data['descriptor']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns content. - * - * - * - * @return object - */ - public function getContent() { - return $this->content; - } - - /** - * Sets content. - * - * @param object $content - * @return Label - */ - public function setContent($content) { - $this->content = $content; - - return $this; - } - - /** - * Returns contentAsString. - * - * - * - * @return string - */ - public function getContentAsString() { - return $this->contentAsString; - } - - /** - * Sets contentAsString. - * - * @param string $contentAsString - * @return Label - */ - protected function setContentAsString($contentAsString) { - $this->contentAsString = $contentAsString; - - return $this; - } - - /** - * Returns descriptor. - * - * - * - * @return \Wallee\Sdk\Model\LabelDescriptor - */ - public function getDescriptor() { - return $this->descriptor; - } - - /** - * Sets descriptor. - * - * @param \Wallee\Sdk\Model\LabelDescriptor $descriptor - * @return Label - */ - public function setDescriptor($descriptor) { - $this->descriptor = $descriptor; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return Label - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return Label - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class Label implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Label'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'content' => 'object', + 'content_as_string' => 'string', + 'descriptor' => '\Wallee\Sdk\Model\LabelDescriptor', + 'id' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'content' => null, + 'content_as_string' => null, + 'descriptor' => null, + 'id' => 'int64', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'content' => 'content', + 'content_as_string' => 'contentAsString', + 'descriptor' => 'descriptor', + 'id' => 'id', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent', + 'content_as_string' => 'setContentAsString', + 'descriptor' => 'setDescriptor', + 'id' => 'setId', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent', + 'content_as_string' => 'getContentAsString', + 'descriptor' => 'getDescriptor', + 'id' => 'getId', + 'version' => 'getVersion' + ]; + + + + /** + * 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['content_as_string'] = isset($data['content_as_string']) ? $data['content_as_string'] : null; + + $this->container['descriptor'] = isset($data['descriptor']) ? $data['descriptor'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 object + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param object $content + * + * @return $this + */ + public function setContent($content) + { + $this->container['content'] = $content; + + return $this; + } + + + /** + * Gets content_as_string + * + * @return string + */ + public function getContentAsString() + { + return $this->container['content_as_string']; + } + + /** + * Sets content_as_string + * + * @param string $content_as_string + * + * @return $this + */ + public function setContentAsString($content_as_string) + { + $this->container['content_as_string'] = $content_as_string; + + return $this; + } + + + /** + * Gets descriptor + * + * @return \Wallee\Sdk\Model\LabelDescriptor + */ + public function getDescriptor() + { + return $this->container['descriptor']; + } + + /** + * Sets descriptor + * + * @param \Wallee\Sdk\Model\LabelDescriptor $descriptor + * + * @return $this + */ + public function setDescriptor($descriptor) + { + $this->container['descriptor'] = $descriptor; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/LabelDescriptor.php b/wallee-sdk/lib/Model/LabelDescriptor.php index e4198c6..4286af7 100644 --- a/wallee-sdk/lib/Model/LabelDescriptor.php +++ b/wallee-sdk/lib/Model/LabelDescriptor.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\LabelDescriptorCategory', - 'description' => 'map[string,string]', - 'features' => 'int[]', - 'group' => 'int', - 'id' => 'int', - 'name' => 'map[string,string]', - 'type' => 'int', - 'weight' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\LabelDescriptorCategory - */ - private $category; - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * - * - * @var int[] - */ - private $features; - - /** - * - * - * @var int - */ - private $group; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $name; - - /** - * - * - * @var int - */ - private $type; - - /** - * - * - * @var int - */ - private $weight; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['category'])) { - $this->setCategory($data['category']); - } - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['features'])) { - $this->setFeatures($data['features']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - } - - - /** - * Returns category. - * - * - * - * @return \Wallee\Sdk\Model\LabelDescriptorCategory - */ - public function getCategory() { - return $this->category; - } - - /** - * Sets category. - * - * @param \Wallee\Sdk\Model\LabelDescriptorCategory $category - * @return LabelDescriptor - */ - public function setCategory($category) { - $this->category = $category; - - return $this; - } - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return LabelDescriptor - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns features. - * - * - * - * @return int[] - */ - public function getFeatures() { - return $this->features; - } - - /** - * Sets features. - * - * @param int[] $features - * @return LabelDescriptor - */ - public function setFeatures($features) { - $this->features = $features; - - return $this; - } - - /** - * Returns group. - * - * - * - * @return int - */ - public function getGroup() { - return $this->group; - } - - /** - * Sets group. - * - * @param int $group - * @return LabelDescriptor - */ - protected function setGroup($group) { - $this->group = $group; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return LabelDescriptor - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return LabelDescriptor - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Returns type. - * - * - * - * @return int - */ - public function getType() { - return $this->type; - } - - /** - * Sets type. - * - * @param int $type - * @return LabelDescriptor - */ - protected function setType($type) { - $this->type = $type; - - return $this; - } - - /** - * Returns weight. - * - * - * - * @return int - */ - public function getWeight() { - return $this->weight; - } - - /** - * Sets weight. - * - * @param int $weight - * @return LabelDescriptor - */ - protected function setWeight($weight) { - $this->weight = $weight; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class LabelDescriptor implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'LabelDescriptor'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'category' => '\Wallee\Sdk\Model\LabelDescriptorCategory', + 'description' => 'map[string,string]', + 'features' => 'int[]', + 'group' => 'int', + 'id' => 'int', + 'name' => 'map[string,string]', + 'type' => 'int', + 'weight' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'category' => null, + 'description' => null, + 'features' => 'int64', + 'group' => 'int64', + 'id' => 'int64', + 'name' => null, + 'type' => 'int64', + 'weight' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'category' => 'category', + 'description' => 'description', + 'features' => 'features', + 'group' => 'group', + 'id' => 'id', + 'name' => 'name', + 'type' => 'type', + 'weight' => 'weight' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'category' => 'setCategory', + 'description' => 'setDescription', + 'features' => 'setFeatures', + 'group' => 'setGroup', + 'id' => 'setId', + 'name' => 'setName', + 'type' => 'setType', + 'weight' => 'setWeight' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'category' => 'getCategory', + 'description' => 'getDescription', + 'features' => 'getFeatures', + 'group' => 'getGroup', + 'id' => 'getId', + 'name' => 'getName', + 'type' => 'getType', + 'weight' => 'getWeight' + ]; + + + + /** + * 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['category'] = isset($data['category']) ? $data['category'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['features'] = isset($data['features']) ? $data['features'] : null; + + $this->container['group'] = isset($data['group']) ? $data['group'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + $this->container['weight'] = isset($data['weight']) ? $data['weight'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets category + * + * @return \Wallee\Sdk\Model\LabelDescriptorCategory + */ + public function getCategory() + { + return $this->container['category']; + } + + /** + * Sets category + * + * @param \Wallee\Sdk\Model\LabelDescriptorCategory $category + * + * @return $this + */ + public function setCategory($category) + { + $this->container['category'] = $category; + + return $this; + } + + + /** + * Gets description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets features + * + * @return int[] + */ + public function getFeatures() + { + return $this->container['features']; + } + + /** + * Sets features + * + * @param int[] $features + * + * @return $this + */ + public function setFeatures($features) + { + $this->container['features'] = $features; + + return $this; + } + + + /** + * Gets group + * + * @return int + */ + public function getGroup() + { + return $this->container['group']; + } + + /** + * Sets group + * + * @param int $group + * + * @return $this + */ + public function setGroup($group) + { + $this->container['group'] = $group; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets type + * + * @return int + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param int $type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + + /** + * Gets weight + * + * @return int + */ + public function getWeight() + { + return $this->container['weight']; + } + + /** + * Sets weight + * + * @param int $weight + * + * @return $this + */ + public function setWeight($weight) + { + $this->container['weight'] = $weight; + + 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/wallee-sdk/lib/Model/LabelDescriptorCategory.php b/wallee-sdk/lib/Model/LabelDescriptorCategory.php index b8458e8..06b65f7 100644 --- a/wallee-sdk/lib/Model/LabelDescriptorCategory.php +++ b/wallee-sdk/lib/Model/LabelDescriptorCategory.php @@ -1,10 +1,8 @@ 'map[string,string]', - 'id' => 'int', - 'name' => 'map[string,string]', - 'weight' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $name; - - /** - * - * - * @var int - */ - private $weight; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - } - - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return LabelDescriptorGroup - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return LabelDescriptorGroup - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return LabelDescriptorGroup - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Returns weight. - * - * - * - * @return int - */ - public function getWeight() { - return $this->weight; - } - - /** - * Sets weight. - * - * @param int $weight - * @return LabelDescriptorGroup - */ - protected function setWeight($weight) { - $this->weight = $weight; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class LabelDescriptorGroup implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'LabelDescriptorGroup'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'description' => 'map[string,string]', + 'id' => 'int', + 'name' => 'map[string,string]', + 'weight' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'id' => 'int64', + 'name' => null, + 'weight' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'id' => 'id', + 'name' => 'name', + 'weight' => 'weight' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'name' => 'setName', + 'weight' => 'setWeight' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'name' => 'getName', + 'weight' => 'getWeight' + ]; + + + + /** + * 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['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['weight'] = isset($data['weight']) ? $data['weight'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets weight + * + * @return int + */ + public function getWeight() + { + return $this->container['weight']; + } + + /** + * Sets weight + * + * @param int $weight + * + * @return $this + */ + public function setWeight($weight) + { + $this->container['weight'] = $weight; + + 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/wallee-sdk/lib/Model/LabelDescriptorType.php b/wallee-sdk/lib/Model/LabelDescriptorType.php index 36f1f91..77eb41a 100644 --- a/wallee-sdk/lib/Model/LabelDescriptorType.php +++ b/wallee-sdk/lib/Model/LabelDescriptorType.php @@ -1,10 +1,8 @@ 'map[string,string]', - 'id' => 'int', - 'name' => 'map[string,string]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $name; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - } - - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return LabelDescriptorType - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return LabelDescriptorType - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return LabelDescriptorType - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class LabelDescriptorType implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'LabelDescriptorType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'description' => 'map[string,string]', + 'id' => 'int', + 'name' => 'map[string,string]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'id' => 'int64', + 'name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'name' => 'getName' + ]; + + + + /** + * 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['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + 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/wallee-sdk/lib/Model/LegalOrganizationForm.php b/wallee-sdk/lib/Model/LegalOrganizationForm.php index 3baabd5..9d2f4cd 100644 --- a/wallee-sdk/lib/Model/LegalOrganizationForm.php +++ b/wallee-sdk/lib/Model/LegalOrganizationForm.php @@ -1,10 +1,8 @@ 'string', - 'description' => '\Wallee\Sdk\Model\LocalizedString[]', - 'englishDescription' => 'string', - 'id' => 'int', - 'shortcut' => '\Wallee\Sdk\Model\LocalizedString[]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var string - */ - private $country; - - /** - * - * - * @var \Wallee\Sdk\Model\LocalizedString[] - */ - private $description; - - /** - * - * - * @var string - */ - private $englishDescription; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var \Wallee\Sdk\Model\LocalizedString[] - */ - private $shortcut; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['shortcut'])) { - $this->setShortcut($data['shortcut']); - } - } - - - /** - * Returns country. - * - * - * - * @return string - */ - public function getCountry() { - return $this->country; - } - - /** - * Sets country. - * - * @param string $country - * @return LegalOrganizationForm - */ - protected function setCountry($country) { - $this->country = $country; - - return $this; - } - - /** - * Returns description. - * - * - * - * @return \Wallee\Sdk\Model\LocalizedString[] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param \Wallee\Sdk\Model\LocalizedString[] $description - * @return LegalOrganizationForm - */ - public function setDescription($description) { - $this->description = $description; - - return $this; - } - - /** - * Returns englishDescription. - * - * - * - * @return string - */ - public function getEnglishDescription() { - return $this->englishDescription; - } - - /** - * Sets englishDescription. - * - * @param string $englishDescription - * @return LegalOrganizationForm - */ - protected function setEnglishDescription($englishDescription) { - $this->englishDescription = $englishDescription; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return LegalOrganizationForm - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns shortcut. - * - * - * - * @return \Wallee\Sdk\Model\LocalizedString[] - */ - public function getShortcut() { - return $this->shortcut; - } - - /** - * Sets shortcut. - * - * @param \Wallee\Sdk\Model\LocalizedString[] $shortcut - * @return LegalOrganizationForm - */ - public function setShortcut($shortcut) { - $this->shortcut = $shortcut; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class LegalOrganizationForm implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'LegalOrganizationForm'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'country' => 'string', + 'description' => '\Wallee\Sdk\Model\LocalizedString[]', + 'english_description' => 'string', + 'id' => 'int', + 'shortcut' => '\Wallee\Sdk\Model\LocalizedString[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'country' => null, + 'description' => null, + 'english_description' => null, + 'id' => 'int64', + 'shortcut' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'country' => 'country', + 'description' => 'description', + 'english_description' => 'englishDescription', + 'id' => 'id', + 'shortcut' => 'shortcut' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'country' => 'setCountry', + 'description' => 'setDescription', + 'english_description' => 'setEnglishDescription', + 'id' => 'setId', + 'shortcut' => 'setShortcut' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'country' => 'getCountry', + 'description' => 'getDescription', + 'english_description' => 'getEnglishDescription', + 'id' => 'getId', + 'shortcut' => 'getShortcut' + ]; + + + + /** + * 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['country'] = isset($data['country']) ? $data['country'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['english_description'] = isset($data['english_description']) ? $data['english_description'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['shortcut'] = isset($data['shortcut']) ? $data['shortcut'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country + * + * @return $this + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + + + /** + * Gets description + * + * @return \Wallee\Sdk\Model\LocalizedString[] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param \Wallee\Sdk\Model\LocalizedString[] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets english_description + * + * @return string + */ + public function getEnglishDescription() + { + return $this->container['english_description']; + } + + /** + * Sets english_description + * + * @param string $english_description + * + * @return $this + */ + public function setEnglishDescription($english_description) + { + $this->container['english_description'] = $english_description; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets shortcut + * + * @return \Wallee\Sdk\Model\LocalizedString[] + */ + public function getShortcut() + { + return $this->container['shortcut']; + } + + /** + * Sets shortcut + * + * @param \Wallee\Sdk\Model\LocalizedString[] $shortcut + * + * @return $this + */ + public function setShortcut($shortcut) + { + $this->container['shortcut'] = $shortcut; + + 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/wallee-sdk/lib/Model/LineItem.php b/wallee-sdk/lib/Model/LineItem.php index 77b5be7..1b6e5f8 100644 --- a/wallee-sdk/lib/Model/LineItem.php +++ b/wallee-sdk/lib/Model/LineItem.php @@ -1,10 +1,8 @@ 'float', - 'amountExcludingTax' => 'float', - 'amountIncludingTax' => 'float', - 'attributes' => 'map[string,\Wallee\Sdk\Model\LineItemAttribute]', - 'name' => 'string', - 'quantity' => 'float', - 'shippingRequired' => 'bool', - 'sku' => 'string', - 'taxAmount' => 'float', - 'taxAmountPerUnit' => 'float', - 'taxes' => '\Wallee\Sdk\Model\Tax[]', - 'type' => '\Wallee\Sdk\Model\LineItemType', - 'uniqueId' => 'string', - 'unitPriceExcludingTax' => 'float', - 'unitPriceIncludingTax' => 'float' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The aggregated tax rate is the sum of all tax rates of the line item. - * - * @var float - */ - private $aggregatedTaxRate; - - /** - * - * - * @var float - */ - private $amountExcludingTax; - - /** - * - * - * @var float - */ - private $amountIncludingTax; - - /** - * - * - * @var map[string,\Wallee\Sdk\Model\LineItemAttribute] - */ - private $attributes; - - /** - * - * - * @var string - */ - private $name; - - /** - * - * - * @var float - */ - private $quantity; - - /** - * - * - * @var bool - */ - private $shippingRequired; - - /** - * - * - * @var string - */ - private $sku; - - /** - * - * - * @var float - */ - private $taxAmount; - - /** - * - * - * @var float - */ - private $taxAmountPerUnit; - - /** - * - * - * @var \Wallee\Sdk\Model\Tax[] - */ - private $taxes; - - /** - * - * - * @var \Wallee\Sdk\Model\LineItemType - */ - private $type; - - /** - * The unique id identifies the line item within the set of line items associated with the transaction. - * - * @var string - */ - private $uniqueId; - - /** - * - * - * @var float - */ - private $unitPriceExcludingTax; - - /** - * - * - * @var float - */ - private $unitPriceIncludingTax; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['attributes'])) { - $this->setAttributes($data['attributes']); - } - if (isset($data['taxes'])) { - $this->setTaxes($data['taxes']); - } - if (isset($data['type'])) { - $this->setType($data['type']); - } - } - - - /** - * Returns aggregatedTaxRate. - * - * The aggregated tax rate is the sum of all tax rates of the line item. - * - * @return float - */ - public function getAggregatedTaxRate() { - return $this->aggregatedTaxRate; - } - - /** - * Sets aggregatedTaxRate. - * - * @param float $aggregatedTaxRate - * @return LineItem - */ - protected function setAggregatedTaxRate($aggregatedTaxRate) { - $this->aggregatedTaxRate = $aggregatedTaxRate; - - return $this; - } - - /** - * Returns amountExcludingTax. - * - * - * - * @return float - */ - public function getAmountExcludingTax() { - return $this->amountExcludingTax; - } - - /** - * Sets amountExcludingTax. - * - * @param float $amountExcludingTax - * @return LineItem - */ - protected function setAmountExcludingTax($amountExcludingTax) { - $this->amountExcludingTax = $amountExcludingTax; - - return $this; - } - - /** - * Returns amountIncludingTax. - * - * - * - * @return float - */ - public function getAmountIncludingTax() { - return $this->amountIncludingTax; - } - - /** - * Sets amountIncludingTax. - * - * @param float $amountIncludingTax - * @return LineItem - */ - protected function setAmountIncludingTax($amountIncludingTax) { - $this->amountIncludingTax = $amountIncludingTax; - - return $this; - } - - /** - * Returns attributes. - * - * - * - * @return map[string,\Wallee\Sdk\Model\LineItemAttribute] - */ - public function getAttributes() { - return $this->attributes; - } - - /** - * Sets attributes. - * - * @param map[string,\Wallee\Sdk\Model\LineItemAttribute] $attributes - * @return LineItem - */ - public function setAttributes($attributes) { - if (is_array($attributes) && empty($attributes)) { - $this->attributes = new \stdClass; - } else { - $this->attributes = $attributes; - } - - return $this; - } - - /** - * Returns name. - * - * - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return LineItem - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns quantity. - * - * - * - * @return float - */ - public function getQuantity() { - return $this->quantity; - } - - /** - * Sets quantity. - * - * @param float $quantity - * @return LineItem - */ - protected function setQuantity($quantity) { - $this->quantity = $quantity; - - return $this; - } - - /** - * Returns shippingRequired. - * - * - * - * @return bool - */ - public function getShippingRequired() { - return $this->shippingRequired; - } - - /** - * Sets shippingRequired. - * - * @param bool $shippingRequired - * @return LineItem - */ - protected function setShippingRequired($shippingRequired) { - $this->shippingRequired = $shippingRequired; - - return $this; - } - - /** - * Returns sku. - * - * - * - * @return string - */ - public function getSku() { - return $this->sku; - } - - /** - * Sets sku. - * - * @param string $sku - * @return LineItem - */ - protected function setSku($sku) { - $this->sku = $sku; - - return $this; - } - - /** - * Returns taxAmount. - * - * - * - * @return float - */ - public function getTaxAmount() { - return $this->taxAmount; - } - - /** - * Sets taxAmount. - * - * @param float $taxAmount - * @return LineItem - */ - protected function setTaxAmount($taxAmount) { - $this->taxAmount = $taxAmount; - - return $this; - } - - /** - * Returns taxAmountPerUnit. - * - * - * - * @return float - */ - public function getTaxAmountPerUnit() { - return $this->taxAmountPerUnit; - } - - /** - * Sets taxAmountPerUnit. - * - * @param float $taxAmountPerUnit - * @return LineItem - */ - protected function setTaxAmountPerUnit($taxAmountPerUnit) { - $this->taxAmountPerUnit = $taxAmountPerUnit; - - return $this; - } - - /** - * Returns taxes. - * - * - * - * @return \Wallee\Sdk\Model\Tax[] - */ - public function getTaxes() { - return $this->taxes; - } - - /** - * Sets taxes. - * - * @param \Wallee\Sdk\Model\Tax[] $taxes - * @return LineItem - */ - public function setTaxes($taxes) { - $this->taxes = $taxes; - - return $this; - } - - /** - * Returns type. - * - * - * - * @return \Wallee\Sdk\Model\LineItemType - */ - public function getType() { - return $this->type; - } - - /** - * Sets type. - * - * @param \Wallee\Sdk\Model\LineItemType $type - * @return LineItem - */ - public function setType($type) { - $this->type = $type; - - return $this; - } - - /** - * Returns uniqueId. - * - * The unique id identifies the line item within the set of line items associated with the transaction. - * - * @return string - */ - public function getUniqueId() { - return $this->uniqueId; - } - - /** - * Sets uniqueId. - * - * @param string $uniqueId - * @return LineItem - */ - protected function setUniqueId($uniqueId) { - $this->uniqueId = $uniqueId; - - return $this; - } - - /** - * Returns unitPriceExcludingTax. - * - * - * - * @return float - */ - public function getUnitPriceExcludingTax() { - return $this->unitPriceExcludingTax; - } - - /** - * Sets unitPriceExcludingTax. - * - * @param float $unitPriceExcludingTax - * @return LineItem - */ - protected function setUnitPriceExcludingTax($unitPriceExcludingTax) { - $this->unitPriceExcludingTax = $unitPriceExcludingTax; - - return $this; - } - - /** - * Returns unitPriceIncludingTax. - * - * - * - * @return float - */ - public function getUnitPriceIncludingTax() { - return $this->unitPriceIncludingTax; - } - - /** - * Sets unitPriceIncludingTax. - * - * @param float $unitPriceIncludingTax - * @return LineItem - */ - protected function setUnitPriceIncludingTax($unitPriceIncludingTax) { - $this->unitPriceIncludingTax = $unitPriceIncludingTax; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class LineItem implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'LineItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'aggregated_tax_rate' => 'float', + 'amount_excluding_tax' => 'float', + 'amount_including_tax' => 'float', + 'attributes' => 'map[string,\Wallee\Sdk\Model\LineItemAttribute]', + 'discount_excluding_tax' => 'float', + 'discount_including_tax' => 'float', + 'name' => 'string', + 'quantity' => 'float', + 'shipping_required' => 'bool', + 'sku' => 'string', + 'tax_amount' => 'float', + 'tax_amount_per_unit' => 'float', + 'taxes' => '\Wallee\Sdk\Model\Tax[]', + 'type' => '\Wallee\Sdk\Model\LineItemType', + 'undiscounted_amount_excluding_tax' => 'float', + 'undiscounted_amount_including_tax' => 'float', + 'undiscounted_unit_price_excluding_tax' => 'float', + 'undiscounted_unit_price_including_tax' => 'float', + 'unique_id' => 'string', + 'unit_price_excluding_tax' => 'float', + 'unit_price_including_tax' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'aggregated_tax_rate' => null, + 'amount_excluding_tax' => null, + 'amount_including_tax' => null, + 'attributes' => null, + 'discount_excluding_tax' => null, + 'discount_including_tax' => null, + 'name' => null, + 'quantity' => null, + 'shipping_required' => null, + 'sku' => null, + 'tax_amount' => null, + 'tax_amount_per_unit' => null, + 'taxes' => null, + 'type' => null, + 'undiscounted_amount_excluding_tax' => null, + 'undiscounted_amount_including_tax' => null, + 'undiscounted_unit_price_excluding_tax' => null, + 'undiscounted_unit_price_including_tax' => null, + 'unique_id' => null, + 'unit_price_excluding_tax' => null, + 'unit_price_including_tax' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'aggregated_tax_rate' => 'aggregatedTaxRate', + 'amount_excluding_tax' => 'amountExcludingTax', + 'amount_including_tax' => 'amountIncludingTax', + 'attributes' => 'attributes', + 'discount_excluding_tax' => 'discountExcludingTax', + 'discount_including_tax' => 'discountIncludingTax', + 'name' => 'name', + 'quantity' => 'quantity', + 'shipping_required' => 'shippingRequired', + 'sku' => 'sku', + 'tax_amount' => 'taxAmount', + 'tax_amount_per_unit' => 'taxAmountPerUnit', + 'taxes' => 'taxes', + 'type' => 'type', + 'undiscounted_amount_excluding_tax' => 'undiscountedAmountExcludingTax', + 'undiscounted_amount_including_tax' => 'undiscountedAmountIncludingTax', + 'undiscounted_unit_price_excluding_tax' => 'undiscountedUnitPriceExcludingTax', + 'undiscounted_unit_price_including_tax' => 'undiscountedUnitPriceIncludingTax', + 'unique_id' => 'uniqueId', + 'unit_price_excluding_tax' => 'unitPriceExcludingTax', + 'unit_price_including_tax' => 'unitPriceIncludingTax' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'aggregated_tax_rate' => 'setAggregatedTaxRate', + 'amount_excluding_tax' => 'setAmountExcludingTax', + 'amount_including_tax' => 'setAmountIncludingTax', + 'attributes' => 'setAttributes', + 'discount_excluding_tax' => 'setDiscountExcludingTax', + 'discount_including_tax' => 'setDiscountIncludingTax', + 'name' => 'setName', + 'quantity' => 'setQuantity', + 'shipping_required' => 'setShippingRequired', + 'sku' => 'setSku', + 'tax_amount' => 'setTaxAmount', + 'tax_amount_per_unit' => 'setTaxAmountPerUnit', + 'taxes' => 'setTaxes', + 'type' => 'setType', + 'undiscounted_amount_excluding_tax' => 'setUndiscountedAmountExcludingTax', + 'undiscounted_amount_including_tax' => 'setUndiscountedAmountIncludingTax', + 'undiscounted_unit_price_excluding_tax' => 'setUndiscountedUnitPriceExcludingTax', + 'undiscounted_unit_price_including_tax' => 'setUndiscountedUnitPriceIncludingTax', + 'unique_id' => 'setUniqueId', + 'unit_price_excluding_tax' => 'setUnitPriceExcludingTax', + 'unit_price_including_tax' => 'setUnitPriceIncludingTax' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'aggregated_tax_rate' => 'getAggregatedTaxRate', + 'amount_excluding_tax' => 'getAmountExcludingTax', + 'amount_including_tax' => 'getAmountIncludingTax', + 'attributes' => 'getAttributes', + 'discount_excluding_tax' => 'getDiscountExcludingTax', + 'discount_including_tax' => 'getDiscountIncludingTax', + 'name' => 'getName', + 'quantity' => 'getQuantity', + 'shipping_required' => 'getShippingRequired', + 'sku' => 'getSku', + 'tax_amount' => 'getTaxAmount', + 'tax_amount_per_unit' => 'getTaxAmountPerUnit', + 'taxes' => 'getTaxes', + 'type' => 'getType', + 'undiscounted_amount_excluding_tax' => 'getUndiscountedAmountExcludingTax', + 'undiscounted_amount_including_tax' => 'getUndiscountedAmountIncludingTax', + 'undiscounted_unit_price_excluding_tax' => 'getUndiscountedUnitPriceExcludingTax', + 'undiscounted_unit_price_including_tax' => 'getUndiscountedUnitPriceIncludingTax', + 'unique_id' => 'getUniqueId', + 'unit_price_excluding_tax' => 'getUnitPriceExcludingTax', + 'unit_price_including_tax' => 'getUnitPriceIncludingTax' + ]; + + + + /** + * 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['aggregated_tax_rate'] = isset($data['aggregated_tax_rate']) ? $data['aggregated_tax_rate'] : null; + + $this->container['amount_excluding_tax'] = isset($data['amount_excluding_tax']) ? $data['amount_excluding_tax'] : null; + + $this->container['amount_including_tax'] = isset($data['amount_including_tax']) ? $data['amount_including_tax'] : null; + + $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null; + + $this->container['discount_excluding_tax'] = isset($data['discount_excluding_tax']) ? $data['discount_excluding_tax'] : null; + + $this->container['discount_including_tax'] = isset($data['discount_including_tax']) ? $data['discount_including_tax'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; + + $this->container['shipping_required'] = isset($data['shipping_required']) ? $data['shipping_required'] : null; + + $this->container['sku'] = isset($data['sku']) ? $data['sku'] : null; + + $this->container['tax_amount'] = isset($data['tax_amount']) ? $data['tax_amount'] : null; + + $this->container['tax_amount_per_unit'] = isset($data['tax_amount_per_unit']) ? $data['tax_amount_per_unit'] : null; + + $this->container['taxes'] = isset($data['taxes']) ? $data['taxes'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + $this->container['undiscounted_amount_excluding_tax'] = isset($data['undiscounted_amount_excluding_tax']) ? $data['undiscounted_amount_excluding_tax'] : null; + + $this->container['undiscounted_amount_including_tax'] = isset($data['undiscounted_amount_including_tax']) ? $data['undiscounted_amount_including_tax'] : null; + + $this->container['undiscounted_unit_price_excluding_tax'] = isset($data['undiscounted_unit_price_excluding_tax']) ? $data['undiscounted_unit_price_excluding_tax'] : null; + + $this->container['undiscounted_unit_price_including_tax'] = isset($data['undiscounted_unit_price_including_tax']) ? $data['undiscounted_unit_price_including_tax'] : null; + + $this->container['unique_id'] = isset($data['unique_id']) ? $data['unique_id'] : null; + + $this->container['unit_price_excluding_tax'] = isset($data['unit_price_excluding_tax']) ? $data['unit_price_excluding_tax'] : null; + + $this->container['unit_price_including_tax'] = isset($data['unit_price_including_tax']) ? $data['unit_price_including_tax'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 aggregated_tax_rate + * + * @return float + */ + public function getAggregatedTaxRate() + { + return $this->container['aggregated_tax_rate']; + } + + /** + * Sets aggregated_tax_rate + * + * @param float $aggregated_tax_rate The aggregated tax rate is the sum of all tax rates of the line item. + * + * @return $this + */ + public function setAggregatedTaxRate($aggregated_tax_rate) + { + $this->container['aggregated_tax_rate'] = $aggregated_tax_rate; + + return $this; + } + + + /** + * Gets amount_excluding_tax + * + * @return float + */ + public function getAmountExcludingTax() + { + return $this->container['amount_excluding_tax']; + } + + /** + * Sets amount_excluding_tax + * + * @param float $amount_excluding_tax + * + * @return $this + */ + public function setAmountExcludingTax($amount_excluding_tax) + { + $this->container['amount_excluding_tax'] = $amount_excluding_tax; + + return $this; + } + + + /** + * Gets amount_including_tax + * + * @return float + */ + public function getAmountIncludingTax() + { + return $this->container['amount_including_tax']; + } + + /** + * Sets amount_including_tax + * + * @param float $amount_including_tax + * + * @return $this + */ + public function setAmountIncludingTax($amount_including_tax) + { + $this->container['amount_including_tax'] = $amount_including_tax; + + return $this; + } + + + /** + * Gets attributes + * + * @return map[string,\Wallee\Sdk\Model\LineItemAttribute] + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param map[string,\Wallee\Sdk\Model\LineItemAttribute] $attributes + * + * @return $this + */ + public function setAttributes($attributes) + { + $this->container['attributes'] = $attributes; + + return $this; + } + + + /** + * Gets discount_excluding_tax + * + * @return float + */ + public function getDiscountExcludingTax() + { + return $this->container['discount_excluding_tax']; + } + + /** + * Sets discount_excluding_tax + * + * @param float $discount_excluding_tax + * + * @return $this + */ + public function setDiscountExcludingTax($discount_excluding_tax) + { + $this->container['discount_excluding_tax'] = $discount_excluding_tax; + + return $this; + } + + + /** + * Gets discount_including_tax + * + * @return float + */ + public function getDiscountIncludingTax() + { + return $this->container['discount_including_tax']; + } + + /** + * Sets discount_including_tax + * + * @param float $discount_including_tax + * + * @return $this + */ + public function setDiscountIncludingTax($discount_including_tax) + { + $this->container['discount_including_tax'] = $discount_including_tax; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets quantity + * + * @return float + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param float $quantity + * + * @return $this + */ + public function setQuantity($quantity) + { + $this->container['quantity'] = $quantity; + + return $this; + } + + + /** + * Gets shipping_required + * + * @return bool + */ + public function getShippingRequired() + { + return $this->container['shipping_required']; + } + + /** + * Sets shipping_required + * + * @param bool $shipping_required + * + * @return $this + */ + public function setShippingRequired($shipping_required) + { + $this->container['shipping_required'] = $shipping_required; + + return $this; + } + + + /** + * Gets sku + * + * @return string + */ + public function getSku() + { + return $this->container['sku']; + } + + /** + * Sets sku + * + * @param string $sku + * + * @return $this + */ + public function setSku($sku) + { + $this->container['sku'] = $sku; + + return $this; + } + + + /** + * Gets tax_amount + * + * @return float + */ + public function getTaxAmount() + { + return $this->container['tax_amount']; + } + + /** + * Sets tax_amount + * + * @param float $tax_amount + * + * @return $this + */ + public function setTaxAmount($tax_amount) + { + $this->container['tax_amount'] = $tax_amount; + + return $this; + } + + + /** + * Gets tax_amount_per_unit + * + * @return float + */ + public function getTaxAmountPerUnit() + { + return $this->container['tax_amount_per_unit']; + } + + /** + * Sets tax_amount_per_unit + * + * @param float $tax_amount_per_unit + * + * @return $this + */ + public function setTaxAmountPerUnit($tax_amount_per_unit) + { + $this->container['tax_amount_per_unit'] = $tax_amount_per_unit; + + return $this; + } + + + /** + * Gets taxes + * + * @return \Wallee\Sdk\Model\Tax[] + */ + public function getTaxes() + { + return $this->container['taxes']; + } + + /** + * Sets taxes + * + * @param \Wallee\Sdk\Model\Tax[] $taxes + * + * @return $this + */ + public function setTaxes($taxes) + { + $this->container['taxes'] = $taxes; + + return $this; + } + + + /** + * Gets type + * + * @return \Wallee\Sdk\Model\LineItemType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Wallee\Sdk\Model\LineItemType $type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + + /** + * Gets undiscounted_amount_excluding_tax + * + * @return float + */ + public function getUndiscountedAmountExcludingTax() + { + return $this->container['undiscounted_amount_excluding_tax']; + } + + /** + * Sets undiscounted_amount_excluding_tax + * + * @param float $undiscounted_amount_excluding_tax + * + * @return $this + */ + public function setUndiscountedAmountExcludingTax($undiscounted_amount_excluding_tax) + { + $this->container['undiscounted_amount_excluding_tax'] = $undiscounted_amount_excluding_tax; + + return $this; + } + + + /** + * Gets undiscounted_amount_including_tax + * + * @return float + */ + public function getUndiscountedAmountIncludingTax() + { + return $this->container['undiscounted_amount_including_tax']; + } + + /** + * Sets undiscounted_amount_including_tax + * + * @param float $undiscounted_amount_including_tax + * + * @return $this + */ + public function setUndiscountedAmountIncludingTax($undiscounted_amount_including_tax) + { + $this->container['undiscounted_amount_including_tax'] = $undiscounted_amount_including_tax; + + return $this; + } + + + /** + * Gets undiscounted_unit_price_excluding_tax + * + * @return float + */ + public function getUndiscountedUnitPriceExcludingTax() + { + return $this->container['undiscounted_unit_price_excluding_tax']; + } + + /** + * Sets undiscounted_unit_price_excluding_tax + * + * @param float $undiscounted_unit_price_excluding_tax + * + * @return $this + */ + public function setUndiscountedUnitPriceExcludingTax($undiscounted_unit_price_excluding_tax) + { + $this->container['undiscounted_unit_price_excluding_tax'] = $undiscounted_unit_price_excluding_tax; + + return $this; + } + + + /** + * Gets undiscounted_unit_price_including_tax + * + * @return float + */ + public function getUndiscountedUnitPriceIncludingTax() + { + return $this->container['undiscounted_unit_price_including_tax']; + } + + /** + * Sets undiscounted_unit_price_including_tax + * + * @param float $undiscounted_unit_price_including_tax + * + * @return $this + */ + public function setUndiscountedUnitPriceIncludingTax($undiscounted_unit_price_including_tax) + { + $this->container['undiscounted_unit_price_including_tax'] = $undiscounted_unit_price_including_tax; + + return $this; + } + + + /** + * Gets unique_id + * + * @return string + */ + public function getUniqueId() + { + return $this->container['unique_id']; + } + + /** + * Sets unique_id + * + * @param string $unique_id The unique id identifies the line item within the set of line items associated with the transaction. + * + * @return $this + */ + public function setUniqueId($unique_id) + { + $this->container['unique_id'] = $unique_id; + + return $this; + } + + + /** + * Gets unit_price_excluding_tax + * + * @return float + */ + public function getUnitPriceExcludingTax() + { + return $this->container['unit_price_excluding_tax']; + } + + /** + * Sets unit_price_excluding_tax + * + * @param float $unit_price_excluding_tax + * + * @return $this + */ + public function setUnitPriceExcludingTax($unit_price_excluding_tax) + { + $this->container['unit_price_excluding_tax'] = $unit_price_excluding_tax; + + return $this; + } + + + /** + * Gets unit_price_including_tax + * + * @return float + */ + public function getUnitPriceIncludingTax() + { + return $this->container['unit_price_including_tax']; + } + + /** + * Sets unit_price_including_tax + * + * @param float $unit_price_including_tax + * + * @return $this + */ + public function setUnitPriceIncludingTax($unit_price_including_tax) + { + $this->container['unit_price_including_tax'] = $unit_price_including_tax; + + 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/wallee-sdk/lib/Model/LineItemAttribute.php b/wallee-sdk/lib/Model/LineItemAttribute.php index 8505d1a..cec6a69 100644 --- a/wallee-sdk/lib/Model/LineItemAttribute.php +++ b/wallee-sdk/lib/Model/LineItemAttribute.php @@ -1,10 +1,8 @@ 'string', - 'value' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var string - */ - private $label; - - /** - * - * - * @var string - */ - private $value; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - } - - - /** - * Returns label. - * - * - * - * @return string - */ - public function getLabel() { - return $this->label; - } - - /** - * Sets label. - * - * @param string $label - * @return LineItemAttribute - */ - protected function setLabel($label) { - $this->label = $label; - - return $this; - } - - /** - * Returns value. - * - * - * - * @return string - */ - public function getValue() { - return $this->value; - } - - /** - * Sets value. - * - * @param string $value - * @return LineItemAttribute - */ - protected function setValue($value) { - $this->value = $value; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class LineItemAttribute implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'LineItemAttribute'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'label' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'label' => null, + 'value' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'label' => 'label', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'label' => 'setLabel', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'label' => 'getLabel', + 'value' => 'getValue' + ]; + + + + /** + * 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['label'] = isset($data['label']) ? $data['label'] : null; + + $this->container['value'] = isset($data['value']) ? $data['value'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 label + * + * @return string + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string $label + * + * @return $this + */ + public function setLabel($label) + { + $this->container['label'] = $label; + + return $this; + } + + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value + * + * @return $this + */ + public function setValue($value) + { + $this->container['value'] = $value; + + 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/wallee-sdk/lib/Model/LineItemAttributeCreate.php b/wallee-sdk/lib/Model/LineItemAttributeCreate.php index 7645d8b..f78ef70 100644 --- a/wallee-sdk/lib/Model/LineItemAttributeCreate.php +++ b/wallee-sdk/lib/Model/LineItemAttributeCreate.php @@ -1,10 +1,8 @@ 'string', - 'value' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var string - */ - private $label; - - /** - * - * - * @var string - */ - private $value; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['label'])) { - $this->setLabel($data['label']); - } - if (isset($data['value'])) { - $this->setValue($data['value']); - } - } - - - /** - * Returns label. - * - * - * - * @return string - */ - public function getLabel() { - return $this->label; - } - - /** - * Sets label. - * - * @param string $label - * @return LineItemAttributeCreate - */ - public function setLabel($label) { - $this->label = $label; - - return $this; - } - - /** - * Returns value. - * - * - * - * @return string - */ - public function getValue() { - return $this->value; - } - - /** - * Sets value. - * - * @param string $value - * @return LineItemAttributeCreate - */ - public function setValue($value) { - $this->value = $value; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getLabel() === null) { - throw new ValidationException("'label' can't be null", 'label', $this); - } - if ($this->getValue() === null) { - throw new ValidationException("'value' can't be null", 'value', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class LineItemAttributeCreate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'LineItemAttribute.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'label' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'label' => null, + 'value' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'label' => 'label', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'label' => 'setLabel', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'label' => 'getLabel', + 'value' => 'getValue' + ]; + + + + /** + * 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['label'] = isset($data['label']) ? $data['label'] : null; + + $this->container['value'] = isset($data['value']) ? $data['value'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['label'] === null) { + $invalidProperties[] = "'label' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 label + * + * @return string + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string $label + * + * @return $this + */ + public function setLabel($label) + { + $this->container['label'] = $label; + + return $this; + } + + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value + * + * @return $this + */ + public function setValue($value) + { + $this->container['value'] = $value; + + 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/wallee-sdk/lib/Model/LineItemCreate.php b/wallee-sdk/lib/Model/LineItemCreate.php index b0f6cbc..57d6ecb 100644 --- a/wallee-sdk/lib/Model/LineItemCreate.php +++ b/wallee-sdk/lib/Model/LineItemCreate.php @@ -1,10 +1,8 @@ 'float', - 'attributes' => 'map[string,\Wallee\Sdk\Model\LineItemAttributeCreate]', - 'name' => 'string', - 'quantity' => 'float', - 'shippingRequired' => 'bool', - 'sku' => 'string', - 'taxes' => '\Wallee\Sdk\Model\TaxCreate[]', - 'type' => '\Wallee\Sdk\Model\LineItemType', - 'uniqueId' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var float - */ - private $amountIncludingTax; - - /** - * - * - * @var map[string,\Wallee\Sdk\Model\LineItemAttributeCreate] - */ - private $attributes; - - /** - * - * - * @var string - */ - private $name; - - /** - * - * - * @var float - */ - private $quantity; - - /** - * - * - * @var bool - */ - private $shippingRequired; - - /** - * - * - * @var string - */ - private $sku; - - /** - * - * - * @var \Wallee\Sdk\Model\TaxCreate[] - */ - private $taxes; - - /** - * - * - * @var \Wallee\Sdk\Model\LineItemType - */ - private $type; - - /** - * The unique id identifies the line item within the set of line items associated with the transaction. - * - * @var string - */ - private $uniqueId; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['amountIncludingTax'])) { - $this->setAmountIncludingTax($data['amountIncludingTax']); - } - if (isset($data['attributes'])) { - $this->setAttributes($data['attributes']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['quantity'])) { - $this->setQuantity($data['quantity']); - } - if (isset($data['shippingRequired'])) { - $this->setShippingRequired($data['shippingRequired']); - } - if (isset($data['sku'])) { - $this->setSku($data['sku']); - } - if (isset($data['taxes'])) { - $this->setTaxes($data['taxes']); - } - if (isset($data['type'])) { - $this->setType($data['type']); - } - if (isset($data['uniqueId'])) { - $this->setUniqueId($data['uniqueId']); - } - } - - - /** - * Returns amountIncludingTax. - * - * - * - * @return float - */ - public function getAmountIncludingTax() { - return $this->amountIncludingTax; - } - - /** - * Sets amountIncludingTax. - * - * @param float $amountIncludingTax - * @return LineItemCreate - */ - public function setAmountIncludingTax($amountIncludingTax) { - $this->amountIncludingTax = $amountIncludingTax; - - return $this; - } - - /** - * Returns attributes. - * - * - * - * @return map[string,\Wallee\Sdk\Model\LineItemAttributeCreate] - */ - public function getAttributes() { - return $this->attributes; - } - - /** - * Sets attributes. - * - * @param map[string,\Wallee\Sdk\Model\LineItemAttributeCreate] $attributes - * @return LineItemCreate - */ - public function setAttributes($attributes) { - if (is_array($attributes) && empty($attributes)) { - $this->attributes = new \stdClass; - } else { - $this->attributes = $attributes; - } - - return $this; - } - - /** - * Returns name. - * - * - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return LineItemCreate - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns quantity. - * - * - * - * @return float - */ - public function getQuantity() { - return $this->quantity; - } - - /** - * Sets quantity. - * - * @param float $quantity - * @return LineItemCreate - */ - public function setQuantity($quantity) { - $this->quantity = $quantity; - - return $this; - } - - /** - * Returns shippingRequired. - * - * - * - * @return bool - */ - public function getShippingRequired() { - return $this->shippingRequired; - } - - /** - * Sets shippingRequired. - * - * @param bool $shippingRequired - * @return LineItemCreate - */ - public function setShippingRequired($shippingRequired) { - $this->shippingRequired = $shippingRequired; - - return $this; - } - - /** - * Returns sku. - * - * - * - * @return string - */ - public function getSku() { - return $this->sku; - } - - /** - * Sets sku. - * - * @param string $sku - * @return LineItemCreate - */ - public function setSku($sku) { - $this->sku = $sku; - - return $this; - } - - /** - * Returns taxes. - * - * - * - * @return \Wallee\Sdk\Model\TaxCreate[] - */ - public function getTaxes() { - return $this->taxes; - } - - /** - * Sets taxes. - * - * @param \Wallee\Sdk\Model\TaxCreate[] $taxes - * @return LineItemCreate - */ - public function setTaxes($taxes) { - $this->taxes = $taxes; - - return $this; - } - - /** - * Returns type. - * - * - * - * @return \Wallee\Sdk\Model\LineItemType - */ - public function getType() { - return $this->type; - } - - /** - * Sets type. - * - * @param \Wallee\Sdk\Model\LineItemType $type - * @return LineItemCreate - */ - public function setType($type) { - $this->type = $type; - - return $this; - } - - /** - * Returns uniqueId. - * - * The unique id identifies the line item within the set of line items associated with the transaction. - * - * @return string - */ - public function getUniqueId() { - return $this->uniqueId; - } - - /** - * Sets uniqueId. - * - * @param string $uniqueId - * @return LineItemCreate - */ - public function setUniqueId($uniqueId) { - $this->uniqueId = $uniqueId; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getAmountIncludingTax() === null) { - throw new ValidationException("'amountIncludingTax' can't be null", 'amountIncludingTax', $this); - } - if ($this->getName() === null) { - throw new ValidationException("'name' can't be null", 'name', $this); - } - if ($this->getQuantity() === null) { - throw new ValidationException("'quantity' can't be null", 'quantity', $this); - } - if ($this->getType() === null) { - throw new ValidationException("'type' can't be null", 'type', $this); - } - if ($this->getUniqueId() === null) { - throw new ValidationException("'uniqueId' can't be null", 'uniqueId', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class LineItemCreate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'LineItem.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'amount_including_tax' => 'float', + 'attributes' => 'map[string,\Wallee\Sdk\Model\LineItemAttributeCreate]', + 'discount_including_tax' => 'float', + 'name' => 'string', + 'quantity' => 'float', + 'shipping_required' => 'bool', + 'sku' => 'string', + 'taxes' => '\Wallee\Sdk\Model\TaxCreate[]', + 'type' => '\Wallee\Sdk\Model\LineItemType', + 'unique_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'amount_including_tax' => null, + 'attributes' => null, + 'discount_including_tax' => null, + 'name' => null, + 'quantity' => null, + 'shipping_required' => null, + 'sku' => null, + 'taxes' => null, + 'type' => null, + 'unique_id' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount_including_tax' => 'amountIncludingTax', + 'attributes' => 'attributes', + 'discount_including_tax' => 'discountIncludingTax', + 'name' => 'name', + 'quantity' => 'quantity', + 'shipping_required' => 'shippingRequired', + 'sku' => 'sku', + 'taxes' => 'taxes', + 'type' => 'type', + 'unique_id' => 'uniqueId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount_including_tax' => 'setAmountIncludingTax', + 'attributes' => 'setAttributes', + 'discount_including_tax' => 'setDiscountIncludingTax', + 'name' => 'setName', + 'quantity' => 'setQuantity', + 'shipping_required' => 'setShippingRequired', + 'sku' => 'setSku', + 'taxes' => 'setTaxes', + 'type' => 'setType', + 'unique_id' => 'setUniqueId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount_including_tax' => 'getAmountIncludingTax', + 'attributes' => 'getAttributes', + 'discount_including_tax' => 'getDiscountIncludingTax', + 'name' => 'getName', + 'quantity' => 'getQuantity', + 'shipping_required' => 'getShippingRequired', + 'sku' => 'getSku', + 'taxes' => 'getTaxes', + 'type' => 'getType', + 'unique_id' => 'getUniqueId' + ]; + + + + /** + * 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['amount_including_tax'] = isset($data['amount_including_tax']) ? $data['amount_including_tax'] : null; + + $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null; + + $this->container['discount_including_tax'] = isset($data['discount_including_tax']) ? $data['discount_including_tax'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; + + $this->container['shipping_required'] = isset($data['shipping_required']) ? $data['shipping_required'] : null; + + $this->container['sku'] = isset($data['sku']) ? $data['sku'] : null; + + $this->container['taxes'] = isset($data['taxes']) ? $data['taxes'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + $this->container['unique_id'] = isset($data['unique_id']) ? $data['unique_id'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount_including_tax'] === null) { + $invalidProperties[] = "'amount_including_tax' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['quantity'] === null) { + $invalidProperties[] = "'quantity' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['unique_id'] === null) { + $invalidProperties[] = "'unique_id' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 amount_including_tax + * + * @return float + */ + public function getAmountIncludingTax() + { + return $this->container['amount_including_tax']; + } + + /** + * Sets amount_including_tax + * + * @param float $amount_including_tax + * + * @return $this + */ + public function setAmountIncludingTax($amount_including_tax) + { + $this->container['amount_including_tax'] = $amount_including_tax; + + return $this; + } + + + /** + * Gets attributes + * + * @return map[string,\Wallee\Sdk\Model\LineItemAttributeCreate] + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param map[string,\Wallee\Sdk\Model\LineItemAttributeCreate] $attributes + * + * @return $this + */ + public function setAttributes($attributes) + { + $this->container['attributes'] = $attributes; + + return $this; + } + + + /** + * Gets discount_including_tax + * + * @return float + */ + public function getDiscountIncludingTax() + { + return $this->container['discount_including_tax']; + } + + /** + * Sets discount_including_tax + * + * @param float $discount_including_tax + * + * @return $this + */ + public function setDiscountIncludingTax($discount_including_tax) + { + $this->container['discount_including_tax'] = $discount_including_tax; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets quantity + * + * @return float + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param float $quantity + * + * @return $this + */ + public function setQuantity($quantity) + { + $this->container['quantity'] = $quantity; + + return $this; + } + + + /** + * Gets shipping_required + * + * @return bool + */ + public function getShippingRequired() + { + return $this->container['shipping_required']; + } + + /** + * Sets shipping_required + * + * @param bool $shipping_required + * + * @return $this + */ + public function setShippingRequired($shipping_required) + { + $this->container['shipping_required'] = $shipping_required; + + return $this; + } + + + /** + * Gets sku + * + * @return string + */ + public function getSku() + { + return $this->container['sku']; + } + + /** + * Sets sku + * + * @param string $sku + * + * @return $this + */ + public function setSku($sku) + { + $this->container['sku'] = $sku; + + return $this; + } + + + /** + * Gets taxes + * + * @return \Wallee\Sdk\Model\TaxCreate[] + */ + public function getTaxes() + { + return $this->container['taxes']; + } + + /** + * Sets taxes + * + * @param \Wallee\Sdk\Model\TaxCreate[] $taxes + * + * @return $this + */ + public function setTaxes($taxes) + { + $this->container['taxes'] = $taxes; + + return $this; + } + + + /** + * Gets type + * + * @return \Wallee\Sdk\Model\LineItemType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Wallee\Sdk\Model\LineItemType $type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + + /** + * Gets unique_id + * + * @return string + */ + public function getUniqueId() + { + return $this->container['unique_id']; + } + + /** + * Sets unique_id + * + * @param string $unique_id The unique id identifies the line item within the set of line items associated with the transaction. + * + * @return $this + */ + public function setUniqueId($unique_id) + { + $this->container['unique_id'] = $unique_id; + + 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/wallee-sdk/lib/Model/LineItemReduction.php b/wallee-sdk/lib/Model/LineItemReduction.php index 1bc7b81..fedc5ae 100644 --- a/wallee-sdk/lib/Model/LineItemReduction.php +++ b/wallee-sdk/lib/Model/LineItemReduction.php @@ -1,10 +1,8 @@ 'string', - 'quantityReduction' => 'float', - 'unitPriceReduction' => 'float' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The unique id identifies the line item on which the reduction is applied on. - * - * @var string - */ - private $lineItemUniqueId; - - /** - * - * - * @var float - */ - private $quantityReduction; - - /** - * - * - * @var float - */ - private $unitPriceReduction; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - } - - - /** - * Returns lineItemUniqueId. - * - * The unique id identifies the line item on which the reduction is applied on. - * - * @return string - */ - public function getLineItemUniqueId() { - return $this->lineItemUniqueId; - } - - /** - * Sets lineItemUniqueId. - * - * @param string $lineItemUniqueId - * @return LineItemReduction - */ - protected function setLineItemUniqueId($lineItemUniqueId) { - $this->lineItemUniqueId = $lineItemUniqueId; - - return $this; - } - - /** - * Returns quantityReduction. - * - * - * - * @return float - */ - public function getQuantityReduction() { - return $this->quantityReduction; - } - - /** - * Sets quantityReduction. - * - * @param float $quantityReduction - * @return LineItemReduction - */ - protected function setQuantityReduction($quantityReduction) { - $this->quantityReduction = $quantityReduction; - - return $this; - } - - /** - * Returns unitPriceReduction. - * - * - * - * @return float - */ - public function getUnitPriceReduction() { - return $this->unitPriceReduction; - } - - /** - * Sets unitPriceReduction. - * - * @param float $unitPriceReduction - * @return LineItemReduction - */ - protected function setUnitPriceReduction($unitPriceReduction) { - $this->unitPriceReduction = $unitPriceReduction; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class LineItemReduction implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'LineItemReduction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'line_item_unique_id' => 'string', + 'quantity_reduction' => 'float', + 'unit_price_reduction' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'line_item_unique_id' => null, + 'quantity_reduction' => null, + 'unit_price_reduction' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'line_item_unique_id' => 'lineItemUniqueId', + 'quantity_reduction' => 'quantityReduction', + 'unit_price_reduction' => 'unitPriceReduction' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'line_item_unique_id' => 'setLineItemUniqueId', + 'quantity_reduction' => 'setQuantityReduction', + 'unit_price_reduction' => 'setUnitPriceReduction' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'line_item_unique_id' => 'getLineItemUniqueId', + 'quantity_reduction' => 'getQuantityReduction', + 'unit_price_reduction' => 'getUnitPriceReduction' + ]; + + + + /** + * 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['line_item_unique_id'] = isset($data['line_item_unique_id']) ? $data['line_item_unique_id'] : null; + + $this->container['quantity_reduction'] = isset($data['quantity_reduction']) ? $data['quantity_reduction'] : null; + + $this->container['unit_price_reduction'] = isset($data['unit_price_reduction']) ? $data['unit_price_reduction'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 line_item_unique_id + * + * @return string + */ + public function getLineItemUniqueId() + { + return $this->container['line_item_unique_id']; + } + + /** + * Sets line_item_unique_id + * + * @param string $line_item_unique_id The unique id identifies the line item on which the reduction is applied on. + * + * @return $this + */ + public function setLineItemUniqueId($line_item_unique_id) + { + $this->container['line_item_unique_id'] = $line_item_unique_id; + + return $this; + } + + + /** + * Gets quantity_reduction + * + * @return float + */ + public function getQuantityReduction() + { + return $this->container['quantity_reduction']; + } + + /** + * Sets quantity_reduction + * + * @param float $quantity_reduction + * + * @return $this + */ + public function setQuantityReduction($quantity_reduction) + { + $this->container['quantity_reduction'] = $quantity_reduction; + + return $this; + } + + + /** + * Gets unit_price_reduction + * + * @return float + */ + public function getUnitPriceReduction() + { + return $this->container['unit_price_reduction']; + } + + /** + * Sets unit_price_reduction + * + * @param float $unit_price_reduction + * + * @return $this + */ + public function setUnitPriceReduction($unit_price_reduction) + { + $this->container['unit_price_reduction'] = $unit_price_reduction; + + 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/wallee-sdk/lib/Model/LineItemReductionCreate.php b/wallee-sdk/lib/Model/LineItemReductionCreate.php index 0b10dce..e44e078 100644 --- a/wallee-sdk/lib/Model/LineItemReductionCreate.php +++ b/wallee-sdk/lib/Model/LineItemReductionCreate.php @@ -1,10 +1,8 @@ 'string', - 'quantityReduction' => 'float', - 'unitPriceReduction' => 'float' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The unique id identifies the line item on which the reduction is applied on. - * - * @var string - */ - private $lineItemUniqueId; - - /** - * - * - * @var float - */ - private $quantityReduction; - - /** - * - * - * @var float - */ - private $unitPriceReduction; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['lineItemUniqueId'])) { - $this->setLineItemUniqueId($data['lineItemUniqueId']); - } - if (isset($data['quantityReduction'])) { - $this->setQuantityReduction($data['quantityReduction']); - } - if (isset($data['unitPriceReduction'])) { - $this->setUnitPriceReduction($data['unitPriceReduction']); - } - } - - - /** - * Returns lineItemUniqueId. - * - * The unique id identifies the line item on which the reduction is applied on. - * - * @return string - */ - public function getLineItemUniqueId() { - return $this->lineItemUniqueId; - } - - /** - * Sets lineItemUniqueId. - * - * @param string $lineItemUniqueId - * @return LineItemReductionCreate - */ - public function setLineItemUniqueId($lineItemUniqueId) { - $this->lineItemUniqueId = $lineItemUniqueId; - - return $this; - } - - /** - * Returns quantityReduction. - * - * - * - * @return float - */ - public function getQuantityReduction() { - return $this->quantityReduction; - } - - /** - * Sets quantityReduction. - * - * @param float $quantityReduction - * @return LineItemReductionCreate - */ - public function setQuantityReduction($quantityReduction) { - $this->quantityReduction = $quantityReduction; - - return $this; - } - - /** - * Returns unitPriceReduction. - * - * - * - * @return float - */ - public function getUnitPriceReduction() { - return $this->unitPriceReduction; - } - - /** - * Sets unitPriceReduction. - * - * @param float $unitPriceReduction - * @return LineItemReductionCreate - */ - public function setUnitPriceReduction($unitPriceReduction) { - $this->unitPriceReduction = $unitPriceReduction; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getLineItemUniqueId() === null) { - throw new ValidationException("'lineItemUniqueId' can't be null", 'lineItemUniqueId', $this); - } - if ($this->getQuantityReduction() === null) { - throw new ValidationException("'quantityReduction' can't be null", 'quantityReduction', $this); - } - if ($this->getUnitPriceReduction() === null) { - throw new ValidationException("'unitPriceReduction' can't be null", 'unitPriceReduction', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class LineItemReductionCreate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'LineItemReduction.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'line_item_unique_id' => 'string', + 'quantity_reduction' => 'float', + 'unit_price_reduction' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'line_item_unique_id' => null, + 'quantity_reduction' => null, + 'unit_price_reduction' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'line_item_unique_id' => 'lineItemUniqueId', + 'quantity_reduction' => 'quantityReduction', + 'unit_price_reduction' => 'unitPriceReduction' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'line_item_unique_id' => 'setLineItemUniqueId', + 'quantity_reduction' => 'setQuantityReduction', + 'unit_price_reduction' => 'setUnitPriceReduction' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'line_item_unique_id' => 'getLineItemUniqueId', + 'quantity_reduction' => 'getQuantityReduction', + 'unit_price_reduction' => 'getUnitPriceReduction' + ]; + + + + /** + * 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['line_item_unique_id'] = isset($data['line_item_unique_id']) ? $data['line_item_unique_id'] : null; + + $this->container['quantity_reduction'] = isset($data['quantity_reduction']) ? $data['quantity_reduction'] : null; + + $this->container['unit_price_reduction'] = isset($data['unit_price_reduction']) ? $data['unit_price_reduction'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['line_item_unique_id'] === null) { + $invalidProperties[] = "'line_item_unique_id' can't be null"; + } + if ($this->container['quantity_reduction'] === null) { + $invalidProperties[] = "'quantity_reduction' can't be null"; + } + if ($this->container['unit_price_reduction'] === null) { + $invalidProperties[] = "'unit_price_reduction' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 line_item_unique_id + * + * @return string + */ + public function getLineItemUniqueId() + { + return $this->container['line_item_unique_id']; + } + + /** + * Sets line_item_unique_id + * + * @param string $line_item_unique_id The unique id identifies the line item on which the reduction is applied on. + * + * @return $this + */ + public function setLineItemUniqueId($line_item_unique_id) + { + $this->container['line_item_unique_id'] = $line_item_unique_id; + + return $this; + } + + + /** + * Gets quantity_reduction + * + * @return float + */ + public function getQuantityReduction() + { + return $this->container['quantity_reduction']; + } + + /** + * Sets quantity_reduction + * + * @param float $quantity_reduction + * + * @return $this + */ + public function setQuantityReduction($quantity_reduction) + { + $this->container['quantity_reduction'] = $quantity_reduction; + + return $this; + } + + + /** + * Gets unit_price_reduction + * + * @return float + */ + public function getUnitPriceReduction() + { + return $this->container['unit_price_reduction']; + } + + /** + * Sets unit_price_reduction + * + * @param float $unit_price_reduction + * + * @return $this + */ + public function setUnitPriceReduction($unit_price_reduction) + { + $this->container['unit_price_reduction'] = $unit_price_reduction; + + 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/wallee-sdk/lib/Model/LineItemType.php b/wallee-sdk/lib/Model/LineItemType.php index ac88f6e..9c1700f 100644 --- a/wallee-sdk/lib/Model/LineItemType.php +++ b/wallee-sdk/lib/Model/LineItemType.php @@ -1,10 +1,8 @@ 'string', - 'language' => 'string', - 'string' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var string - */ - private $displayName; - - /** - * - * - * @var string - */ - private $language; - - /** - * - * - * @var string - */ - private $string; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - } - - - /** - * Returns displayName. - * - * - * - * @return string - */ - public function getDisplayName() { - return $this->displayName; - } - - /** - * Sets displayName. - * - * @param string $displayName - * @return LocalizedString - */ - protected function setDisplayName($displayName) { - $this->displayName = $displayName; - - return $this; - } - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return LocalizedString - */ - protected function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns string. - * - * - * - * @return string - */ - public function getString() { - return $this->string; - } - - /** - * Sets string. - * - * @param string $string - * @return LocalizedString - */ - protected function setString($string) { - $this->string = $string; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class LocalizedString implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'LocalizedString'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'display_name' => 'string', + 'language' => 'string', + 'string' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'display_name' => null, + 'language' => null, + 'string' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'display_name' => 'displayName', + 'language' => 'language', + 'string' => 'string' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'display_name' => 'setDisplayName', + 'language' => 'setLanguage', + 'string' => 'setString' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'display_name' => 'getDisplayName', + 'language' => 'getLanguage', + 'string' => 'getString' + ]; + + + + /** + * 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['display_name'] = isset($data['display_name']) ? $data['display_name'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['string'] = isset($data['string']) ? $data['string'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 display_name + * + * @return string + */ + public function getDisplayName() + { + return $this->container['display_name']; + } + + /** + * Sets display_name + * + * @param string $display_name + * + * @return $this + */ + public function setDisplayName($display_name) + { + $this->container['display_name'] = $display_name; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets string + * + * @return string + */ + public function getString() + { + return $this->container['string']; + } + + /** + * Sets string + * + * @param string $string + * + * @return $this + */ + public function setString($string) + { + $this->container['string'] = $string; + + 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/wallee-sdk/lib/Model/ManualTask.php b/wallee-sdk/lib/Model/ManualTask.php index aee7048..3c17b02 100644 --- a/wallee-sdk/lib/Model/ManualTask.php +++ b/wallee-sdk/lib/Model/ManualTask.php @@ -1,10 +1,8 @@ 'int[]', - 'contextEntityId' => 'int', - 'createdOn' => '\DateTime', - 'expiresOn' => '\DateTime', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'plannedPurgeDate' => '\DateTime', - 'spaceId' => 'int', - 'state' => '\Wallee\Sdk\Model\ManualTaskState', - 'type' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var int[] - */ - private $actions; - - /** - * The context entity ID links the manual task to the entity which caused its creation. - * - * @var int - */ - private $contextEntityId; - - /** - * The created on date indicates the date on which the entity was stored into the database. - * - * @var \DateTime - */ - private $createdOn; - - /** - * The expiry date indicates until when the manual task has to be executed. - * - * @var \DateTime - */ - private $expiresOn; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var int - */ - private $spaceId; - - /** - * - * - * @var \Wallee\Sdk\Model\ManualTaskState - */ - private $state; - - /** - * The type categorizes the manual task. - * - * @var int - */ - private $type; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['actions'])) { - $this->setActions($data['actions']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - } - - - /** - * Returns actions. - * - * - * - * @return int[] - */ - public function getActions() { - return $this->actions; - } - - /** - * Sets actions. - * - * @param int[] $actions - * @return ManualTask - */ - public function setActions($actions) { - $this->actions = $actions; - - return $this; - } - - /** - * Returns contextEntityId. - * - * The context entity ID links the manual task to the entity which caused its creation. - * - * @return int - */ - public function getContextEntityId() { - return $this->contextEntityId; - } - - /** - * Sets contextEntityId. - * - * @param int $contextEntityId - * @return ManualTask - */ - protected function setContextEntityId($contextEntityId) { - $this->contextEntityId = $contextEntityId; - - return $this; - } - - /** - * Returns createdOn. - * - * The created on date indicates the date on which the entity was stored into the database. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return ManualTask - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns expiresOn. - * - * The expiry date indicates until when the manual task has to be executed. - * - * @return \DateTime - */ - public function getExpiresOn() { - return $this->expiresOn; - } - - /** - * Sets expiresOn. - * - * @param \DateTime $expiresOn - * @return ManualTask - */ - protected function setExpiresOn($expiresOn) { - $this->expiresOn = $expiresOn; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return ManualTask - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return ManualTask - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return ManualTask - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns spaceId. - * - * - * - * @return int - */ - public function getSpaceId() { - return $this->spaceId; - } - - /** - * Sets spaceId. - * - * @param int $spaceId - * @return ManualTask - */ - protected function setSpaceId($spaceId) { - $this->spaceId = $spaceId; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\ManualTaskState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\ManualTaskState $state - * @return ManualTask - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns type. - * - * The type categorizes the manual task. - * - * @return int - */ - public function getType() { - return $this->type; - } - - /** - * Sets type. - * - * @param int $type - * @return ManualTask - */ - protected function setType($type) { - $this->type = $type; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class ManualTask implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ManualTask'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'actions' => 'int[]', + 'context_entity_id' => 'int', + 'created_on' => '\DateTime', + 'expires_on' => '\DateTime', + 'id' => 'int', + 'linked_space_id' => 'int', + 'planned_purge_date' => '\DateTime', + 'space_id' => 'int', + 'state' => '\Wallee\Sdk\Model\ManualTaskState', + 'type' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'actions' => 'int64', + 'context_entity_id' => 'int64', + 'created_on' => 'date-time', + 'expires_on' => 'date-time', + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'planned_purge_date' => 'date-time', + 'space_id' => 'int64', + 'state' => null, + 'type' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'actions' => 'actions', + 'context_entity_id' => 'contextEntityId', + 'created_on' => 'createdOn', + 'expires_on' => 'expiresOn', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'planned_purge_date' => 'plannedPurgeDate', + 'space_id' => 'spaceId', + 'state' => 'state', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'actions' => 'setActions', + 'context_entity_id' => 'setContextEntityId', + 'created_on' => 'setCreatedOn', + 'expires_on' => 'setExpiresOn', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'space_id' => 'setSpaceId', + 'state' => 'setState', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'actions' => 'getActions', + 'context_entity_id' => 'getContextEntityId', + 'created_on' => 'getCreatedOn', + 'expires_on' => 'getExpiresOn', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'space_id' => 'getSpaceId', + 'state' => 'getState', + 'type' => 'getType' + ]; + + + + /** + * 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['actions'] = isset($data['actions']) ? $data['actions'] : null; + + $this->container['context_entity_id'] = isset($data['context_entity_id']) ? $data['context_entity_id'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['expires_on'] = isset($data['expires_on']) ? $data['expires_on'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['space_id'] = isset($data['space_id']) ? $data['space_id'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 actions + * + * @return int[] + */ + public function getActions() + { + return $this->container['actions']; + } + + /** + * Sets actions + * + * @param int[] $actions + * + * @return $this + */ + public function setActions($actions) + { + $this->container['actions'] = $actions; + + return $this; + } + + + /** + * Gets context_entity_id + * + * @return int + */ + public function getContextEntityId() + { + return $this->container['context_entity_id']; + } + + /** + * Sets context_entity_id + * + * @param int $context_entity_id The context entity ID links the manual task to the entity which caused its creation. + * + * @return $this + */ + public function setContextEntityId($context_entity_id) + { + $this->container['context_entity_id'] = $context_entity_id; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets expires_on + * + * @return \DateTime + */ + public function getExpiresOn() + { + return $this->container['expires_on']; + } + + /** + * Sets expires_on + * + * @param \DateTime $expires_on The expiry date indicates until when the manual task has to be executed. + * + * @return $this + */ + public function setExpiresOn($expires_on) + { + $this->container['expires_on'] = $expires_on; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets space_id + * + * @return int + */ + public function getSpaceId() + { + return $this->container['space_id']; + } + + /** + * Sets space_id + * + * @param int $space_id + * + * @return $this + */ + public function setSpaceId($space_id) + { + $this->container['space_id'] = $space_id; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\ManualTaskState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\ManualTaskState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets type + * + * @return int + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param int $type The type categorizes the manual task. + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + 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/wallee-sdk/lib/Model/ManualTaskAction.php b/wallee-sdk/lib/Model/ManualTaskAction.php index ba7aeb9..4d0c8ec 100644 --- a/wallee-sdk/lib/Model/ManualTaskAction.php +++ b/wallee-sdk/lib/Model/ManualTaskAction.php @@ -1,10 +1,8 @@ 'int', - 'label' => 'map[string,string]', - 'style' => '\Wallee\Sdk\Model\ManualTaskActionStyle', - 'taskType' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $label; - - /** - * - * - * @var \Wallee\Sdk\Model\ManualTaskActionStyle - */ - private $style; - - /** - * - * - * @var int - */ - private $taskType; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['label'])) { - $this->setLabel($data['label']); - } - if (isset($data['style'])) { - $this->setStyle($data['style']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return ManualTaskAction - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns label. - * - * - * - * @return map[string,string] - */ - public function getLabel() { - return $this->label; - } - - /** - * Sets label. - * - * @param map[string,string] $label - * @return ManualTaskAction - */ - public function setLabel($label) { - if (is_array($label) && empty($label)) { - $this->label = new \stdClass; - } else { - $this->label = $label; - } - - return $this; - } - - /** - * Returns style. - * - * - * - * @return \Wallee\Sdk\Model\ManualTaskActionStyle - */ - public function getStyle() { - return $this->style; - } - - /** - * Sets style. - * - * @param \Wallee\Sdk\Model\ManualTaskActionStyle $style - * @return ManualTaskAction - */ - public function setStyle($style) { - $this->style = $style; - - return $this; - } - - /** - * Returns taskType. - * - * - * - * @return int - */ - public function getTaskType() { - return $this->taskType; - } - - /** - * Sets taskType. - * - * @param int $taskType - * @return ManualTaskAction - */ - protected function setTaskType($taskType) { - $this->taskType = $taskType; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class ManualTaskAction implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ManualTaskAction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'label' => 'map[string,string]', + 'style' => '\Wallee\Sdk\Model\ManualTaskActionStyle', + 'task_type' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'label' => null, + 'style' => null, + 'task_type' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'label' => 'label', + 'style' => 'style', + 'task_type' => 'taskType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'label' => 'setLabel', + 'style' => 'setStyle', + 'task_type' => 'setTaskType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'label' => 'getLabel', + 'style' => 'getStyle', + 'task_type' => 'getTaskType' + ]; + + + + /** + * 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['label'] = isset($data['label']) ? $data['label'] : null; + + $this->container['style'] = isset($data['style']) ? $data['style'] : null; + + $this->container['task_type'] = isset($data['task_type']) ? $data['task_type'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets label + * + * @return map[string,string] + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param map[string,string] $label + * + * @return $this + */ + public function setLabel($label) + { + $this->container['label'] = $label; + + return $this; + } + + + /** + * Gets style + * + * @return \Wallee\Sdk\Model\ManualTaskActionStyle + */ + public function getStyle() + { + return $this->container['style']; + } + + /** + * Sets style + * + * @param \Wallee\Sdk\Model\ManualTaskActionStyle $style + * + * @return $this + */ + public function setStyle($style) + { + $this->container['style'] = $style; + + return $this; + } + + + /** + * Gets task_type + * + * @return int + */ + public function getTaskType() + { + return $this->container['task_type']; + } + + /** + * Sets task_type + * + * @param int $task_type + * + * @return $this + */ + public function setTaskType($task_type) + { + $this->container['task_type'] = $task_type; + + 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/wallee-sdk/lib/Model/ManualTaskActionStyle.php b/wallee-sdk/lib/Model/ManualTaskActionStyle.php index d7f8ae3..7af0a38 100644 --- a/wallee-sdk/lib/Model/ManualTaskActionStyle.php +++ b/wallee-sdk/lib/Model/ManualTaskActionStyle.php @@ -1,10 +1,8 @@ 'map[string,string]', - 'features' => 'int[]', - 'id' => 'int', - 'name' => 'map[string,string]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * - * - * @var int[] - */ - private $features; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $name; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['features'])) { - $this->setFeatures($data['features']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - } - - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return ManualTaskType - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns features. - * - * - * - * @return int[] - */ - public function getFeatures() { - return $this->features; - } - - /** - * Sets features. - * - * @param int[] $features - * @return ManualTaskType - */ - public function setFeatures($features) { - $this->features = $features; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return ManualTaskType - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return ManualTaskType - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class ManualTaskType implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ManualTaskType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'description' => 'map[string,string]', + 'features' => 'int[]', + 'id' => 'int', + 'name' => 'map[string,string]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'features' => 'int64', + 'id' => 'int64', + 'name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'features' => 'features', + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'features' => 'setFeatures', + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'features' => 'getFeatures', + 'id' => 'getId', + 'name' => 'getName' + ]; + + + + /** + * 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['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['features'] = isset($data['features']) ? $data['features'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets features + * + * @return int[] + */ + public function getFeatures() + { + return $this->container['features']; + } + + /** + * Sets features + * + * @param int[] $features + * + * @return $this + */ + public function setFeatures($features) + { + $this->container['features'] = $features; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + 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/wallee-sdk/lib/Model/MetricUsage.php b/wallee-sdk/lib/Model/MetricUsage.php index 28cfcb3..eb76496 100644 --- a/wallee-sdk/lib/Model/MetricUsage.php +++ b/wallee-sdk/lib/Model/MetricUsage.php @@ -1,10 +1,8 @@ 'float', - 'metricDescription' => 'map[string,string]', - 'metricId' => 'int', - 'metricName' => 'map[string,string]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The consumed units provide the value of how much has been consumed of the particular metric. - * - * @var float - */ - private $consumedUnits; - - /** - * The metric description describes the metric. - * - * @var map[string,string] - */ - private $metricDescription; - - /** - * The metric ID identifies the metric for consumed units. - * - * @var int - */ - private $metricId; - - /** - * The metric name defines the name of the consumed units. - * - * @var map[string,string] - */ - private $metricName; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['metricDescription'])) { - $this->setMetricDescription($data['metricDescription']); - } - if (isset($data['metricName'])) { - $this->setMetricName($data['metricName']); - } - } - - - /** - * Returns consumedUnits. - * - * The consumed units provide the value of how much has been consumed of the particular metric. - * - * @return float - */ - public function getConsumedUnits() { - return $this->consumedUnits; - } - - /** - * Sets consumedUnits. - * - * @param float $consumedUnits - * @return MetricUsage - */ - protected function setConsumedUnits($consumedUnits) { - $this->consumedUnits = $consumedUnits; - - return $this; - } - - /** - * Returns metricDescription. - * - * The metric description describes the metric. - * - * @return map[string,string] - */ - public function getMetricDescription() { - return $this->metricDescription; - } - - /** - * Sets metricDescription. - * - * @param map[string,string] $metricDescription - * @return MetricUsage - */ - public function setMetricDescription($metricDescription) { - if (is_array($metricDescription) && empty($metricDescription)) { - $this->metricDescription = new \stdClass; - } else { - $this->metricDescription = $metricDescription; - } - - return $this; - } - - /** - * Returns metricId. - * - * The metric ID identifies the metric for consumed units. - * - * @return int - */ - public function getMetricId() { - return $this->metricId; - } - - /** - * Sets metricId. - * - * @param int $metricId - * @return MetricUsage - */ - protected function setMetricId($metricId) { - $this->metricId = $metricId; - - return $this; - } - - /** - * Returns metricName. - * - * The metric name defines the name of the consumed units. - * - * @return map[string,string] - */ - public function getMetricName() { - return $this->metricName; - } - - /** - * Sets metricName. - * - * @param map[string,string] $metricName - * @return MetricUsage - */ - public function setMetricName($metricName) { - if (is_array($metricName) && empty($metricName)) { - $this->metricName = new \stdClass; - } else { - $this->metricName = $metricName; - } - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class MetricUsage implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'MetricUsage'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'consumed_units' => 'float', + 'metric_description' => 'map[string,string]', + 'metric_id' => 'int', + 'metric_name' => 'map[string,string]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'consumed_units' => null, + 'metric_description' => null, + 'metric_id' => 'int64', + 'metric_name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'consumed_units' => 'consumedUnits', + 'metric_description' => 'metricDescription', + 'metric_id' => 'metricId', + 'metric_name' => 'metricName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'consumed_units' => 'setConsumedUnits', + 'metric_description' => 'setMetricDescription', + 'metric_id' => 'setMetricId', + 'metric_name' => 'setMetricName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'consumed_units' => 'getConsumedUnits', + 'metric_description' => 'getMetricDescription', + 'metric_id' => 'getMetricId', + 'metric_name' => 'getMetricName' + ]; + + + + /** + * 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['consumed_units'] = isset($data['consumed_units']) ? $data['consumed_units'] : null; + + $this->container['metric_description'] = isset($data['metric_description']) ? $data['metric_description'] : null; + + $this->container['metric_id'] = isset($data['metric_id']) ? $data['metric_id'] : null; + + $this->container['metric_name'] = isset($data['metric_name']) ? $data['metric_name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 consumed_units + * + * @return float + */ + public function getConsumedUnits() + { + return $this->container['consumed_units']; + } + + /** + * Sets consumed_units + * + * @param float $consumed_units The consumed units provide the value of how much has been consumed of the particular metric. + * + * @return $this + */ + public function setConsumedUnits($consumed_units) + { + $this->container['consumed_units'] = $consumed_units; + + return $this; + } + + + /** + * Gets metric_description + * + * @return map[string,string] + */ + public function getMetricDescription() + { + return $this->container['metric_description']; + } + + /** + * Sets metric_description + * + * @param map[string,string] $metric_description The metric description describes the metric. + * + * @return $this + */ + public function setMetricDescription($metric_description) + { + $this->container['metric_description'] = $metric_description; + + return $this; + } + + + /** + * Gets metric_id + * + * @return int + */ + public function getMetricId() + { + return $this->container['metric_id']; + } + + /** + * Sets metric_id + * + * @param int $metric_id The metric ID identifies the metric for consumed units. + * + * @return $this + */ + public function setMetricId($metric_id) + { + $this->container['metric_id'] = $metric_id; + + return $this; + } + + + /** + * Gets metric_name + * + * @return map[string,string] + */ + public function getMetricName() + { + return $this->container['metric_name']; + } + + /** + * Sets metric_name + * + * @param map[string,string] $metric_name The metric name defines the name of the consumed units. + * + * @return $this + */ + public function setMetricName($metric_name) + { + $this->container['metric_name'] = $metric_name; + + 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/wallee-sdk/lib/Model/ModelInterface.php b/wallee-sdk/lib/Model/ModelInterface.php new file mode 100644 index 0000000..8d07b7d --- /dev/null +++ b/wallee-sdk/lib/Model/ModelInterface.php @@ -0,0 +1,103 @@ + 'int', - 'linkedSpaceId' => 'int', - 'path' => 'string', - 'plannedPurgeDate' => '\DateTime', - 'spaceId' => 'int', - 'state' => '\Wallee\Sdk\Model\ResourceState', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * - * - * @var string - */ - private $path; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var int - */ - private $spaceId; - - /** - * - * - * @var \Wallee\Sdk\Model\ResourceState - */ - private $state; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return ModelResourcePath - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return ModelResourcePath - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns path. - * - * - * - * @return string - */ - public function getPath() { - return $this->path; - } - - /** - * Sets path. - * - * @param string $path - * @return ModelResourcePath - */ - protected function setPath($path) { - $this->path = $path; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return ModelResourcePath - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns spaceId. - * - * - * - * @return int - */ - public function getSpaceId() { - return $this->spaceId; - } - - /** - * Sets spaceId. - * - * @param int $spaceId - * @return ModelResourcePath - */ - protected function setSpaceId($spaceId) { - $this->spaceId = $spaceId; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\ResourceState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\ResourceState $state - * @return ModelResourcePath - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return ModelResourcePath - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class ModelResourcePath implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ResourcePath'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'linked_space_id' => 'int', + 'path' => 'string', + 'planned_purge_date' => '\DateTime', + 'space_id' => 'int', + 'state' => '\Wallee\Sdk\Model\ResourceState', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'path' => null, + 'planned_purge_date' => 'date-time', + 'space_id' => 'int64', + 'state' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'path' => 'path', + 'planned_purge_date' => 'plannedPurgeDate', + 'space_id' => 'spaceId', + 'state' => 'state', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'path' => 'setPath', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'space_id' => 'setSpaceId', + 'state' => 'setState', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'path' => 'getPath', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'space_id' => 'getSpaceId', + 'state' => 'getState', + 'version' => 'getVersion' + ]; + + + + /** + * 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['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['path'] = isset($data['path']) ? $data['path'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['space_id'] = isset($data['space_id']) ? $data['space_id'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets path + * + * @return string + */ + public function getPath() + { + return $this->container['path']; + } + + /** + * Sets path + * + * @param string $path + * + * @return $this + */ + public function setPath($path) + { + $this->container['path'] = $path; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets space_id + * + * @return int + */ + public function getSpaceId() + { + return $this->container['space_id']; + } + + /** + * Sets space_id + * + * @param int $space_id + * + * @return $this + */ + public function setSpaceId($space_id) + { + $this->container['space_id'] = $space_id; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\ResourceState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\ResourceState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/OneClickPaymentMode.php b/wallee-sdk/lib/Model/OneClickPaymentMode.php index 11b13c7..e52cd82 100644 --- a/wallee-sdk/lib/Model/OneClickPaymentMode.php +++ b/wallee-sdk/lib/Model/OneClickPaymentMode.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\DataCollectionType', - 'deprecated' => 'bool', - 'deprecationReason' => 'map[string,string]', - 'description' => 'map[string,string]', - 'feature' => '\Wallee\Sdk\Model\Feature', - 'id' => 'int', - 'name' => 'map[string,string]', - 'paymentMethod' => 'int', - 'paymentMethodBrand' => '\Wallee\Sdk\Model\PaymentMethodBrand', - 'primaryRiskTaker' => '\Wallee\Sdk\Model\PaymentPrimaryRiskTaker', - 'processor' => 'int', - 'supportedCustomersPresences' => '\Wallee\Sdk\Model\CustomersPresence[]', - 'supportedFeatures' => 'int[]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\DataCollectionType - */ - private $dataCollectionType; - - /** - * - * - * @var bool - */ - private $deprecated; - - /** - * - * - * @var map[string,string] - */ - private $deprecationReason; - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * - * - * @var \Wallee\Sdk\Model\Feature - */ - private $feature; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $name; - - /** - * - * - * @var int - */ - private $paymentMethod; - - /** - * - * - * @var \Wallee\Sdk\Model\PaymentMethodBrand - */ - private $paymentMethodBrand; - - /** - * - * - * @var \Wallee\Sdk\Model\PaymentPrimaryRiskTaker - */ - private $primaryRiskTaker; - - /** - * - * - * @var int - */ - private $processor; - - /** - * - * - * @var \Wallee\Sdk\Model\CustomersPresence[] - */ - private $supportedCustomersPresences; - - /** - * - * - * @var int[] - */ - private $supportedFeatures; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['dataCollectionType'])) { - $this->setDataCollectionType($data['dataCollectionType']); - } - if (isset($data['deprecationReason'])) { - $this->setDeprecationReason($data['deprecationReason']); - } - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['feature'])) { - $this->setFeature($data['feature']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['paymentMethodBrand'])) { - $this->setPaymentMethodBrand($data['paymentMethodBrand']); - } - if (isset($data['primaryRiskTaker'])) { - $this->setPrimaryRiskTaker($data['primaryRiskTaker']); - } - if (isset($data['supportedCustomersPresences'])) { - $this->setSupportedCustomersPresences($data['supportedCustomersPresences']); - } - if (isset($data['supportedFeatures'])) { - $this->setSupportedFeatures($data['supportedFeatures']); - } - } - - - /** - * Returns dataCollectionType. - * - * - * - * @return \Wallee\Sdk\Model\DataCollectionType - */ - public function getDataCollectionType() { - return $this->dataCollectionType; - } - - /** - * Sets dataCollectionType. - * - * @param \Wallee\Sdk\Model\DataCollectionType $dataCollectionType - * @return PaymentConnector - */ - public function setDataCollectionType($dataCollectionType) { - $this->dataCollectionType = $dataCollectionType; - - return $this; - } - - /** - * Returns deprecated. - * - * - * - * @return bool - */ - public function getDeprecated() { - return $this->deprecated; - } - - /** - * Sets deprecated. - * - * @param bool $deprecated - * @return PaymentConnector - */ - protected function setDeprecated($deprecated) { - $this->deprecated = $deprecated; - - return $this; - } - - /** - * Returns deprecationReason. - * - * - * - * @return map[string,string] - */ - public function getDeprecationReason() { - return $this->deprecationReason; - } - - /** - * Sets deprecationReason. - * - * @param map[string,string] $deprecationReason - * @return PaymentConnector - */ - public function setDeprecationReason($deprecationReason) { - if (is_array($deprecationReason) && empty($deprecationReason)) { - $this->deprecationReason = new \stdClass; - } else { - $this->deprecationReason = $deprecationReason; - } - - return $this; - } - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return PaymentConnector - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns feature. - * - * - * - * @return \Wallee\Sdk\Model\Feature - */ - public function getFeature() { - return $this->feature; - } - - /** - * Sets feature. - * - * @param \Wallee\Sdk\Model\Feature $feature - * @return PaymentConnector - */ - public function setFeature($feature) { - $this->feature = $feature; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return PaymentConnector - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return PaymentConnector - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Returns paymentMethod. - * - * - * - * @return int - */ - public function getPaymentMethod() { - return $this->paymentMethod; - } - - /** - * Sets paymentMethod. - * - * @param int $paymentMethod - * @return PaymentConnector - */ - protected function setPaymentMethod($paymentMethod) { - $this->paymentMethod = $paymentMethod; - - return $this; - } - - /** - * Returns paymentMethodBrand. - * - * - * - * @return \Wallee\Sdk\Model\PaymentMethodBrand - */ - public function getPaymentMethodBrand() { - return $this->paymentMethodBrand; - } - - /** - * Sets paymentMethodBrand. - * - * @param \Wallee\Sdk\Model\PaymentMethodBrand $paymentMethodBrand - * @return PaymentConnector - */ - public function setPaymentMethodBrand($paymentMethodBrand) { - $this->paymentMethodBrand = $paymentMethodBrand; - - return $this; - } - - /** - * Returns primaryRiskTaker. - * - * - * - * @return \Wallee\Sdk\Model\PaymentPrimaryRiskTaker - */ - public function getPrimaryRiskTaker() { - return $this->primaryRiskTaker; - } - - /** - * Sets primaryRiskTaker. - * - * @param \Wallee\Sdk\Model\PaymentPrimaryRiskTaker $primaryRiskTaker - * @return PaymentConnector - */ - public function setPrimaryRiskTaker($primaryRiskTaker) { - $this->primaryRiskTaker = $primaryRiskTaker; - - return $this; - } - - /** - * Returns processor. - * - * - * - * @return int - */ - public function getProcessor() { - return $this->processor; - } - - /** - * Sets processor. - * - * @param int $processor - * @return PaymentConnector - */ - protected function setProcessor($processor) { - $this->processor = $processor; - - return $this; - } - - /** - * Returns supportedCustomersPresences. - * - * - * - * @return \Wallee\Sdk\Model\CustomersPresence[] - */ - public function getSupportedCustomersPresences() { - return $this->supportedCustomersPresences; - } - - /** - * Sets supportedCustomersPresences. - * - * @param \Wallee\Sdk\Model\CustomersPresence[] $supportedCustomersPresences - * @return PaymentConnector - */ - public function setSupportedCustomersPresences($supportedCustomersPresences) { - $this->supportedCustomersPresences = $supportedCustomersPresences; - - return $this; - } - - /** - * Returns supportedFeatures. - * - * - * - * @return int[] - */ - public function getSupportedFeatures() { - return $this->supportedFeatures; - } - - /** - * Sets supportedFeatures. - * - * @param int[] $supportedFeatures - * @return PaymentConnector - */ - public function setSupportedFeatures($supportedFeatures) { - $this->supportedFeatures = $supportedFeatures; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class PaymentConnector implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'PaymentConnector'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'data_collection_type' => '\Wallee\Sdk\Model\DataCollectionType', + 'deprecated' => 'bool', + 'deprecation_reason' => 'map[string,string]', + 'description' => 'map[string,string]', + 'feature' => '\Wallee\Sdk\Model\Feature', + 'id' => 'int', + 'name' => 'map[string,string]', + 'payment_method' => 'int', + 'payment_method_brand' => '\Wallee\Sdk\Model\PaymentMethodBrand', + 'primary_risk_taker' => '\Wallee\Sdk\Model\PaymentPrimaryRiskTaker', + 'processor' => 'int', + 'supported_customers_presences' => '\Wallee\Sdk\Model\CustomersPresence[]', + 'supported_features' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'data_collection_type' => null, + 'deprecated' => null, + 'deprecation_reason' => null, + 'description' => null, + 'feature' => null, + 'id' => 'int64', + 'name' => null, + 'payment_method' => 'int64', + 'payment_method_brand' => null, + 'primary_risk_taker' => null, + 'processor' => 'int64', + 'supported_customers_presences' => null, + 'supported_features' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data_collection_type' => 'dataCollectionType', + 'deprecated' => 'deprecated', + 'deprecation_reason' => 'deprecationReason', + 'description' => 'description', + 'feature' => 'feature', + 'id' => 'id', + 'name' => 'name', + 'payment_method' => 'paymentMethod', + 'payment_method_brand' => 'paymentMethodBrand', + 'primary_risk_taker' => 'primaryRiskTaker', + 'processor' => 'processor', + 'supported_customers_presences' => 'supportedCustomersPresences', + 'supported_features' => 'supportedFeatures' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data_collection_type' => 'setDataCollectionType', + 'deprecated' => 'setDeprecated', + 'deprecation_reason' => 'setDeprecationReason', + 'description' => 'setDescription', + 'feature' => 'setFeature', + 'id' => 'setId', + 'name' => 'setName', + 'payment_method' => 'setPaymentMethod', + 'payment_method_brand' => 'setPaymentMethodBrand', + 'primary_risk_taker' => 'setPrimaryRiskTaker', + 'processor' => 'setProcessor', + 'supported_customers_presences' => 'setSupportedCustomersPresences', + 'supported_features' => 'setSupportedFeatures' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data_collection_type' => 'getDataCollectionType', + 'deprecated' => 'getDeprecated', + 'deprecation_reason' => 'getDeprecationReason', + 'description' => 'getDescription', + 'feature' => 'getFeature', + 'id' => 'getId', + 'name' => 'getName', + 'payment_method' => 'getPaymentMethod', + 'payment_method_brand' => 'getPaymentMethodBrand', + 'primary_risk_taker' => 'getPrimaryRiskTaker', + 'processor' => 'getProcessor', + 'supported_customers_presences' => 'getSupportedCustomersPresences', + 'supported_features' => 'getSupportedFeatures' + ]; + + + + /** + * 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['data_collection_type'] = isset($data['data_collection_type']) ? $data['data_collection_type'] : null; + + $this->container['deprecated'] = isset($data['deprecated']) ? $data['deprecated'] : null; + + $this->container['deprecation_reason'] = isset($data['deprecation_reason']) ? $data['deprecation_reason'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['feature'] = isset($data['feature']) ? $data['feature'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['payment_method'] = isset($data['payment_method']) ? $data['payment_method'] : null; + + $this->container['payment_method_brand'] = isset($data['payment_method_brand']) ? $data['payment_method_brand'] : null; + + $this->container['primary_risk_taker'] = isset($data['primary_risk_taker']) ? $data['primary_risk_taker'] : null; + + $this->container['processor'] = isset($data['processor']) ? $data['processor'] : null; + + $this->container['supported_customers_presences'] = isset($data['supported_customers_presences']) ? $data['supported_customers_presences'] : null; + + $this->container['supported_features'] = isset($data['supported_features']) ? $data['supported_features'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 data_collection_type + * + * @return \Wallee\Sdk\Model\DataCollectionType + */ + public function getDataCollectionType() + { + return $this->container['data_collection_type']; + } + + /** + * Sets data_collection_type + * + * @param \Wallee\Sdk\Model\DataCollectionType $data_collection_type + * + * @return $this + */ + public function setDataCollectionType($data_collection_type) + { + $this->container['data_collection_type'] = $data_collection_type; + + return $this; + } + + + /** + * Gets deprecated + * + * @return bool + */ + public function getDeprecated() + { + return $this->container['deprecated']; + } + + /** + * Sets deprecated + * + * @param bool $deprecated + * + * @return $this + */ + public function setDeprecated($deprecated) + { + $this->container['deprecated'] = $deprecated; + + return $this; + } + + + /** + * Gets deprecation_reason + * + * @return map[string,string] + */ + public function getDeprecationReason() + { + return $this->container['deprecation_reason']; + } + + /** + * Sets deprecation_reason + * + * @param map[string,string] $deprecation_reason + * + * @return $this + */ + public function setDeprecationReason($deprecation_reason) + { + $this->container['deprecation_reason'] = $deprecation_reason; + + return $this; + } + + + /** + * Gets description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets feature + * + * @return \Wallee\Sdk\Model\Feature + */ + public function getFeature() + { + return $this->container['feature']; + } + + /** + * Sets feature + * + * @param \Wallee\Sdk\Model\Feature $feature + * + * @return $this + */ + public function setFeature($feature) + { + $this->container['feature'] = $feature; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets payment_method + * + * @return int + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param int $payment_method + * + * @return $this + */ + public function setPaymentMethod($payment_method) + { + $this->container['payment_method'] = $payment_method; + + return $this; + } + + + /** + * Gets payment_method_brand + * + * @return \Wallee\Sdk\Model\PaymentMethodBrand + */ + public function getPaymentMethodBrand() + { + return $this->container['payment_method_brand']; + } + + /** + * Sets payment_method_brand + * + * @param \Wallee\Sdk\Model\PaymentMethodBrand $payment_method_brand + * + * @return $this + */ + public function setPaymentMethodBrand($payment_method_brand) + { + $this->container['payment_method_brand'] = $payment_method_brand; + + return $this; + } + + + /** + * Gets primary_risk_taker + * + * @return \Wallee\Sdk\Model\PaymentPrimaryRiskTaker + */ + public function getPrimaryRiskTaker() + { + return $this->container['primary_risk_taker']; + } + + /** + * Sets primary_risk_taker + * + * @param \Wallee\Sdk\Model\PaymentPrimaryRiskTaker $primary_risk_taker + * + * @return $this + */ + public function setPrimaryRiskTaker($primary_risk_taker) + { + $this->container['primary_risk_taker'] = $primary_risk_taker; + + return $this; + } + + + /** + * Gets processor + * + * @return int + */ + public function getProcessor() + { + return $this->container['processor']; + } + + /** + * Sets processor + * + * @param int $processor + * + * @return $this + */ + public function setProcessor($processor) + { + $this->container['processor'] = $processor; + + return $this; + } + + + /** + * Gets supported_customers_presences + * + * @return \Wallee\Sdk\Model\CustomersPresence[] + */ + public function getSupportedCustomersPresences() + { + return $this->container['supported_customers_presences']; + } + + /** + * Sets supported_customers_presences + * + * @param \Wallee\Sdk\Model\CustomersPresence[] $supported_customers_presences + * + * @return $this + */ + public function setSupportedCustomersPresences($supported_customers_presences) + { + $this->container['supported_customers_presences'] = $supported_customers_presences; + + return $this; + } + + + /** + * Gets supported_features + * + * @return int[] + */ + public function getSupportedFeatures() + { + return $this->container['supported_features']; + } + + /** + * Sets supported_features + * + * @param int[] $supported_features + * + * @return $this + */ + public function setSupportedFeatures($supported_features) + { + $this->container['supported_features'] = $supported_features; + + 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/wallee-sdk/lib/Model/PaymentConnectorConfiguration.php b/wallee-sdk/lib/Model/PaymentConnectorConfiguration.php index 1f994dd..56e5d7b 100644 --- a/wallee-sdk/lib/Model/PaymentConnectorConfiguration.php +++ b/wallee-sdk/lib/Model/PaymentConnectorConfiguration.php @@ -1,10 +1,8 @@ 'bool', - 'conditions' => 'int[]', - 'connector' => 'int', - 'enabledSpaceViews' => 'int[]', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'name' => 'string', - 'paymentMethodConfiguration' => '\Wallee\Sdk\Model\PaymentMethodConfiguration', - 'plannedPurgeDate' => '\DateTime', - 'priority' => 'int', - 'processorConfiguration' => '\Wallee\Sdk\Model\PaymentProcessorConfiguration', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * This property indicates if the connector is currently used for processing transactions. In case either the payment method configuration or the processor configuration is not active the connector will not be used even though the connector state is active. - * - * @var bool - */ - private $applicableForTransactionProcessing; - - /** - * If a transaction meet all selected conditions the connector configuration will be used to process the transaction otherwise the next connector configuration in line will be chosen according to the priorities. - * - * @var int[] - */ - private $conditions; - - /** - * - * - * @var int - */ - private $connector; - - /** - * The connector configuration is only enabled for the selected space views. In case the set is empty the connector configuration is enabled for all space views. - * - * @var int[] - */ - private $enabledSpaceViews; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The connector configuration name is used internally to identify the configuration in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * - * - * @var \Wallee\Sdk\Model\PaymentMethodConfiguration - */ - private $paymentMethodConfiguration; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * The priority will define the order of choice of the connector configurations. The lower the value, the higher the priority is going to be. This value can also be a negative number in case you are adding a new configuration that you want to have a high priority and you dont want to change the priority of all the other configurations. - * - * @var int - */ - private $priority; - - /** - * - * - * @var \Wallee\Sdk\Model\PaymentProcessorConfiguration - */ - private $processorConfiguration; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['conditions'])) { - $this->setConditions($data['conditions']); - } - if (isset($data['enabledSpaceViews'])) { - $this->setEnabledSpaceViews($data['enabledSpaceViews']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['paymentMethodConfiguration'])) { - $this->setPaymentMethodConfiguration($data['paymentMethodConfiguration']); - } - if (isset($data['processorConfiguration'])) { - $this->setProcessorConfiguration($data['processorConfiguration']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns applicableForTransactionProcessing. - * - * This property indicates if the connector is currently used for processing transactions. In case either the payment method configuration or the processor configuration is not active the connector will not be used even though the connector state is active. - * - * @return bool - */ - public function getApplicableForTransactionProcessing() { - return $this->applicableForTransactionProcessing; - } - - /** - * Sets applicableForTransactionProcessing. - * - * @param bool $applicableForTransactionProcessing - * @return PaymentConnectorConfiguration - */ - protected function setApplicableForTransactionProcessing($applicableForTransactionProcessing) { - $this->applicableForTransactionProcessing = $applicableForTransactionProcessing; - - return $this; - } - - /** - * Returns conditions. - * - * If a transaction meet all selected conditions the connector configuration will be used to process the transaction otherwise the next connector configuration in line will be chosen according to the priorities. - * - * @return int[] - */ - public function getConditions() { - return $this->conditions; - } - - /** - * Sets conditions. - * - * @param int[] $conditions - * @return PaymentConnectorConfiguration - */ - public function setConditions($conditions) { - $this->conditions = $conditions; - - return $this; - } - - /** - * Returns connector. - * - * - * - * @return int - */ - public function getConnector() { - return $this->connector; - } - - /** - * Sets connector. - * - * @param int $connector - * @return PaymentConnectorConfiguration - */ - protected function setConnector($connector) { - $this->connector = $connector; - - return $this; - } - - /** - * Returns enabledSpaceViews. - * - * The connector configuration is only enabled for the selected space views. In case the set is empty the connector configuration is enabled for all space views. - * - * @return int[] - */ - public function getEnabledSpaceViews() { - return $this->enabledSpaceViews; - } - - /** - * Sets enabledSpaceViews. - * - * @param int[] $enabledSpaceViews - * @return PaymentConnectorConfiguration - */ - public function setEnabledSpaceViews($enabledSpaceViews) { - $this->enabledSpaceViews = $enabledSpaceViews; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return PaymentConnectorConfiguration - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return PaymentConnectorConfiguration - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * The connector configuration name is used internally to identify the configuration in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return PaymentConnectorConfiguration - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns paymentMethodConfiguration. - * - * - * - * @return \Wallee\Sdk\Model\PaymentMethodConfiguration - */ - public function getPaymentMethodConfiguration() { - return $this->paymentMethodConfiguration; - } - - /** - * Sets paymentMethodConfiguration. - * - * @param \Wallee\Sdk\Model\PaymentMethodConfiguration $paymentMethodConfiguration - * @return PaymentConnectorConfiguration - */ - public function setPaymentMethodConfiguration($paymentMethodConfiguration) { - $this->paymentMethodConfiguration = $paymentMethodConfiguration; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return PaymentConnectorConfiguration - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns priority. - * - * The priority will define the order of choice of the connector configurations. The lower the value, the higher the priority is going to be. This value can also be a negative number in case you are adding a new configuration that you want to have a high priority and you dont want to change the priority of all the other configurations. - * - * @return int - */ - public function getPriority() { - return $this->priority; - } - - /** - * Sets priority. - * - * @param int $priority - * @return PaymentConnectorConfiguration - */ - protected function setPriority($priority) { - $this->priority = $priority; - - return $this; - } - - /** - * Returns processorConfiguration. - * - * - * - * @return \Wallee\Sdk\Model\PaymentProcessorConfiguration - */ - public function getProcessorConfiguration() { - return $this->processorConfiguration; - } - - /** - * Sets processorConfiguration. - * - * @param \Wallee\Sdk\Model\PaymentProcessorConfiguration $processorConfiguration - * @return PaymentConnectorConfiguration - */ - public function setProcessorConfiguration($processorConfiguration) { - $this->processorConfiguration = $processorConfiguration; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return PaymentConnectorConfiguration - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return PaymentConnectorConfiguration - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class PaymentConnectorConfiguration implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'PaymentConnectorConfiguration'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'applicable_for_transaction_processing' => 'bool', + 'conditions' => 'int[]', + 'connector' => 'int', + 'enabled_space_views' => 'int[]', + 'id' => 'int', + 'linked_space_id' => 'int', + 'name' => 'string', + 'payment_method_configuration' => '\Wallee\Sdk\Model\PaymentMethodConfiguration', + 'planned_purge_date' => '\DateTime', + 'priority' => 'int', + 'processor_configuration' => '\Wallee\Sdk\Model\PaymentProcessorConfiguration', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'applicable_for_transaction_processing' => null, + 'conditions' => 'int64', + 'connector' => 'int64', + 'enabled_space_views' => 'int64', + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'name' => null, + 'payment_method_configuration' => null, + 'planned_purge_date' => 'date-time', + 'priority' => 'int32', + 'processor_configuration' => null, + 'state' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'applicable_for_transaction_processing' => 'applicableForTransactionProcessing', + 'conditions' => 'conditions', + 'connector' => 'connector', + 'enabled_space_views' => 'enabledSpaceViews', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'payment_method_configuration' => 'paymentMethodConfiguration', + 'planned_purge_date' => 'plannedPurgeDate', + 'priority' => 'priority', + 'processor_configuration' => 'processorConfiguration', + 'state' => 'state', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'applicable_for_transaction_processing' => 'setApplicableForTransactionProcessing', + 'conditions' => 'setConditions', + 'connector' => 'setConnector', + 'enabled_space_views' => 'setEnabledSpaceViews', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'payment_method_configuration' => 'setPaymentMethodConfiguration', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'priority' => 'setPriority', + 'processor_configuration' => 'setProcessorConfiguration', + 'state' => 'setState', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'applicable_for_transaction_processing' => 'getApplicableForTransactionProcessing', + 'conditions' => 'getConditions', + 'connector' => 'getConnector', + 'enabled_space_views' => 'getEnabledSpaceViews', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'payment_method_configuration' => 'getPaymentMethodConfiguration', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'priority' => 'getPriority', + 'processor_configuration' => 'getProcessorConfiguration', + 'state' => 'getState', + 'version' => 'getVersion' + ]; + + + + /** + * 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['applicable_for_transaction_processing'] = isset($data['applicable_for_transaction_processing']) ? $data['applicable_for_transaction_processing'] : null; + + $this->container['conditions'] = isset($data['conditions']) ? $data['conditions'] : null; + + $this->container['connector'] = isset($data['connector']) ? $data['connector'] : null; + + $this->container['enabled_space_views'] = isset($data['enabled_space_views']) ? $data['enabled_space_views'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['payment_method_configuration'] = isset($data['payment_method_configuration']) ? $data['payment_method_configuration'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['priority'] = isset($data['priority']) ? $data['priority'] : null; + + $this->container['processor_configuration'] = isset($data['processor_configuration']) ? $data['processor_configuration'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 applicable_for_transaction_processing + * + * @return bool + */ + public function getApplicableForTransactionProcessing() + { + return $this->container['applicable_for_transaction_processing']; + } + + /** + * Sets applicable_for_transaction_processing + * + * @param bool $applicable_for_transaction_processing This property indicates if the connector is currently used for processing transactions. In case either the payment method configuration or the processor configuration is not active the connector will not be used even though the connector state is active. + * + * @return $this + */ + public function setApplicableForTransactionProcessing($applicable_for_transaction_processing) + { + $this->container['applicable_for_transaction_processing'] = $applicable_for_transaction_processing; + + return $this; + } + + + /** + * Gets conditions + * + * @return int[] + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param int[] $conditions If a transaction meet all selected conditions the connector configuration will be used to process the transaction otherwise the next connector configuration in line will be chosen according to the priorities. + * + * @return $this + */ + public function setConditions($conditions) + { + $this->container['conditions'] = $conditions; + + return $this; + } + + + /** + * Gets connector + * + * @return int + */ + public function getConnector() + { + return $this->container['connector']; + } + + /** + * Sets connector + * + * @param int $connector + * + * @return $this + */ + public function setConnector($connector) + { + $this->container['connector'] = $connector; + + return $this; + } + + + /** + * Gets enabled_space_views + * + * @return int[] + */ + public function getEnabledSpaceViews() + { + return $this->container['enabled_space_views']; + } + + /** + * Sets enabled_space_views + * + * @param int[] $enabled_space_views The connector configuration is only enabled for the selected space views. In case the set is empty the connector configuration is enabled for all space views. + * + * @return $this + */ + public function setEnabledSpaceViews($enabled_space_views) + { + $this->container['enabled_space_views'] = $enabled_space_views; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The connector configuration name is used internally to identify the configuration in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets payment_method_configuration + * + * @return \Wallee\Sdk\Model\PaymentMethodConfiguration + */ + public function getPaymentMethodConfiguration() + { + return $this->container['payment_method_configuration']; + } + + /** + * Sets payment_method_configuration + * + * @param \Wallee\Sdk\Model\PaymentMethodConfiguration $payment_method_configuration + * + * @return $this + */ + public function setPaymentMethodConfiguration($payment_method_configuration) + { + $this->container['payment_method_configuration'] = $payment_method_configuration; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets priority + * + * @return int + */ + public function getPriority() + { + return $this->container['priority']; + } + + /** + * Sets priority + * + * @param int $priority The priority will define the order of choice of the connector configurations. The lower the value, the higher the priority is going to be. This value can also be a negative number in case you are adding a new configuration that you want to have a high priority and you dont want to change the priority of all the other configurations. + * + * @return $this + */ + public function setPriority($priority) + { + $this->container['priority'] = $priority; + + return $this; + } + + + /** + * Gets processor_configuration + * + * @return \Wallee\Sdk\Model\PaymentProcessorConfiguration + */ + public function getProcessorConfiguration() + { + return $this->container['processor_configuration']; + } + + /** + * Sets processor_configuration + * + * @param \Wallee\Sdk\Model\PaymentProcessorConfiguration $processor_configuration + * + * @return $this + */ + public function setProcessorConfiguration($processor_configuration) + { + $this->container['processor_configuration'] = $processor_configuration; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/PaymentConnectorFeature.php b/wallee-sdk/lib/Model/PaymentConnectorFeature.php index bc09dd3..c171fd2 100644 --- a/wallee-sdk/lib/Model/PaymentConnectorFeature.php +++ b/wallee-sdk/lib/Model/PaymentConnectorFeature.php @@ -1,10 +1,8 @@ 'string', - 'feature' => '\Wallee\Sdk\Model\Feature', - 'id' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var string - */ - private $displayName; - - /** - * - * - * @var \Wallee\Sdk\Model\Feature - */ - private $feature; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['feature'])) { - $this->setFeature($data['feature']); - } - } - - - /** - * Returns displayName. - * - * - * - * @return string - */ - public function getDisplayName() { - return $this->displayName; - } - - /** - * Sets displayName. - * - * @param string $displayName - * @return PaymentConnectorFeature - */ - protected function setDisplayName($displayName) { - $this->displayName = $displayName; - - return $this; - } - - /** - * Returns feature. - * - * - * - * @return \Wallee\Sdk\Model\Feature - */ - public function getFeature() { - return $this->feature; - } - - /** - * Sets feature. - * - * @param \Wallee\Sdk\Model\Feature $feature - * @return PaymentConnectorFeature - */ - public function setFeature($feature) { - $this->feature = $feature; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return PaymentConnectorFeature - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class PaymentConnectorFeature implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'PaymentConnectorFeature'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'display_name' => 'string', + 'feature' => '\Wallee\Sdk\Model\Feature', + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'display_name' => null, + 'feature' => null, + 'id' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'display_name' => 'displayName', + 'feature' => 'feature', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'display_name' => 'setDisplayName', + 'feature' => 'setFeature', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'display_name' => 'getDisplayName', + 'feature' => 'getFeature', + 'id' => 'getId' + ]; + + + + /** + * 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['display_name'] = isset($data['display_name']) ? $data['display_name'] : null; + + $this->container['feature'] = isset($data['feature']) ? $data['feature'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 display_name + * + * @return string + */ + public function getDisplayName() + { + return $this->container['display_name']; + } + + /** + * Sets display_name + * + * @param string $display_name + * + * @return $this + */ + public function setDisplayName($display_name) + { + $this->container['display_name'] = $display_name; + + return $this; + } + + + /** + * Gets feature + * + * @return \Wallee\Sdk\Model\Feature + */ + public function getFeature() + { + return $this->container['feature']; + } + + /** + * Sets feature + * + * @param \Wallee\Sdk\Model\Feature $feature + * + * @return $this + */ + public function setFeature($feature) + { + $this->container['feature'] = $feature; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + 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/wallee-sdk/lib/Model/PaymentContract.php b/wallee-sdk/lib/Model/PaymentContract.php index bb46294..343b1cd 100644 --- a/wallee-sdk/lib/Model/PaymentContract.php +++ b/wallee-sdk/lib/Model/PaymentContract.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\Account', - 'activatedOn' => '\DateTime', - 'contractIdentifier' => 'string', - 'contractType' => '\Wallee\Sdk\Model\PaymentContractType', - 'createdBy' => '\Wallee\Sdk\Model\User', - 'createdOn' => '\DateTime', - 'externalId' => 'string', - 'id' => 'int', - 'rejectedOn' => '\DateTime', - 'rejectionReason' => '\Wallee\Sdk\Model\FailureReason', - 'startTerminatingOn' => '\DateTime', - 'state' => '\Wallee\Sdk\Model\PaymentContractState', - 'terminatedBy' => '\Wallee\Sdk\Model\User', - 'terminatedOn' => '\DateTime', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\Account - */ - private $account; - - /** - * - * - * @var \DateTime - */ - private $activatedOn; - - /** - * - * - * @var string - */ - private $contractIdentifier; - - /** - * - * - * @var \Wallee\Sdk\Model\PaymentContractType - */ - private $contractType; - - /** - * - * - * @var \Wallee\Sdk\Model\User - */ - private $createdBy; - - /** - * The created on date indicates the date on which the entity was stored into the database. - * - * @var \DateTime - */ - private $createdOn; - - /** - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @var string - */ - private $externalId; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var \DateTime - */ - private $rejectedOn; - - /** - * - * - * @var \Wallee\Sdk\Model\FailureReason - */ - private $rejectionReason; - - /** - * - * - * @var \DateTime - */ - private $startTerminatingOn; - - /** - * - * - * @var \Wallee\Sdk\Model\PaymentContractState - */ - private $state; - - /** - * - * - * @var \Wallee\Sdk\Model\User - */ - private $terminatedBy; - - /** - * - * - * @var \DateTime - */ - private $terminatedOn; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['account'])) { - $this->setAccount($data['account']); - } - if (isset($data['contractType'])) { - $this->setContractType($data['contractType']); - } - if (isset($data['createdBy'])) { - $this->setCreatedBy($data['createdBy']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['rejectionReason'])) { - $this->setRejectionReason($data['rejectionReason']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['terminatedBy'])) { - $this->setTerminatedBy($data['terminatedBy']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns account. - * - * - * - * @return \Wallee\Sdk\Model\Account - */ - public function getAccount() { - return $this->account; - } - - /** - * Sets account. - * - * @param \Wallee\Sdk\Model\Account $account - * @return PaymentContract - */ - public function setAccount($account) { - $this->account = $account; - - return $this; - } - - /** - * Returns activatedOn. - * - * - * - * @return \DateTime - */ - public function getActivatedOn() { - return $this->activatedOn; - } - - /** - * Sets activatedOn. - * - * @param \DateTime $activatedOn - * @return PaymentContract - */ - protected function setActivatedOn($activatedOn) { - $this->activatedOn = $activatedOn; - - return $this; - } - - /** - * Returns contractIdentifier. - * - * - * - * @return string - */ - public function getContractIdentifier() { - return $this->contractIdentifier; - } - - /** - * Sets contractIdentifier. - * - * @param string $contractIdentifier - * @return PaymentContract - */ - protected function setContractIdentifier($contractIdentifier) { - $this->contractIdentifier = $contractIdentifier; - - return $this; - } - - /** - * Returns contractType. - * - * - * - * @return \Wallee\Sdk\Model\PaymentContractType - */ - public function getContractType() { - return $this->contractType; - } - - /** - * Sets contractType. - * - * @param \Wallee\Sdk\Model\PaymentContractType $contractType - * @return PaymentContract - */ - public function setContractType($contractType) { - $this->contractType = $contractType; - - return $this; - } - - /** - * Returns createdBy. - * - * - * - * @return \Wallee\Sdk\Model\User - */ - public function getCreatedBy() { - return $this->createdBy; - } - - /** - * Sets createdBy. - * - * @param \Wallee\Sdk\Model\User $createdBy - * @return PaymentContract - */ - public function setCreatedBy($createdBy) { - $this->createdBy = $createdBy; - - return $this; - } - - /** - * Returns createdOn. - * - * The created on date indicates the date on which the entity was stored into the database. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return PaymentContract - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns externalId. - * - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @return string - */ - public function getExternalId() { - return $this->externalId; - } - - /** - * Sets externalId. - * - * @param string $externalId - * @return PaymentContract - */ - protected function setExternalId($externalId) { - $this->externalId = $externalId; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return PaymentContract - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns rejectedOn. - * - * - * - * @return \DateTime - */ - public function getRejectedOn() { - return $this->rejectedOn; - } - - /** - * Sets rejectedOn. - * - * @param \DateTime $rejectedOn - * @return PaymentContract - */ - protected function setRejectedOn($rejectedOn) { - $this->rejectedOn = $rejectedOn; - - return $this; - } - - /** - * Returns rejectionReason. - * - * - * - * @return \Wallee\Sdk\Model\FailureReason - */ - public function getRejectionReason() { - return $this->rejectionReason; - } - - /** - * Sets rejectionReason. - * - * @param \Wallee\Sdk\Model\FailureReason $rejectionReason - * @return PaymentContract - */ - public function setRejectionReason($rejectionReason) { - $this->rejectionReason = $rejectionReason; - - return $this; - } - - /** - * Returns startTerminatingOn. - * - * - * - * @return \DateTime - */ - public function getStartTerminatingOn() { - return $this->startTerminatingOn; - } - - /** - * Sets startTerminatingOn. - * - * @param \DateTime $startTerminatingOn - * @return PaymentContract - */ - protected function setStartTerminatingOn($startTerminatingOn) { - $this->startTerminatingOn = $startTerminatingOn; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\PaymentContractState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\PaymentContractState $state - * @return PaymentContract - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns terminatedBy. - * - * - * - * @return \Wallee\Sdk\Model\User - */ - public function getTerminatedBy() { - return $this->terminatedBy; - } - - /** - * Sets terminatedBy. - * - * @param \Wallee\Sdk\Model\User $terminatedBy - * @return PaymentContract - */ - public function setTerminatedBy($terminatedBy) { - $this->terminatedBy = $terminatedBy; - - return $this; - } - - /** - * Returns terminatedOn. - * - * - * - * @return \DateTime - */ - public function getTerminatedOn() { - return $this->terminatedOn; - } - - /** - * Sets terminatedOn. - * - * @param \DateTime $terminatedOn - * @return PaymentContract - */ - protected function setTerminatedOn($terminatedOn) { - $this->terminatedOn = $terminatedOn; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return PaymentContract - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class PaymentContract implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'PaymentContract'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'account' => '\Wallee\Sdk\Model\Account', + 'activated_on' => '\DateTime', + 'contract_identifier' => 'string', + 'contract_type' => '\Wallee\Sdk\Model\PaymentContractType', + 'created_by' => '\Wallee\Sdk\Model\User', + 'created_on' => '\DateTime', + 'external_id' => 'string', + 'id' => 'int', + 'rejected_on' => '\DateTime', + 'rejection_reason' => '\Wallee\Sdk\Model\FailureReason', + 'start_terminating_on' => '\DateTime', + 'state' => '\Wallee\Sdk\Model\PaymentContractState', + 'terminated_by' => '\Wallee\Sdk\Model\User', + 'terminated_on' => '\DateTime', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'account' => null, + 'activated_on' => 'date-time', + 'contract_identifier' => null, + 'contract_type' => null, + 'created_by' => null, + 'created_on' => 'date-time', + 'external_id' => null, + 'id' => 'int64', + 'rejected_on' => 'date-time', + 'rejection_reason' => null, + 'start_terminating_on' => 'date-time', + 'state' => null, + 'terminated_by' => null, + 'terminated_on' => 'date-time', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account' => 'account', + 'activated_on' => 'activatedOn', + 'contract_identifier' => 'contractIdentifier', + 'contract_type' => 'contractType', + 'created_by' => 'createdBy', + 'created_on' => 'createdOn', + 'external_id' => 'externalId', + 'id' => 'id', + 'rejected_on' => 'rejectedOn', + 'rejection_reason' => 'rejectionReason', + 'start_terminating_on' => 'startTerminatingOn', + 'state' => 'state', + 'terminated_by' => 'terminatedBy', + 'terminated_on' => 'terminatedOn', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account' => 'setAccount', + 'activated_on' => 'setActivatedOn', + 'contract_identifier' => 'setContractIdentifier', + 'contract_type' => 'setContractType', + 'created_by' => 'setCreatedBy', + 'created_on' => 'setCreatedOn', + 'external_id' => 'setExternalId', + 'id' => 'setId', + 'rejected_on' => 'setRejectedOn', + 'rejection_reason' => 'setRejectionReason', + 'start_terminating_on' => 'setStartTerminatingOn', + 'state' => 'setState', + 'terminated_by' => 'setTerminatedBy', + 'terminated_on' => 'setTerminatedOn', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account' => 'getAccount', + 'activated_on' => 'getActivatedOn', + 'contract_identifier' => 'getContractIdentifier', + 'contract_type' => 'getContractType', + 'created_by' => 'getCreatedBy', + 'created_on' => 'getCreatedOn', + 'external_id' => 'getExternalId', + 'id' => 'getId', + 'rejected_on' => 'getRejectedOn', + 'rejection_reason' => 'getRejectionReason', + 'start_terminating_on' => 'getStartTerminatingOn', + 'state' => 'getState', + 'terminated_by' => 'getTerminatedBy', + 'terminated_on' => 'getTerminatedOn', + 'version' => 'getVersion' + ]; + + + + /** + * 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['account'] = isset($data['account']) ? $data['account'] : null; + + $this->container['activated_on'] = isset($data['activated_on']) ? $data['activated_on'] : null; + + $this->container['contract_identifier'] = isset($data['contract_identifier']) ? $data['contract_identifier'] : null; + + $this->container['contract_type'] = isset($data['contract_type']) ? $data['contract_type'] : null; + + $this->container['created_by'] = isset($data['created_by']) ? $data['created_by'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['rejected_on'] = isset($data['rejected_on']) ? $data['rejected_on'] : null; + + $this->container['rejection_reason'] = isset($data['rejection_reason']) ? $data['rejection_reason'] : null; + + $this->container['start_terminating_on'] = isset($data['start_terminating_on']) ? $data['start_terminating_on'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['terminated_by'] = isset($data['terminated_by']) ? $data['terminated_by'] : null; + + $this->container['terminated_on'] = isset($data['terminated_on']) ? $data['terminated_on'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 account + * + * @return \Wallee\Sdk\Model\Account + */ + public function getAccount() + { + return $this->container['account']; + } + + /** + * Sets account + * + * @param \Wallee\Sdk\Model\Account $account + * + * @return $this + */ + public function setAccount($account) + { + $this->container['account'] = $account; + + return $this; + } + + + /** + * Gets activated_on + * + * @return \DateTime + */ + public function getActivatedOn() + { + return $this->container['activated_on']; + } + + /** + * Sets activated_on + * + * @param \DateTime $activated_on + * + * @return $this + */ + public function setActivatedOn($activated_on) + { + $this->container['activated_on'] = $activated_on; + + return $this; + } + + + /** + * Gets contract_identifier + * + * @return string + */ + public function getContractIdentifier() + { + return $this->container['contract_identifier']; + } + + /** + * Sets contract_identifier + * + * @param string $contract_identifier + * + * @return $this + */ + public function setContractIdentifier($contract_identifier) + { + $this->container['contract_identifier'] = $contract_identifier; + + return $this; + } + + + /** + * Gets contract_type + * + * @return \Wallee\Sdk\Model\PaymentContractType + */ + public function getContractType() + { + return $this->container['contract_type']; + } + + /** + * Sets contract_type + * + * @param \Wallee\Sdk\Model\PaymentContractType $contract_type + * + * @return $this + */ + public function setContractType($contract_type) + { + $this->container['contract_type'] = $contract_type; + + return $this; + } + + + /** + * Gets created_by + * + * @return \Wallee\Sdk\Model\User + */ + public function getCreatedBy() + { + return $this->container['created_by']; + } + + /** + * Sets created_by + * + * @param \Wallee\Sdk\Model\User $created_by + * + * @return $this + */ + public function setCreatedBy($created_by) + { + $this->container['created_by'] = $created_by; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets rejected_on + * + * @return \DateTime + */ + public function getRejectedOn() + { + return $this->container['rejected_on']; + } + + /** + * Sets rejected_on + * + * @param \DateTime $rejected_on + * + * @return $this + */ + public function setRejectedOn($rejected_on) + { + $this->container['rejected_on'] = $rejected_on; + + return $this; + } + + + /** + * Gets rejection_reason + * + * @return \Wallee\Sdk\Model\FailureReason + */ + public function getRejectionReason() + { + return $this->container['rejection_reason']; + } + + /** + * Sets rejection_reason + * + * @param \Wallee\Sdk\Model\FailureReason $rejection_reason + * + * @return $this + */ + public function setRejectionReason($rejection_reason) + { + $this->container['rejection_reason'] = $rejection_reason; + + return $this; + } + + + /** + * Gets start_terminating_on + * + * @return \DateTime + */ + public function getStartTerminatingOn() + { + return $this->container['start_terminating_on']; + } + + /** + * Sets start_terminating_on + * + * @param \DateTime $start_terminating_on + * + * @return $this + */ + public function setStartTerminatingOn($start_terminating_on) + { + $this->container['start_terminating_on'] = $start_terminating_on; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\PaymentContractState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\PaymentContractState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets terminated_by + * + * @return \Wallee\Sdk\Model\User + */ + public function getTerminatedBy() + { + return $this->container['terminated_by']; + } + + /** + * Sets terminated_by + * + * @param \Wallee\Sdk\Model\User $terminated_by + * + * @return $this + */ + public function setTerminatedBy($terminated_by) + { + $this->container['terminated_by'] = $terminated_by; + + return $this; + } + + + /** + * Gets terminated_on + * + * @return \DateTime + */ + public function getTerminatedOn() + { + return $this->container['terminated_on']; + } + + /** + * Sets terminated_on + * + * @param \DateTime $terminated_on + * + * @return $this + */ + public function setTerminatedOn($terminated_on) + { + $this->container['terminated_on'] = $terminated_on; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/PaymentContractState.php b/wallee-sdk/lib/Model/PaymentContractState.php index 8bd96c7..7116a97 100644 --- a/wallee-sdk/lib/Model/PaymentContractState.php +++ b/wallee-sdk/lib/Model/PaymentContractState.php @@ -1,10 +1,8 @@ 'map[string,string]', - 'feature' => '\Wallee\Sdk\Model\Feature', - 'id' => 'int', - 'name' => 'map[string,string]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * - * - * @var \Wallee\Sdk\Model\Feature - */ - private $feature; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $name; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['feature'])) { - $this->setFeature($data['feature']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - } - - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return PaymentContractType - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns feature. - * - * - * - * @return \Wallee\Sdk\Model\Feature - */ - public function getFeature() { - return $this->feature; - } - - /** - * Sets feature. - * - * @param \Wallee\Sdk\Model\Feature $feature - * @return PaymentContractType - */ - public function setFeature($feature) { - $this->feature = $feature; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return PaymentContractType - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return PaymentContractType - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class PaymentContractType implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'PaymentContractType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'description' => 'map[string,string]', + 'feature' => '\Wallee\Sdk\Model\Feature', + 'id' => 'int', + 'name' => 'map[string,string]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'feature' => null, + 'id' => 'int64', + 'name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'feature' => 'feature', + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'feature' => 'setFeature', + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'feature' => 'getFeature', + 'id' => 'getId', + 'name' => 'getName' + ]; + + + + /** + * 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['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['feature'] = isset($data['feature']) ? $data['feature'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets feature + * + * @return \Wallee\Sdk\Model\Feature + */ + public function getFeature() + { + return $this->container['feature']; + } + + /** + * Sets feature + * + * @param \Wallee\Sdk\Model\Feature $feature + * + * @return $this + */ + public function setFeature($feature) + { + $this->container['feature'] = $feature; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + 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/wallee-sdk/lib/Model/PaymentLink.php b/wallee-sdk/lib/Model/PaymentLink.php index 88cc67b..0e2a9f7 100644 --- a/wallee-sdk/lib/Model/PaymentLink.php +++ b/wallee-sdk/lib/Model/PaymentLink.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\PaymentMethodConfiguration[]', - 'appliedSpaceView' => 'int', - 'availableFrom' => '\DateTime', - 'availableUntil' => '\DateTime', - 'billingAddressRequired' => 'bool', - 'currency' => 'string', - 'externalId' => 'string', - 'id' => 'int', - 'language' => 'string', - 'lineItems' => '\Wallee\Sdk\Model\LineItem[]', - 'linkedSpaceId' => 'int', - 'maximalNumberOfTransactions' => 'int', - 'name' => 'string', - 'plannedPurgeDate' => '\DateTime', - 'protectionMode' => '\Wallee\Sdk\Model\PaymentLinkProtectionMode', - 'shippingAddressRequired' => 'bool', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'url' => 'string', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The allowed payment method configurations restrict the payment methods which can be used with this payment link. - * - * @var \Wallee\Sdk\Model\PaymentMethodConfiguration[] - */ - private $allowedPaymentMethodConfigurations; - - /** - * The payment link can be conducted in a specific space view. The space view may apply a specific design to the payment page. - * - * @var int - */ - private $appliedSpaceView; - - /** - * The available from date defines the earliest date on which the payment link can be used. When no date is specified there will be no restriction. - * - * @var \DateTime - */ - private $availableFrom; - - /** - * The available from date defines the latest date on which the payment link can be used to initialize a transaction. When no date is specified there will be no restriction. - * - * @var \DateTime - */ - private $availableUntil; - - /** - * By making the billing address required the transaction can only be created when a billing address is provided within the request. - * - * @var bool - */ - private $billingAddressRequired; - - /** - * The currency defines in which currency the payment is executed in. If no currency is defined it has to be specified within the request parameter 'currency'. - * - * @var string - */ - private $currency; - - /** - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @var string - */ - private $externalId; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The language defines the language of the payment page. If no language is provided it can be provided through the request parameter. - * - * @var string - */ - private $language; - - /** - * The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters. - * - * @var \Wallee\Sdk\Model\LineItem[] - */ - private $lineItems; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The maximal number of transactions limits the number of transactions which can be created with this payment link. - * - * @var int - */ - private $maximalNumberOfTransactions; - - /** - * The payment link name is used internally to identify the payment link. For example the name is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * The protection mode determines if the payment link is protected against tampering and in what way. - * - * @var \Wallee\Sdk\Model\PaymentLinkProtectionMode - */ - private $protectionMode; - - /** - * By making the shipping address required the transaction can only be created when a shipping address is provided within the request. - * - * @var bool - */ - private $shippingAddressRequired; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The URL defines the URL to which the user has to be forwarded to initialize the payment. - * - * @var string - */ - private $url; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['allowedPaymentMethodConfigurations'])) { - $this->setAllowedPaymentMethodConfigurations($data['allowedPaymentMethodConfigurations']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['lineItems'])) { - $this->setLineItems($data['lineItems']); - } - if (isset($data['protectionMode'])) { - $this->setProtectionMode($data['protectionMode']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns allowedPaymentMethodConfigurations. - * - * The allowed payment method configurations restrict the payment methods which can be used with this payment link. - * - * @return \Wallee\Sdk\Model\PaymentMethodConfiguration[] - */ - public function getAllowedPaymentMethodConfigurations() { - return $this->allowedPaymentMethodConfigurations; - } - - /** - * Sets allowedPaymentMethodConfigurations. - * - * @param \Wallee\Sdk\Model\PaymentMethodConfiguration[] $allowedPaymentMethodConfigurations - * @return PaymentLink - */ - public function setAllowedPaymentMethodConfigurations($allowedPaymentMethodConfigurations) { - $this->allowedPaymentMethodConfigurations = $allowedPaymentMethodConfigurations; - - return $this; - } - - /** - * Returns appliedSpaceView. - * - * The payment link can be conducted in a specific space view. The space view may apply a specific design to the payment page. - * - * @return int - */ - public function getAppliedSpaceView() { - return $this->appliedSpaceView; - } - - /** - * Sets appliedSpaceView. - * - * @param int $appliedSpaceView - * @return PaymentLink - */ - protected function setAppliedSpaceView($appliedSpaceView) { - $this->appliedSpaceView = $appliedSpaceView; - - return $this; - } - - /** - * Returns availableFrom. - * - * The available from date defines the earliest date on which the payment link can be used. When no date is specified there will be no restriction. - * - * @return \DateTime - */ - public function getAvailableFrom() { - return $this->availableFrom; - } - - /** - * Sets availableFrom. - * - * @param \DateTime $availableFrom - * @return PaymentLink - */ - protected function setAvailableFrom($availableFrom) { - $this->availableFrom = $availableFrom; - - return $this; - } - - /** - * Returns availableUntil. - * - * The available from date defines the latest date on which the payment link can be used to initialize a transaction. When no date is specified there will be no restriction. - * - * @return \DateTime - */ - public function getAvailableUntil() { - return $this->availableUntil; - } - - /** - * Sets availableUntil. - * - * @param \DateTime $availableUntil - * @return PaymentLink - */ - protected function setAvailableUntil($availableUntil) { - $this->availableUntil = $availableUntil; - - return $this; - } - - /** - * Returns billingAddressRequired. - * - * By making the billing address required the transaction can only be created when a billing address is provided within the request. - * - * @return bool - */ - public function getBillingAddressRequired() { - return $this->billingAddressRequired; - } - - /** - * Sets billingAddressRequired. - * - * @param bool $billingAddressRequired - * @return PaymentLink - */ - protected function setBillingAddressRequired($billingAddressRequired) { - $this->billingAddressRequired = $billingAddressRequired; - - return $this; - } - - /** - * Returns currency. - * - * The currency defines in which currency the payment is executed in. If no currency is defined it has to be specified within the request parameter 'currency'. - * - * @return string - */ - public function getCurrency() { - return $this->currency; - } - - /** - * Sets currency. - * - * @param string $currency - * @return PaymentLink - */ - protected function setCurrency($currency) { - $this->currency = $currency; - - return $this; - } - - /** - * Returns externalId. - * - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @return string - */ - public function getExternalId() { - return $this->externalId; - } - - /** - * Sets externalId. - * - * @param string $externalId - * @return PaymentLink - */ - protected function setExternalId($externalId) { - $this->externalId = $externalId; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return PaymentLink - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns language. - * - * The language defines the language of the payment page. If no language is provided it can be provided through the request parameter. - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return PaymentLink - */ - protected function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns lineItems. - * - * The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters. - * - * @return \Wallee\Sdk\Model\LineItem[] - */ - public function getLineItems() { - return $this->lineItems; - } - - /** - * Sets lineItems. - * - * @param \Wallee\Sdk\Model\LineItem[] $lineItems - * @return PaymentLink - */ - public function setLineItems($lineItems) { - $this->lineItems = $lineItems; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return PaymentLink - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns maximalNumberOfTransactions. - * - * The maximal number of transactions limits the number of transactions which can be created with this payment link. - * - * @return int - */ - public function getMaximalNumberOfTransactions() { - return $this->maximalNumberOfTransactions; - } - - /** - * Sets maximalNumberOfTransactions. - * - * @param int $maximalNumberOfTransactions - * @return PaymentLink - */ - protected function setMaximalNumberOfTransactions($maximalNumberOfTransactions) { - $this->maximalNumberOfTransactions = $maximalNumberOfTransactions; - - return $this; - } - - /** - * Returns name. - * - * The payment link name is used internally to identify the payment link. For example the name is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return PaymentLink - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return PaymentLink - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns protectionMode. - * - * The protection mode determines if the payment link is protected against tampering and in what way. - * - * @return \Wallee\Sdk\Model\PaymentLinkProtectionMode - */ - public function getProtectionMode() { - return $this->protectionMode; - } - - /** - * Sets protectionMode. - * - * @param \Wallee\Sdk\Model\PaymentLinkProtectionMode $protectionMode - * @return PaymentLink - */ - public function setProtectionMode($protectionMode) { - $this->protectionMode = $protectionMode; - - return $this; - } - - /** - * Returns shippingAddressRequired. - * - * By making the shipping address required the transaction can only be created when a shipping address is provided within the request. - * - * @return bool - */ - public function getShippingAddressRequired() { - return $this->shippingAddressRequired; - } - - /** - * Sets shippingAddressRequired. - * - * @param bool $shippingAddressRequired - * @return PaymentLink - */ - protected function setShippingAddressRequired($shippingAddressRequired) { - $this->shippingAddressRequired = $shippingAddressRequired; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return PaymentLink - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns url. - * - * The URL defines the URL to which the user has to be forwarded to initialize the payment. - * - * @return string - */ - public function getUrl() { - return $this->url; - } - - /** - * Sets url. - * - * @param string $url - * @return PaymentLink - */ - protected function setUrl($url) { - $this->url = $url; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return PaymentLink - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class PaymentLink implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'PaymentLink'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'allowed_payment_method_configurations' => '\Wallee\Sdk\Model\PaymentMethodConfiguration[]', + 'applied_space_view' => 'int', + 'available_from' => '\DateTime', + 'available_until' => '\DateTime', + 'billing_address_required' => 'bool', + 'currency' => 'string', + 'external_id' => 'string', + 'id' => 'int', + 'language' => 'string', + 'line_items' => '\Wallee\Sdk\Model\LineItem[]', + 'linked_space_id' => 'int', + 'maximal_number_of_transactions' => 'int', + 'name' => 'string', + 'planned_purge_date' => '\DateTime', + 'protection_mode' => '\Wallee\Sdk\Model\PaymentLinkProtectionMode', + 'shipping_address_required' => 'bool', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'url' => 'string', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'allowed_payment_method_configurations' => null, + 'applied_space_view' => 'int64', + 'available_from' => 'date-time', + 'available_until' => 'date-time', + 'billing_address_required' => null, + 'currency' => null, + 'external_id' => null, + 'id' => 'int64', + 'language' => null, + 'line_items' => null, + 'linked_space_id' => 'int64', + 'maximal_number_of_transactions' => 'int32', + 'name' => null, + 'planned_purge_date' => 'date-time', + 'protection_mode' => null, + 'shipping_address_required' => null, + 'state' => null, + 'url' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'allowed_payment_method_configurations' => 'allowedPaymentMethodConfigurations', + 'applied_space_view' => 'appliedSpaceView', + 'available_from' => 'availableFrom', + 'available_until' => 'availableUntil', + 'billing_address_required' => 'billingAddressRequired', + 'currency' => 'currency', + 'external_id' => 'externalId', + 'id' => 'id', + 'language' => 'language', + 'line_items' => 'lineItems', + 'linked_space_id' => 'linkedSpaceId', + 'maximal_number_of_transactions' => 'maximalNumberOfTransactions', + 'name' => 'name', + 'planned_purge_date' => 'plannedPurgeDate', + 'protection_mode' => 'protectionMode', + 'shipping_address_required' => 'shippingAddressRequired', + 'state' => 'state', + 'url' => 'url', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'allowed_payment_method_configurations' => 'setAllowedPaymentMethodConfigurations', + 'applied_space_view' => 'setAppliedSpaceView', + 'available_from' => 'setAvailableFrom', + 'available_until' => 'setAvailableUntil', + 'billing_address_required' => 'setBillingAddressRequired', + 'currency' => 'setCurrency', + 'external_id' => 'setExternalId', + 'id' => 'setId', + 'language' => 'setLanguage', + 'line_items' => 'setLineItems', + 'linked_space_id' => 'setLinkedSpaceId', + 'maximal_number_of_transactions' => 'setMaximalNumberOfTransactions', + 'name' => 'setName', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'protection_mode' => 'setProtectionMode', + 'shipping_address_required' => 'setShippingAddressRequired', + 'state' => 'setState', + 'url' => 'setUrl', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'allowed_payment_method_configurations' => 'getAllowedPaymentMethodConfigurations', + 'applied_space_view' => 'getAppliedSpaceView', + 'available_from' => 'getAvailableFrom', + 'available_until' => 'getAvailableUntil', + 'billing_address_required' => 'getBillingAddressRequired', + 'currency' => 'getCurrency', + 'external_id' => 'getExternalId', + 'id' => 'getId', + 'language' => 'getLanguage', + 'line_items' => 'getLineItems', + 'linked_space_id' => 'getLinkedSpaceId', + 'maximal_number_of_transactions' => 'getMaximalNumberOfTransactions', + 'name' => 'getName', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'protection_mode' => 'getProtectionMode', + 'shipping_address_required' => 'getShippingAddressRequired', + 'state' => 'getState', + 'url' => 'getUrl', + 'version' => 'getVersion' + ]; + + + + /** + * 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['allowed_payment_method_configurations'] = isset($data['allowed_payment_method_configurations']) ? $data['allowed_payment_method_configurations'] : null; + + $this->container['applied_space_view'] = isset($data['applied_space_view']) ? $data['applied_space_view'] : null; + + $this->container['available_from'] = isset($data['available_from']) ? $data['available_from'] : null; + + $this->container['available_until'] = isset($data['available_until']) ? $data['available_until'] : null; + + $this->container['billing_address_required'] = isset($data['billing_address_required']) ? $data['billing_address_required'] : null; + + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['line_items'] = isset($data['line_items']) ? $data['line_items'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['maximal_number_of_transactions'] = isset($data['maximal_number_of_transactions']) ? $data['maximal_number_of_transactions'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['protection_mode'] = isset($data['protection_mode']) ? $data['protection_mode'] : null; + + $this->container['shipping_address_required'] = isset($data['shipping_address_required']) ? $data['shipping_address_required'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 allowed_payment_method_configurations + * + * @return \Wallee\Sdk\Model\PaymentMethodConfiguration[] + */ + public function getAllowedPaymentMethodConfigurations() + { + return $this->container['allowed_payment_method_configurations']; + } + + /** + * Sets allowed_payment_method_configurations + * + * @param \Wallee\Sdk\Model\PaymentMethodConfiguration[] $allowed_payment_method_configurations The allowed payment method configurations restrict the payment methods which can be used with this payment link. + * + * @return $this + */ + public function setAllowedPaymentMethodConfigurations($allowed_payment_method_configurations) + { + $this->container['allowed_payment_method_configurations'] = $allowed_payment_method_configurations; + + return $this; + } + + + /** + * Gets applied_space_view + * + * @return int + */ + public function getAppliedSpaceView() + { + return $this->container['applied_space_view']; + } + + /** + * Sets applied_space_view + * + * @param int $applied_space_view The payment link can be conducted in a specific space view. The space view may apply a specific design to the payment page. + * + * @return $this + */ + public function setAppliedSpaceView($applied_space_view) + { + $this->container['applied_space_view'] = $applied_space_view; + + return $this; + } + + + /** + * Gets available_from + * + * @return \DateTime + */ + public function getAvailableFrom() + { + return $this->container['available_from']; + } + + /** + * Sets available_from + * + * @param \DateTime $available_from The available from date defines the earliest date on which the payment link can be used. When no date is specified there will be no restriction. + * + * @return $this + */ + public function setAvailableFrom($available_from) + { + $this->container['available_from'] = $available_from; + + return $this; + } + + + /** + * Gets available_until + * + * @return \DateTime + */ + public function getAvailableUntil() + { + return $this->container['available_until']; + } + + /** + * Sets available_until + * + * @param \DateTime $available_until The available from date defines the latest date on which the payment link can be used to initialize a transaction. When no date is specified there will be no restriction. + * + * @return $this + */ + public function setAvailableUntil($available_until) + { + $this->container['available_until'] = $available_until; + + return $this; + } + + + /** + * Gets billing_address_required + * + * @return bool + */ + public function getBillingAddressRequired() + { + return $this->container['billing_address_required']; + } + + /** + * Sets billing_address_required + * + * @param bool $billing_address_required By making the billing address required the transaction can only be created when a billing address is provided within the request. + * + * @return $this + */ + public function setBillingAddressRequired($billing_address_required) + { + $this->container['billing_address_required'] = $billing_address_required; + + return $this; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The currency defines in which currency the payment is executed in. If no currency is defined it has to be specified within the request parameter 'currency'. + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language The language defines the language of the payment page. If no language is provided it can be provided through the request parameter. + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets line_items + * + * @return \Wallee\Sdk\Model\LineItem[] + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Wallee\Sdk\Model\LineItem[] $line_items The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters. + * + * @return $this + */ + public function setLineItems($line_items) + { + $this->container['line_items'] = $line_items; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets maximal_number_of_transactions + * + * @return int + */ + public function getMaximalNumberOfTransactions() + { + return $this->container['maximal_number_of_transactions']; + } + + /** + * Sets maximal_number_of_transactions + * + * @param int $maximal_number_of_transactions The maximal number of transactions limits the number of transactions which can be created with this payment link. + * + * @return $this + */ + public function setMaximalNumberOfTransactions($maximal_number_of_transactions) + { + $this->container['maximal_number_of_transactions'] = $maximal_number_of_transactions; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The payment link name is used internally to identify the payment link. For example the name is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets protection_mode + * + * @return \Wallee\Sdk\Model\PaymentLinkProtectionMode + */ + public function getProtectionMode() + { + return $this->container['protection_mode']; + } + + /** + * Sets protection_mode + * + * @param \Wallee\Sdk\Model\PaymentLinkProtectionMode $protection_mode The protection mode determines if the payment link is protected against tampering and in what way. + * + * @return $this + */ + public function setProtectionMode($protection_mode) + { + $this->container['protection_mode'] = $protection_mode; + + return $this; + } + + + /** + * Gets shipping_address_required + * + * @return bool + */ + public function getShippingAddressRequired() + { + return $this->container['shipping_address_required']; + } + + /** + * Sets shipping_address_required + * + * @param bool $shipping_address_required By making the shipping address required the transaction can only be created when a shipping address is provided within the request. + * + * @return $this + */ + public function setShippingAddressRequired($shipping_address_required) + { + $this->container['shipping_address_required'] = $shipping_address_required; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url The URL defines the URL to which the user has to be forwarded to initialize the payment. + * + * @return $this + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/PaymentLinkActive.php b/wallee-sdk/lib/Model/PaymentLinkActive.php index 1351410..a2aa410 100644 --- a/wallee-sdk/lib/Model/PaymentLinkActive.php +++ b/wallee-sdk/lib/Model/PaymentLinkActive.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\CreationEntityState' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['state'])) { - $this->setState($data['state']); - } - } - - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return PaymentLinkActive - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class PaymentLinkActive extends PaymentLinkUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'PaymentLink.Active'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'state' => '\Wallee\Sdk\Model\CreationEntityState' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'state' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'state' => 'state' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'state' => 'setState' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'state' => 'getState' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + 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/wallee-sdk/lib/Model/PaymentLinkCreate.php b/wallee-sdk/lib/Model/PaymentLinkCreate.php index 4c77cf7..1bafe48 100644 --- a/wallee-sdk/lib/Model/PaymentLinkCreate.php +++ b/wallee-sdk/lib/Model/PaymentLinkCreate.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\CreationEntityState', - 'externalId' => 'string', - 'protectionMode' => '\Wallee\Sdk\Model\PaymentLinkProtectionMode' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @var string - */ - private $externalId; - - /** - * The protection mode determines if the payment link is protected against tampering and in what way. - * - * @var \Wallee\Sdk\Model\PaymentLinkProtectionMode - */ - private $protectionMode; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['externalId'])) { - $this->setExternalId($data['externalId']); - } - if (isset($data['protectionMode'])) { - $this->setProtectionMode($data['protectionMode']); - } - } - - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return PaymentLinkCreate - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns externalId. - * - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @return string - */ - public function getExternalId() { - return $this->externalId; - } - - /** - * Sets externalId. - * - * @param string $externalId - * @return PaymentLinkCreate - */ - public function setExternalId($externalId) { - $this->externalId = $externalId; - - return $this; - } - - /** - * Returns protectionMode. - * - * The protection mode determines if the payment link is protected against tampering and in what way. - * - * @return \Wallee\Sdk\Model\PaymentLinkProtectionMode - */ - public function getProtectionMode() { - return $this->protectionMode; - } - - /** - * Sets protectionMode. - * - * @param \Wallee\Sdk\Model\PaymentLinkProtectionMode $protectionMode - * @return PaymentLinkCreate - */ - public function setProtectionMode($protectionMode) { - $this->protectionMode = $protectionMode; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - if ($this->getExternalId() === null) { - throw new ValidationException("'externalId' can't be null", 'externalId', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class PaymentLinkCreate extends AbstractPaymentLinkUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'PaymentLink.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'external_id' => 'string', + 'protection_mode' => '\Wallee\Sdk\Model\PaymentLinkProtectionMode' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'state' => null, + 'external_id' => null, + 'protection_mode' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'state' => 'state', + 'external_id' => 'externalId', + 'protection_mode' => 'protectionMode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'state' => 'setState', + 'external_id' => 'setExternalId', + 'protection_mode' => 'setProtectionMode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'state' => 'getState', + 'external_id' => 'getExternalId', + 'protection_mode' => 'getProtectionMode' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['protection_mode'] = isset($data['protection_mode']) ? $data['protection_mode'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['external_id'] === null) { + $invalidProperties[] = "'external_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets protection_mode + * + * @return \Wallee\Sdk\Model\PaymentLinkProtectionMode + */ + public function getProtectionMode() + { + return $this->container['protection_mode']; + } + + /** + * Sets protection_mode + * + * @param \Wallee\Sdk\Model\PaymentLinkProtectionMode $protection_mode The protection mode determines if the payment link is protected against tampering and in what way. + * + * @return $this + */ + public function setProtectionMode($protection_mode) + { + $this->container['protection_mode'] = $protection_mode; + + 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/wallee-sdk/lib/Model/PaymentLinkProtectionMode.php b/wallee-sdk/lib/Model/PaymentLinkProtectionMode.php index 44abd83..61533c0 100644 --- a/wallee-sdk/lib/Model/PaymentLinkProtectionMode.php +++ b/wallee-sdk/lib/Model/PaymentLinkProtectionMode.php @@ -1,10 +1,8 @@ 'int', - 'version' => 'int', - 'allowedPaymentMethodConfigurations' => '\Wallee\Sdk\Model\PaymentMethodConfiguration[]', - 'appliedSpaceView' => 'int', - 'availableFrom' => '\DateTime', - 'availableUntil' => '\DateTime', - 'billingAddressRequired' => 'bool', - 'currency' => 'string', - 'language' => 'string', - 'lineItems' => '\Wallee\Sdk\Model\LineItemCreate[]', - 'maximalNumberOfTransactions' => 'int', - 'name' => 'string', - 'shippingAddressRequired' => 'bool' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - /** - * The allowed payment method configurations restrict the payment methods which can be used with this payment link. - * - * @var \Wallee\Sdk\Model\PaymentMethodConfiguration[] - */ - private $allowedPaymentMethodConfigurations; - - /** - * The payment link can be conducted in a specific space view. The space view may apply a specific design to the payment page. - * - * @var int - */ - private $appliedSpaceView; - - /** - * The available from date defines the earliest date on which the payment link can be used. When no date is specified there will be no restriction. - * - * @var \DateTime - */ - private $availableFrom; - - /** - * The available from date defines the latest date on which the payment link can be used to initialize a transaction. When no date is specified there will be no restriction. - * - * @var \DateTime - */ - private $availableUntil; - - /** - * By making the billing address required the transaction can only be created when a billing address is provided within the request. - * - * @var bool - */ - private $billingAddressRequired; - - /** - * The currency defines in which currency the payment is executed in. If no currency is defined it has to be specified within the request parameter 'currency'. - * - * @var string - */ - private $currency; - - /** - * The language defines the language of the payment page. If no language is provided it can be provided through the request parameter. - * - * @var string - */ - private $language; - - /** - * The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters. - * - * @var \Wallee\Sdk\Model\LineItemCreate[] - */ - private $lineItems; - - /** - * The maximal number of transactions limits the number of transactions which can be created with this payment link. - * - * @var int - */ - private $maximalNumberOfTransactions; - - /** - * The payment link name is used internally to identify the payment link. For example the name is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * By making the shipping address required the transaction can only be created when a shipping address is provided within the request. - * - * @var bool - */ - private $shippingAddressRequired; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - if (isset($data['allowedPaymentMethodConfigurations'])) { - $this->setAllowedPaymentMethodConfigurations($data['allowedPaymentMethodConfigurations']); - } - if (isset($data['appliedSpaceView'])) { - $this->setAppliedSpaceView($data['appliedSpaceView']); - } - if (isset($data['availableFrom'])) { - $this->setAvailableFrom($data['availableFrom']); - } - if (isset($data['availableUntil'])) { - $this->setAvailableUntil($data['availableUntil']); - } - if (isset($data['billingAddressRequired'])) { - $this->setBillingAddressRequired($data['billingAddressRequired']); - } - if (isset($data['currency'])) { - $this->setCurrency($data['currency']); - } - if (isset($data['language'])) { - $this->setLanguage($data['language']); - } - if (isset($data['lineItems'])) { - $this->setLineItems($data['lineItems']); - } - if (isset($data['maximalNumberOfTransactions'])) { - $this->setMaximalNumberOfTransactions($data['maximalNumberOfTransactions']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['shippingAddressRequired'])) { - $this->setShippingAddressRequired($data['shippingAddressRequired']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return PaymentLinkUpdate - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return PaymentLinkUpdate - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Returns allowedPaymentMethodConfigurations. - * - * The allowed payment method configurations restrict the payment methods which can be used with this payment link. - * - * @return \Wallee\Sdk\Model\PaymentMethodConfiguration[] - */ - public function getAllowedPaymentMethodConfigurations() { - return $this->allowedPaymentMethodConfigurations; - } - - /** - * Sets allowedPaymentMethodConfigurations. - * - * @param \Wallee\Sdk\Model\PaymentMethodConfiguration[] $allowedPaymentMethodConfigurations - * @return PaymentLinkUpdate - */ - public function setAllowedPaymentMethodConfigurations($allowedPaymentMethodConfigurations) { - $this->allowedPaymentMethodConfigurations = $allowedPaymentMethodConfigurations; - - return $this; - } - - /** - * Returns appliedSpaceView. - * - * The payment link can be conducted in a specific space view. The space view may apply a specific design to the payment page. - * - * @return int - */ - public function getAppliedSpaceView() { - return $this->appliedSpaceView; - } - - /** - * Sets appliedSpaceView. - * - * @param int $appliedSpaceView - * @return PaymentLinkUpdate - */ - public function setAppliedSpaceView($appliedSpaceView) { - $this->appliedSpaceView = $appliedSpaceView; - - return $this; - } - - /** - * Returns availableFrom. - * - * The available from date defines the earliest date on which the payment link can be used. When no date is specified there will be no restriction. - * - * @return \DateTime - */ - public function getAvailableFrom() { - return $this->availableFrom; - } - - /** - * Sets availableFrom. - * - * @param \DateTime $availableFrom - * @return PaymentLinkUpdate - */ - public function setAvailableFrom($availableFrom) { - $this->availableFrom = $availableFrom; - - return $this; - } - - /** - * Returns availableUntil. - * - * The available from date defines the latest date on which the payment link can be used to initialize a transaction. When no date is specified there will be no restriction. - * - * @return \DateTime - */ - public function getAvailableUntil() { - return $this->availableUntil; - } - - /** - * Sets availableUntil. - * - * @param \DateTime $availableUntil - * @return PaymentLinkUpdate - */ - public function setAvailableUntil($availableUntil) { - $this->availableUntil = $availableUntil; - - return $this; - } - - /** - * Returns billingAddressRequired. - * - * By making the billing address required the transaction can only be created when a billing address is provided within the request. - * - * @return bool - */ - public function getBillingAddressRequired() { - return $this->billingAddressRequired; - } - - /** - * Sets billingAddressRequired. - * - * @param bool $billingAddressRequired - * @return PaymentLinkUpdate - */ - public function setBillingAddressRequired($billingAddressRequired) { - $this->billingAddressRequired = $billingAddressRequired; - - return $this; - } - - /** - * Returns currency. - * - * The currency defines in which currency the payment is executed in. If no currency is defined it has to be specified within the request parameter 'currency'. - * - * @return string - */ - public function getCurrency() { - return $this->currency; - } - - /** - * Sets currency. - * - * @param string $currency - * @return PaymentLinkUpdate - */ - public function setCurrency($currency) { - $this->currency = $currency; - - return $this; - } - - /** - * Returns language. - * - * The language defines the language of the payment page. If no language is provided it can be provided through the request parameter. - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return PaymentLinkUpdate - */ - public function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns lineItems. - * - * The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters. - * - * @return \Wallee\Sdk\Model\LineItemCreate[] - */ - public function getLineItems() { - return $this->lineItems; - } - - /** - * Sets lineItems. - * - * @param \Wallee\Sdk\Model\LineItemCreate[] $lineItems - * @return PaymentLinkUpdate - */ - public function setLineItems($lineItems) { - $this->lineItems = $lineItems; - - return $this; - } - - /** - * Returns maximalNumberOfTransactions. - * - * The maximal number of transactions limits the number of transactions which can be created with this payment link. - * - * @return int - */ - public function getMaximalNumberOfTransactions() { - return $this->maximalNumberOfTransactions; - } - - /** - * Sets maximalNumberOfTransactions. - * - * @param int $maximalNumberOfTransactions - * @return PaymentLinkUpdate - */ - public function setMaximalNumberOfTransactions($maximalNumberOfTransactions) { - $this->maximalNumberOfTransactions = $maximalNumberOfTransactions; - - return $this; - } - - /** - * Returns name. - * - * The payment link name is used internally to identify the payment link. For example the name is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return PaymentLinkUpdate - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns shippingAddressRequired. - * - * By making the shipping address required the transaction can only be created when a shipping address is provided within the request. - * - * @return bool - */ - public function getShippingAddressRequired() { - return $this->shippingAddressRequired; - } - - /** - * Sets shippingAddressRequired. - * - * @param bool $shippingAddressRequired - * @return PaymentLinkUpdate - */ - public function setShippingAddressRequired($shippingAddressRequired) { - $this->shippingAddressRequired = $shippingAddressRequired; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getId() === null) { - throw new ValidationException("'id' can't be null", 'id', $this); - } - if ($this->getVersion() === null) { - throw new ValidationException("'version' can't be null", 'version', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class PaymentLinkUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'PaymentLink.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'version' => 'int', + 'allowed_payment_method_configurations' => '\Wallee\Sdk\Model\PaymentMethodConfiguration[]', + 'applied_space_view' => 'int', + 'available_from' => '\DateTime', + 'available_until' => '\DateTime', + 'billing_address_required' => 'bool', + 'currency' => 'string', + 'language' => 'string', + 'line_items' => '\Wallee\Sdk\Model\LineItemCreate[]', + 'maximal_number_of_transactions' => 'int', + 'name' => 'string', + 'shipping_address_required' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64', + 'allowed_payment_method_configurations' => null, + 'applied_space_view' => 'int64', + 'available_from' => 'date-time', + 'available_until' => 'date-time', + 'billing_address_required' => null, + 'currency' => null, + 'language' => null, + 'line_items' => null, + 'maximal_number_of_transactions' => 'int32', + 'name' => null, + 'shipping_address_required' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version', + 'allowed_payment_method_configurations' => 'allowedPaymentMethodConfigurations', + 'applied_space_view' => 'appliedSpaceView', + 'available_from' => 'availableFrom', + 'available_until' => 'availableUntil', + 'billing_address_required' => 'billingAddressRequired', + 'currency' => 'currency', + 'language' => 'language', + 'line_items' => 'lineItems', + 'maximal_number_of_transactions' => 'maximalNumberOfTransactions', + 'name' => 'name', + 'shipping_address_required' => 'shippingAddressRequired' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion', + 'allowed_payment_method_configurations' => 'setAllowedPaymentMethodConfigurations', + 'applied_space_view' => 'setAppliedSpaceView', + 'available_from' => 'setAvailableFrom', + 'available_until' => 'setAvailableUntil', + 'billing_address_required' => 'setBillingAddressRequired', + 'currency' => 'setCurrency', + 'language' => 'setLanguage', + 'line_items' => 'setLineItems', + 'maximal_number_of_transactions' => 'setMaximalNumberOfTransactions', + 'name' => 'setName', + 'shipping_address_required' => 'setShippingAddressRequired' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion', + 'allowed_payment_method_configurations' => 'getAllowedPaymentMethodConfigurations', + 'applied_space_view' => 'getAppliedSpaceView', + 'available_from' => 'getAvailableFrom', + 'available_until' => 'getAvailableUntil', + 'billing_address_required' => 'getBillingAddressRequired', + 'currency' => 'getCurrency', + 'language' => 'getLanguage', + 'line_items' => 'getLineItems', + 'maximal_number_of_transactions' => 'getMaximalNumberOfTransactions', + 'name' => 'getName', + 'shipping_address_required' => 'getShippingAddressRequired' + ]; + + + + /** + * 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['version'] = isset($data['version']) ? $data['version'] : null; + + $this->container['allowed_payment_method_configurations'] = isset($data['allowed_payment_method_configurations']) ? $data['allowed_payment_method_configurations'] : null; + + $this->container['applied_space_view'] = isset($data['applied_space_view']) ? $data['applied_space_view'] : null; + + $this->container['available_from'] = isset($data['available_from']) ? $data['available_from'] : null; + + $this->container['available_until'] = isset($data['available_until']) ? $data['available_until'] : null; + + $this->container['billing_address_required'] = isset($data['billing_address_required']) ? $data['billing_address_required'] : null; + + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['line_items'] = isset($data['line_items']) ? $data['line_items'] : null; + + $this->container['maximal_number_of_transactions'] = isset($data['maximal_number_of_transactions']) ? $data['maximal_number_of_transactions'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['shipping_address_required'] = isset($data['shipping_address_required']) ? $data['shipping_address_required'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + + /** + * Gets allowed_payment_method_configurations + * + * @return \Wallee\Sdk\Model\PaymentMethodConfiguration[] + */ + public function getAllowedPaymentMethodConfigurations() + { + return $this->container['allowed_payment_method_configurations']; + } + + /** + * Sets allowed_payment_method_configurations + * + * @param \Wallee\Sdk\Model\PaymentMethodConfiguration[] $allowed_payment_method_configurations The allowed payment method configurations restrict the payment methods which can be used with this payment link. + * + * @return $this + */ + public function setAllowedPaymentMethodConfigurations($allowed_payment_method_configurations) + { + $this->container['allowed_payment_method_configurations'] = $allowed_payment_method_configurations; + + return $this; + } + + + /** + * Gets applied_space_view + * + * @return int + */ + public function getAppliedSpaceView() + { + return $this->container['applied_space_view']; + } + + /** + * Sets applied_space_view + * + * @param int $applied_space_view The payment link can be conducted in a specific space view. The space view may apply a specific design to the payment page. + * + * @return $this + */ + public function setAppliedSpaceView($applied_space_view) + { + $this->container['applied_space_view'] = $applied_space_view; + + return $this; + } + + + /** + * Gets available_from + * + * @return \DateTime + */ + public function getAvailableFrom() + { + return $this->container['available_from']; + } + + /** + * Sets available_from + * + * @param \DateTime $available_from The available from date defines the earliest date on which the payment link can be used. When no date is specified there will be no restriction. + * + * @return $this + */ + public function setAvailableFrom($available_from) + { + $this->container['available_from'] = $available_from; + + return $this; + } + + + /** + * Gets available_until + * + * @return \DateTime + */ + public function getAvailableUntil() + { + return $this->container['available_until']; + } + + /** + * Sets available_until + * + * @param \DateTime $available_until The available from date defines the latest date on which the payment link can be used to initialize a transaction. When no date is specified there will be no restriction. + * + * @return $this + */ + public function setAvailableUntil($available_until) + { + $this->container['available_until'] = $available_until; + + return $this; + } + + + /** + * Gets billing_address_required + * + * @return bool + */ + public function getBillingAddressRequired() + { + return $this->container['billing_address_required']; + } + + /** + * Sets billing_address_required + * + * @param bool $billing_address_required By making the billing address required the transaction can only be created when a billing address is provided within the request. + * + * @return $this + */ + public function setBillingAddressRequired($billing_address_required) + { + $this->container['billing_address_required'] = $billing_address_required; + + return $this; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The currency defines in which currency the payment is executed in. If no currency is defined it has to be specified within the request parameter 'currency'. + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language The language defines the language of the payment page. If no language is provided it can be provided through the request parameter. + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets line_items + * + * @return \Wallee\Sdk\Model\LineItemCreate[] + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Wallee\Sdk\Model\LineItemCreate[] $line_items The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters. + * + * @return $this + */ + public function setLineItems($line_items) + { + $this->container['line_items'] = $line_items; + + return $this; + } + + + /** + * Gets maximal_number_of_transactions + * + * @return int + */ + public function getMaximalNumberOfTransactions() + { + return $this->container['maximal_number_of_transactions']; + } + + /** + * Sets maximal_number_of_transactions + * + * @param int $maximal_number_of_transactions The maximal number of transactions limits the number of transactions which can be created with this payment link. + * + * @return $this + */ + public function setMaximalNumberOfTransactions($maximal_number_of_transactions) + { + $this->container['maximal_number_of_transactions'] = $maximal_number_of_transactions; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The payment link name is used internally to identify the payment link. For example the name is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets shipping_address_required + * + * @return bool + */ + public function getShippingAddressRequired() + { + return $this->container['shipping_address_required']; + } + + /** + * Sets shipping_address_required + * + * @param bool $shipping_address_required By making the shipping address required the transaction can only be created when a shipping address is provided within the request. + * + * @return $this + */ + public function setShippingAddressRequired($shipping_address_required) + { + $this->container['shipping_address_required'] = $shipping_address_required; + + 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/wallee-sdk/lib/Model/PaymentMethod.php b/wallee-sdk/lib/Model/PaymentMethod.php index 88f292a..e81dae2 100644 --- a/wallee-sdk/lib/Model/PaymentMethod.php +++ b/wallee-sdk/lib/Model/PaymentMethod.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\DataCollectionType[]', - 'description' => 'map[string,string]', - 'id' => 'int', - 'imagePath' => 'string', - 'merchantDescription' => 'map[string,string]', - 'name' => 'map[string,string]', - 'supportedCurrencies' => 'string[]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\DataCollectionType[] - */ - private $dataCollectionTypes; - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var string - */ - private $imagePath; - - /** - * - * - * @var map[string,string] - */ - private $merchantDescription; - - /** - * - * - * @var map[string,string] - */ - private $name; - - /** - * - * - * @var string[] - */ - private $supportedCurrencies; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['dataCollectionTypes'])) { - $this->setDataCollectionTypes($data['dataCollectionTypes']); - } - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['merchantDescription'])) { - $this->setMerchantDescription($data['merchantDescription']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['supportedCurrencies'])) { - $this->setSupportedCurrencies($data['supportedCurrencies']); - } - } - - - /** - * Returns dataCollectionTypes. - * - * - * - * @return \Wallee\Sdk\Model\DataCollectionType[] - */ - public function getDataCollectionTypes() { - return $this->dataCollectionTypes; - } - - /** - * Sets dataCollectionTypes. - * - * @param \Wallee\Sdk\Model\DataCollectionType[] $dataCollectionTypes - * @return PaymentMethod - */ - public function setDataCollectionTypes($dataCollectionTypes) { - $this->dataCollectionTypes = $dataCollectionTypes; - - return $this; - } - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return PaymentMethod - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return PaymentMethod - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns imagePath. - * - * - * - * @return string - */ - public function getImagePath() { - return $this->imagePath; - } - - /** - * Sets imagePath. - * - * @param string $imagePath - * @return PaymentMethod - */ - protected function setImagePath($imagePath) { - $this->imagePath = $imagePath; - - return $this; - } - - /** - * Returns merchantDescription. - * - * - * - * @return map[string,string] - */ - public function getMerchantDescription() { - return $this->merchantDescription; - } - - /** - * Sets merchantDescription. - * - * @param map[string,string] $merchantDescription - * @return PaymentMethod - */ - public function setMerchantDescription($merchantDescription) { - if (is_array($merchantDescription) && empty($merchantDescription)) { - $this->merchantDescription = new \stdClass; - } else { - $this->merchantDescription = $merchantDescription; - } - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return PaymentMethod - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Returns supportedCurrencies. - * - * - * - * @return string[] - */ - public function getSupportedCurrencies() { - return $this->supportedCurrencies; - } - - /** - * Sets supportedCurrencies. - * - * @param string[] $supportedCurrencies - * @return PaymentMethod - */ - public function setSupportedCurrencies($supportedCurrencies) { - $this->supportedCurrencies = $supportedCurrencies; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class PaymentMethod implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'PaymentMethod'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'data_collection_types' => '\Wallee\Sdk\Model\DataCollectionType[]', + 'description' => 'map[string,string]', + 'id' => 'int', + 'image_path' => 'string', + 'merchant_description' => 'map[string,string]', + 'name' => 'map[string,string]', + 'supported_currencies' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'data_collection_types' => null, + 'description' => null, + 'id' => 'int64', + 'image_path' => null, + 'merchant_description' => null, + 'name' => null, + 'supported_currencies' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data_collection_types' => 'dataCollectionTypes', + 'description' => 'description', + 'id' => 'id', + 'image_path' => 'imagePath', + 'merchant_description' => 'merchantDescription', + 'name' => 'name', + 'supported_currencies' => 'supportedCurrencies' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data_collection_types' => 'setDataCollectionTypes', + 'description' => 'setDescription', + 'id' => 'setId', + 'image_path' => 'setImagePath', + 'merchant_description' => 'setMerchantDescription', + 'name' => 'setName', + 'supported_currencies' => 'setSupportedCurrencies' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data_collection_types' => 'getDataCollectionTypes', + 'description' => 'getDescription', + 'id' => 'getId', + 'image_path' => 'getImagePath', + 'merchant_description' => 'getMerchantDescription', + 'name' => 'getName', + 'supported_currencies' => 'getSupportedCurrencies' + ]; + + + + /** + * 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['data_collection_types'] = isset($data['data_collection_types']) ? $data['data_collection_types'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['image_path'] = isset($data['image_path']) ? $data['image_path'] : null; + + $this->container['merchant_description'] = isset($data['merchant_description']) ? $data['merchant_description'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['supported_currencies'] = isset($data['supported_currencies']) ? $data['supported_currencies'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 data_collection_types + * + * @return \Wallee\Sdk\Model\DataCollectionType[] + */ + public function getDataCollectionTypes() + { + return $this->container['data_collection_types']; + } + + /** + * Sets data_collection_types + * + * @param \Wallee\Sdk\Model\DataCollectionType[] $data_collection_types + * + * @return $this + */ + public function setDataCollectionTypes($data_collection_types) + { + $this->container['data_collection_types'] = $data_collection_types; + + return $this; + } + + + /** + * Gets description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets image_path + * + * @return string + */ + public function getImagePath() + { + return $this->container['image_path']; + } + + /** + * Sets image_path + * + * @param string $image_path + * + * @return $this + */ + public function setImagePath($image_path) + { + $this->container['image_path'] = $image_path; + + return $this; + } + + + /** + * Gets merchant_description + * + * @return map[string,string] + */ + public function getMerchantDescription() + { + return $this->container['merchant_description']; + } + + /** + * Sets merchant_description + * + * @param map[string,string] $merchant_description + * + * @return $this + */ + public function setMerchantDescription($merchant_description) + { + $this->container['merchant_description'] = $merchant_description; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets supported_currencies + * + * @return string[] + */ + public function getSupportedCurrencies() + { + return $this->container['supported_currencies']; + } + + /** + * Sets supported_currencies + * + * @param string[] $supported_currencies + * + * @return $this + */ + public function setSupportedCurrencies($supported_currencies) + { + $this->container['supported_currencies'] = $supported_currencies; + + 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/wallee-sdk/lib/Model/PaymentMethodBrand.php b/wallee-sdk/lib/Model/PaymentMethodBrand.php index 5cf3006..8c1b998 100644 --- a/wallee-sdk/lib/Model/PaymentMethodBrand.php +++ b/wallee-sdk/lib/Model/PaymentMethodBrand.php @@ -1,10 +1,8 @@ 'map[string,string]', - 'grayImagePath' => 'string', - 'id' => 'int', - 'imagePath' => 'string', - 'name' => 'map[string,string]', - 'paymentMethod' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * - * - * @var string - */ - private $grayImagePath; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var string - */ - private $imagePath; - - /** - * - * - * @var map[string,string] - */ - private $name; - - /** - * - * - * @var int - */ - private $paymentMethod; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - } - - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return PaymentMethodBrand - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns grayImagePath. - * - * - * - * @return string - */ - public function getGrayImagePath() { - return $this->grayImagePath; - } - - /** - * Sets grayImagePath. - * - * @param string $grayImagePath - * @return PaymentMethodBrand - */ - protected function setGrayImagePath($grayImagePath) { - $this->grayImagePath = $grayImagePath; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return PaymentMethodBrand - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns imagePath. - * - * - * - * @return string - */ - public function getImagePath() { - return $this->imagePath; - } - - /** - * Sets imagePath. - * - * @param string $imagePath - * @return PaymentMethodBrand - */ - protected function setImagePath($imagePath) { - $this->imagePath = $imagePath; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return PaymentMethodBrand - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Returns paymentMethod. - * - * - * - * @return int - */ - public function getPaymentMethod() { - return $this->paymentMethod; - } - - /** - * Sets paymentMethod. - * - * @param int $paymentMethod - * @return PaymentMethodBrand - */ - protected function setPaymentMethod($paymentMethod) { - $this->paymentMethod = $paymentMethod; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class PaymentMethodBrand implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'PaymentMethodBrand'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'description' => 'map[string,string]', + 'gray_image_path' => 'string', + 'id' => 'int', + 'image_path' => 'string', + 'name' => 'map[string,string]', + 'payment_method' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'gray_image_path' => null, + 'id' => 'int64', + 'image_path' => null, + 'name' => null, + 'payment_method' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'gray_image_path' => 'grayImagePath', + 'id' => 'id', + 'image_path' => 'imagePath', + 'name' => 'name', + 'payment_method' => 'paymentMethod' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'gray_image_path' => 'setGrayImagePath', + 'id' => 'setId', + 'image_path' => 'setImagePath', + 'name' => 'setName', + 'payment_method' => 'setPaymentMethod' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'gray_image_path' => 'getGrayImagePath', + 'id' => 'getId', + 'image_path' => 'getImagePath', + 'name' => 'getName', + 'payment_method' => 'getPaymentMethod' + ]; + + + + /** + * 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['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['gray_image_path'] = isset($data['gray_image_path']) ? $data['gray_image_path'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['image_path'] = isset($data['image_path']) ? $data['image_path'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['payment_method'] = isset($data['payment_method']) ? $data['payment_method'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets gray_image_path + * + * @return string + */ + public function getGrayImagePath() + { + return $this->container['gray_image_path']; + } + + /** + * Sets gray_image_path + * + * @param string $gray_image_path + * + * @return $this + */ + public function setGrayImagePath($gray_image_path) + { + $this->container['gray_image_path'] = $gray_image_path; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets image_path + * + * @return string + */ + public function getImagePath() + { + return $this->container['image_path']; + } + + /** + * Sets image_path + * + * @param string $image_path + * + * @return $this + */ + public function setImagePath($image_path) + { + $this->container['image_path'] = $image_path; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets payment_method + * + * @return int + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param int $payment_method + * + * @return $this + */ + public function setPaymentMethod($payment_method) + { + $this->container['payment_method'] = $payment_method; + + 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/wallee-sdk/lib/Model/PaymentMethodConfiguration.php b/wallee-sdk/lib/Model/PaymentMethodConfiguration.php index a63dbe4..affb7fe 100644 --- a/wallee-sdk/lib/Model/PaymentMethodConfiguration.php +++ b/wallee-sdk/lib/Model/PaymentMethodConfiguration.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\DataCollectionType', - 'description' => '\Wallee\Sdk\Model\DatabaseTranslatedString', - 'id' => 'int', - 'imageResourcePath' => '\Wallee\Sdk\Model\ModelResourcePath', - 'linkedSpaceId' => 'int', - 'name' => 'string', - 'oneClickPaymentMode' => '\Wallee\Sdk\Model\OneClickPaymentMode', - 'paymentMethod' => 'int', - 'plannedPurgeDate' => '\DateTime', - 'resolvedDescription' => 'map[string,string]', - 'resolvedImageUrl' => 'string', - 'resolvedTitle' => 'map[string,string]', - 'sortOrder' => 'int', - 'spaceId' => 'int', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'title' => '\Wallee\Sdk\Model\DatabaseTranslatedString', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The data collection type determines who is collecting the payment information. This can be done either by the processor (offsite) or by our application (onsite). - * - * @var \Wallee\Sdk\Model\DataCollectionType - */ - private $dataCollectionType; - - /** - * The payment method configuration description can be used to show a text during the payment process. Choose an appropriate description as it will be displayed to your customer. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedString - */ - private $description; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The image of the payment method configuration overrides the default image of the payment method. - * - * @var \Wallee\Sdk\Model\ModelResourcePath - */ - private $imageResourcePath; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The payment method configuration name is used internally to identify the payment method configuration. For example the name is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * When the buyer is present on the payment page or within the iFrame the payment details can be stored automatically. The buyer will be able to use the stored payment details for subsequent transactions. When the transaction already contains a token one-click payments are disabled anyway - * - * @var \Wallee\Sdk\Model\OneClickPaymentMode - */ - private $oneClickPaymentMode; - - /** - * - * - * @var int - */ - private $paymentMethod; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * The resolved description uses the specified description or the default one when it is not overridden. - * - * @var map[string,string] - */ - private $resolvedDescription; - - /** - * The resolved URL of the image to use with this payment method. - * - * @var string - */ - private $resolvedImageUrl; - - /** - * The resolved title uses the specified title or the default one when it is not overridden. - * - * @var map[string,string] - */ - private $resolvedTitle; - - /** - * The sort order of the payment method determines the ordering of the methods shown to the user during the payment process. - * - * @var int - */ - private $sortOrder; - - /** - * - * - * @var int - */ - private $spaceId; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The title of the payment method configuration is used within the payment process. The title is visible to the customer. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedString - */ - private $title; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['dataCollectionType'])) { - $this->setDataCollectionType($data['dataCollectionType']); - } - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['imageResourcePath'])) { - $this->setImageResourcePath($data['imageResourcePath']); - } - if (isset($data['oneClickPaymentMode'])) { - $this->setOneClickPaymentMode($data['oneClickPaymentMode']); - } - if (isset($data['resolvedDescription'])) { - $this->setResolvedDescription($data['resolvedDescription']); - } - if (isset($data['resolvedTitle'])) { - $this->setResolvedTitle($data['resolvedTitle']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['title'])) { - $this->setTitle($data['title']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns dataCollectionType. - * - * The data collection type determines who is collecting the payment information. This can be done either by the processor (offsite) or by our application (onsite). - * - * @return \Wallee\Sdk\Model\DataCollectionType - */ - public function getDataCollectionType() { - return $this->dataCollectionType; - } - - /** - * Sets dataCollectionType. - * - * @param \Wallee\Sdk\Model\DataCollectionType $dataCollectionType - * @return PaymentMethodConfiguration - */ - public function setDataCollectionType($dataCollectionType) { - $this->dataCollectionType = $dataCollectionType; - - return $this; - } - - /** - * Returns description. - * - * The payment method configuration description can be used to show a text during the payment process. Choose an appropriate description as it will be displayed to your customer. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedString - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedString $description - * @return PaymentMethodConfiguration - */ - public function setDescription($description) { - $this->description = $description; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return PaymentMethodConfiguration - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns imageResourcePath. - * - * The image of the payment method configuration overrides the default image of the payment method. - * - * @return \Wallee\Sdk\Model\ModelResourcePath - */ - public function getImageResourcePath() { - return $this->imageResourcePath; - } - - /** - * Sets imageResourcePath. - * - * @param \Wallee\Sdk\Model\ModelResourcePath $imageResourcePath - * @return PaymentMethodConfiguration - */ - public function setImageResourcePath($imageResourcePath) { - $this->imageResourcePath = $imageResourcePath; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return PaymentMethodConfiguration - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * The payment method configuration name is used internally to identify the payment method configuration. For example the name is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return PaymentMethodConfiguration - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns oneClickPaymentMode. - * - * When the buyer is present on the payment page or within the iFrame the payment details can be stored automatically. The buyer will be able to use the stored payment details for subsequent transactions. When the transaction already contains a token one-click payments are disabled anyway - * - * @return \Wallee\Sdk\Model\OneClickPaymentMode - */ - public function getOneClickPaymentMode() { - return $this->oneClickPaymentMode; - } - - /** - * Sets oneClickPaymentMode. - * - * @param \Wallee\Sdk\Model\OneClickPaymentMode $oneClickPaymentMode - * @return PaymentMethodConfiguration - */ - public function setOneClickPaymentMode($oneClickPaymentMode) { - $this->oneClickPaymentMode = $oneClickPaymentMode; - - return $this; - } - - /** - * Returns paymentMethod. - * - * - * - * @return int - */ - public function getPaymentMethod() { - return $this->paymentMethod; - } - - /** - * Sets paymentMethod. - * - * @param int $paymentMethod - * @return PaymentMethodConfiguration - */ - protected function setPaymentMethod($paymentMethod) { - $this->paymentMethod = $paymentMethod; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return PaymentMethodConfiguration - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns resolvedDescription. - * - * The resolved description uses the specified description or the default one when it is not overridden. - * - * @return map[string,string] - */ - public function getResolvedDescription() { - return $this->resolvedDescription; - } - - /** - * Sets resolvedDescription. - * - * @param map[string,string] $resolvedDescription - * @return PaymentMethodConfiguration - */ - public function setResolvedDescription($resolvedDescription) { - if (is_array($resolvedDescription) && empty($resolvedDescription)) { - $this->resolvedDescription = new \stdClass; - } else { - $this->resolvedDescription = $resolvedDescription; - } - - return $this; - } - - /** - * Returns resolvedImageUrl. - * - * The resolved URL of the image to use with this payment method. - * - * @return string - */ - public function getResolvedImageUrl() { - return $this->resolvedImageUrl; - } - - /** - * Sets resolvedImageUrl. - * - * @param string $resolvedImageUrl - * @return PaymentMethodConfiguration - */ - protected function setResolvedImageUrl($resolvedImageUrl) { - $this->resolvedImageUrl = $resolvedImageUrl; - - return $this; - } - - /** - * Returns resolvedTitle. - * - * The resolved title uses the specified title or the default one when it is not overridden. - * - * @return map[string,string] - */ - public function getResolvedTitle() { - return $this->resolvedTitle; - } - - /** - * Sets resolvedTitle. - * - * @param map[string,string] $resolvedTitle - * @return PaymentMethodConfiguration - */ - public function setResolvedTitle($resolvedTitle) { - if (is_array($resolvedTitle) && empty($resolvedTitle)) { - $this->resolvedTitle = new \stdClass; - } else { - $this->resolvedTitle = $resolvedTitle; - } - - return $this; - } - - /** - * Returns sortOrder. - * - * The sort order of the payment method determines the ordering of the methods shown to the user during the payment process. - * - * @return int - */ - public function getSortOrder() { - return $this->sortOrder; - } - - /** - * Sets sortOrder. - * - * @param int $sortOrder - * @return PaymentMethodConfiguration - */ - protected function setSortOrder($sortOrder) { - $this->sortOrder = $sortOrder; - - return $this; - } - - /** - * Returns spaceId. - * - * - * - * @return int - */ - public function getSpaceId() { - return $this->spaceId; - } - - /** - * Sets spaceId. - * - * @param int $spaceId - * @return PaymentMethodConfiguration - */ - protected function setSpaceId($spaceId) { - $this->spaceId = $spaceId; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return PaymentMethodConfiguration - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns title. - * - * The title of the payment method configuration is used within the payment process. The title is visible to the customer. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedString - */ - public function getTitle() { - return $this->title; - } - - /** - * Sets title. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedString $title - * @return PaymentMethodConfiguration - */ - public function setTitle($title) { - $this->title = $title; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return PaymentMethodConfiguration - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class PaymentMethodConfiguration implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'PaymentMethodConfiguration'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'data_collection_type' => '\Wallee\Sdk\Model\DataCollectionType', + 'description' => '\Wallee\Sdk\Model\DatabaseTranslatedString', + 'id' => 'int', + 'image_resource_path' => '\Wallee\Sdk\Model\ModelResourcePath', + 'linked_space_id' => 'int', + 'name' => 'string', + 'one_click_payment_mode' => '\Wallee\Sdk\Model\OneClickPaymentMode', + 'payment_method' => 'int', + 'planned_purge_date' => '\DateTime', + 'resolved_description' => 'map[string,string]', + 'resolved_image_url' => 'string', + 'resolved_title' => 'map[string,string]', + 'sort_order' => 'int', + 'space_id' => 'int', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'title' => '\Wallee\Sdk\Model\DatabaseTranslatedString', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'data_collection_type' => null, + 'description' => null, + 'id' => 'int64', + 'image_resource_path' => null, + 'linked_space_id' => 'int64', + 'name' => null, + 'one_click_payment_mode' => null, + 'payment_method' => 'int64', + 'planned_purge_date' => 'date-time', + 'resolved_description' => null, + 'resolved_image_url' => null, + 'resolved_title' => null, + 'sort_order' => 'int32', + 'space_id' => 'int64', + 'state' => null, + 'title' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data_collection_type' => 'dataCollectionType', + 'description' => 'description', + 'id' => 'id', + 'image_resource_path' => 'imageResourcePath', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'one_click_payment_mode' => 'oneClickPaymentMode', + 'payment_method' => 'paymentMethod', + 'planned_purge_date' => 'plannedPurgeDate', + 'resolved_description' => 'resolvedDescription', + 'resolved_image_url' => 'resolvedImageUrl', + 'resolved_title' => 'resolvedTitle', + 'sort_order' => 'sortOrder', + 'space_id' => 'spaceId', + 'state' => 'state', + 'title' => 'title', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data_collection_type' => 'setDataCollectionType', + 'description' => 'setDescription', + 'id' => 'setId', + 'image_resource_path' => 'setImageResourcePath', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'one_click_payment_mode' => 'setOneClickPaymentMode', + 'payment_method' => 'setPaymentMethod', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'resolved_description' => 'setResolvedDescription', + 'resolved_image_url' => 'setResolvedImageUrl', + 'resolved_title' => 'setResolvedTitle', + 'sort_order' => 'setSortOrder', + 'space_id' => 'setSpaceId', + 'state' => 'setState', + 'title' => 'setTitle', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data_collection_type' => 'getDataCollectionType', + 'description' => 'getDescription', + 'id' => 'getId', + 'image_resource_path' => 'getImageResourcePath', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'one_click_payment_mode' => 'getOneClickPaymentMode', + 'payment_method' => 'getPaymentMethod', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'resolved_description' => 'getResolvedDescription', + 'resolved_image_url' => 'getResolvedImageUrl', + 'resolved_title' => 'getResolvedTitle', + 'sort_order' => 'getSortOrder', + 'space_id' => 'getSpaceId', + 'state' => 'getState', + 'title' => 'getTitle', + 'version' => 'getVersion' + ]; + + + + /** + * 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['data_collection_type'] = isset($data['data_collection_type']) ? $data['data_collection_type'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['image_resource_path'] = isset($data['image_resource_path']) ? $data['image_resource_path'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['one_click_payment_mode'] = isset($data['one_click_payment_mode']) ? $data['one_click_payment_mode'] : null; + + $this->container['payment_method'] = isset($data['payment_method']) ? $data['payment_method'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['resolved_description'] = isset($data['resolved_description']) ? $data['resolved_description'] : null; + + $this->container['resolved_image_url'] = isset($data['resolved_image_url']) ? $data['resolved_image_url'] : null; + + $this->container['resolved_title'] = isset($data['resolved_title']) ? $data['resolved_title'] : null; + + $this->container['sort_order'] = isset($data['sort_order']) ? $data['sort_order'] : null; + + $this->container['space_id'] = isset($data['space_id']) ? $data['space_id'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['title'] = isset($data['title']) ? $data['title'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 data_collection_type + * + * @return \Wallee\Sdk\Model\DataCollectionType + */ + public function getDataCollectionType() + { + return $this->container['data_collection_type']; + } + + /** + * Sets data_collection_type + * + * @param \Wallee\Sdk\Model\DataCollectionType $data_collection_type The data collection type determines who is collecting the payment information. This can be done either by the processor (offsite) or by our application (onsite). + * + * @return $this + */ + public function setDataCollectionType($data_collection_type) + { + $this->container['data_collection_type'] = $data_collection_type; + + return $this; + } + + + /** + * Gets description + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedString + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedString $description The payment method configuration description can be used to show a text during the payment process. Choose an appropriate description as it will be displayed to your customer. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets image_resource_path + * + * @return \Wallee\Sdk\Model\ModelResourcePath + */ + public function getImageResourcePath() + { + return $this->container['image_resource_path']; + } + + /** + * Sets image_resource_path + * + * @param \Wallee\Sdk\Model\ModelResourcePath $image_resource_path The image of the payment method configuration overrides the default image of the payment method. + * + * @return $this + */ + public function setImageResourcePath($image_resource_path) + { + $this->container['image_resource_path'] = $image_resource_path; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The payment method configuration name is used internally to identify the payment method configuration. For example the name is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets one_click_payment_mode + * + * @return \Wallee\Sdk\Model\OneClickPaymentMode + */ + public function getOneClickPaymentMode() + { + return $this->container['one_click_payment_mode']; + } + + /** + * Sets one_click_payment_mode + * + * @param \Wallee\Sdk\Model\OneClickPaymentMode $one_click_payment_mode When the buyer is present on the payment page or within the iFrame the payment details can be stored automatically. The buyer will be able to use the stored payment details for subsequent transactions. When the transaction already contains a token one-click payments are disabled anyway + * + * @return $this + */ + public function setOneClickPaymentMode($one_click_payment_mode) + { + $this->container['one_click_payment_mode'] = $one_click_payment_mode; + + return $this; + } + + + /** + * Gets payment_method + * + * @return int + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param int $payment_method + * + * @return $this + */ + public function setPaymentMethod($payment_method) + { + $this->container['payment_method'] = $payment_method; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets resolved_description + * + * @return map[string,string] + */ + public function getResolvedDescription() + { + return $this->container['resolved_description']; + } + + /** + * Sets resolved_description + * + * @param map[string,string] $resolved_description The resolved description uses the specified description or the default one when it is not overridden. + * + * @return $this + */ + public function setResolvedDescription($resolved_description) + { + $this->container['resolved_description'] = $resolved_description; + + return $this; + } + + + /** + * Gets resolved_image_url + * + * @return string + */ + public function getResolvedImageUrl() + { + return $this->container['resolved_image_url']; + } + + /** + * Sets resolved_image_url + * + * @param string $resolved_image_url The resolved URL of the image to use with this payment method. + * + * @return $this + */ + public function setResolvedImageUrl($resolved_image_url) + { + $this->container['resolved_image_url'] = $resolved_image_url; + + return $this; + } + + + /** + * Gets resolved_title + * + * @return map[string,string] + */ + public function getResolvedTitle() + { + return $this->container['resolved_title']; + } + + /** + * Sets resolved_title + * + * @param map[string,string] $resolved_title The resolved title uses the specified title or the default one when it is not overridden. + * + * @return $this + */ + public function setResolvedTitle($resolved_title) + { + $this->container['resolved_title'] = $resolved_title; + + return $this; + } + + + /** + * Gets sort_order + * + * @return int + */ + public function getSortOrder() + { + return $this->container['sort_order']; + } + + /** + * Sets sort_order + * + * @param int $sort_order The sort order of the payment method determines the ordering of the methods shown to the user during the payment process. + * + * @return $this + */ + public function setSortOrder($sort_order) + { + $this->container['sort_order'] = $sort_order; + + return $this; + } + + + /** + * Gets space_id + * + * @return int + */ + public function getSpaceId() + { + return $this->container['space_id']; + } + + /** + * Sets space_id + * + * @param int $space_id + * + * @return $this + */ + public function setSpaceId($space_id) + { + $this->container['space_id'] = $space_id; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets title + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedString + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedString $title The title of the payment method configuration is used within the payment process. The title is visible to the customer. + * + * @return $this + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/PaymentPrimaryRiskTaker.php b/wallee-sdk/lib/Model/PaymentPrimaryRiskTaker.php index 2ee4e56..7fa0ce1 100644 --- a/wallee-sdk/lib/Model/PaymentPrimaryRiskTaker.php +++ b/wallee-sdk/lib/Model/PaymentPrimaryRiskTaker.php @@ -1,10 +1,8 @@ 'map[string,string]', - 'description' => 'map[string,string]', - 'feature' => 'int', - 'headquartersLocation' => 'map[string,string]', - 'id' => 'int', - 'logoPath' => 'string', - 'name' => 'map[string,string]', - 'productName' => 'map[string,string]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var map[string,string] - */ - private $companyName; - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * - * - * @var int - */ - private $feature; - - /** - * - * - * @var map[string,string] - */ - private $headquartersLocation; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var string - */ - private $logoPath; - - /** - * - * - * @var map[string,string] - */ - private $name; - - /** - * - * - * @var map[string,string] - */ - private $productName; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['companyName'])) { - $this->setCompanyName($data['companyName']); - } - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['headquartersLocation'])) { - $this->setHeadquartersLocation($data['headquartersLocation']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['productName'])) { - $this->setProductName($data['productName']); - } - } - - - /** - * Returns companyName. - * - * - * - * @return map[string,string] - */ - public function getCompanyName() { - return $this->companyName; - } - - /** - * Sets companyName. - * - * @param map[string,string] $companyName - * @return PaymentProcessor - */ - public function setCompanyName($companyName) { - if (is_array($companyName) && empty($companyName)) { - $this->companyName = new \stdClass; - } else { - $this->companyName = $companyName; - } - - return $this; - } - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return PaymentProcessor - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns feature. - * - * - * - * @return int - */ - public function getFeature() { - return $this->feature; - } - - /** - * Sets feature. - * - * @param int $feature - * @return PaymentProcessor - */ - protected function setFeature($feature) { - $this->feature = $feature; - - return $this; - } - - /** - * Returns headquartersLocation. - * - * - * - * @return map[string,string] - */ - public function getHeadquartersLocation() { - return $this->headquartersLocation; - } - - /** - * Sets headquartersLocation. - * - * @param map[string,string] $headquartersLocation - * @return PaymentProcessor - */ - public function setHeadquartersLocation($headquartersLocation) { - if (is_array($headquartersLocation) && empty($headquartersLocation)) { - $this->headquartersLocation = new \stdClass; - } else { - $this->headquartersLocation = $headquartersLocation; - } - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return PaymentProcessor - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns logoPath. - * - * - * - * @return string - */ - public function getLogoPath() { - return $this->logoPath; - } - - /** - * Sets logoPath. - * - * @param string $logoPath - * @return PaymentProcessor - */ - protected function setLogoPath($logoPath) { - $this->logoPath = $logoPath; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return PaymentProcessor - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Returns productName. - * - * - * - * @return map[string,string] - */ - public function getProductName() { - return $this->productName; - } - - /** - * Sets productName. - * - * @param map[string,string] $productName - * @return PaymentProcessor - */ - public function setProductName($productName) { - if (is_array($productName) && empty($productName)) { - $this->productName = new \stdClass; - } else { - $this->productName = $productName; - } - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class PaymentProcessor implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'PaymentProcessor'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'company_name' => 'map[string,string]', + 'description' => 'map[string,string]', + 'feature' => 'int', + 'headquarters_location' => 'map[string,string]', + 'id' => 'int', + 'logo_path' => 'string', + 'name' => 'map[string,string]', + 'product_name' => 'map[string,string]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'company_name' => null, + 'description' => null, + 'feature' => 'int64', + 'headquarters_location' => null, + 'id' => 'int64', + 'logo_path' => null, + 'name' => null, + 'product_name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'company_name' => 'companyName', + 'description' => 'description', + 'feature' => 'feature', + 'headquarters_location' => 'headquartersLocation', + 'id' => 'id', + 'logo_path' => 'logoPath', + 'name' => 'name', + 'product_name' => 'productName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'company_name' => 'setCompanyName', + 'description' => 'setDescription', + 'feature' => 'setFeature', + 'headquarters_location' => 'setHeadquartersLocation', + 'id' => 'setId', + 'logo_path' => 'setLogoPath', + 'name' => 'setName', + 'product_name' => 'setProductName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'company_name' => 'getCompanyName', + 'description' => 'getDescription', + 'feature' => 'getFeature', + 'headquarters_location' => 'getHeadquartersLocation', + 'id' => 'getId', + 'logo_path' => 'getLogoPath', + 'name' => 'getName', + 'product_name' => 'getProductName' + ]; + + + + /** + * 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['company_name'] = isset($data['company_name']) ? $data['company_name'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['feature'] = isset($data['feature']) ? $data['feature'] : null; + + $this->container['headquarters_location'] = isset($data['headquarters_location']) ? $data['headquarters_location'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['logo_path'] = isset($data['logo_path']) ? $data['logo_path'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['product_name'] = isset($data['product_name']) ? $data['product_name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 company_name + * + * @return map[string,string] + */ + public function getCompanyName() + { + return $this->container['company_name']; + } + + /** + * Sets company_name + * + * @param map[string,string] $company_name + * + * @return $this + */ + public function setCompanyName($company_name) + { + $this->container['company_name'] = $company_name; + + return $this; + } + + + /** + * Gets description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets feature + * + * @return int + */ + public function getFeature() + { + return $this->container['feature']; + } + + /** + * Sets feature + * + * @param int $feature + * + * @return $this + */ + public function setFeature($feature) + { + $this->container['feature'] = $feature; + + return $this; + } + + + /** + * Gets headquarters_location + * + * @return map[string,string] + */ + public function getHeadquartersLocation() + { + return $this->container['headquarters_location']; + } + + /** + * Sets headquarters_location + * + * @param map[string,string] $headquarters_location + * + * @return $this + */ + public function setHeadquartersLocation($headquarters_location) + { + $this->container['headquarters_location'] = $headquarters_location; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets logo_path + * + * @return string + */ + public function getLogoPath() + { + return $this->container['logo_path']; + } + + /** + * Sets logo_path + * + * @param string $logo_path + * + * @return $this + */ + public function setLogoPath($logo_path) + { + $this->container['logo_path'] = $logo_path; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets product_name + * + * @return map[string,string] + */ + public function getProductName() + { + return $this->container['product_name']; + } + + /** + * Sets product_name + * + * @param map[string,string] $product_name + * + * @return $this + */ + public function setProductName($product_name) + { + $this->container['product_name'] = $product_name; + + 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/wallee-sdk/lib/Model/PaymentProcessorConfiguration.php b/wallee-sdk/lib/Model/PaymentProcessorConfiguration.php index ea54b28..89a389d 100644 --- a/wallee-sdk/lib/Model/PaymentProcessorConfiguration.php +++ b/wallee-sdk/lib/Model/PaymentProcessorConfiguration.php @@ -1,10 +1,8 @@ 'int', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'name' => 'string', - 'plannedPurgeDate' => '\DateTime', - 'processor' => 'int', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The contract links the processor configuration with the contract that is used to process payments. - * - * @var int - */ - private $contractId; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The processor configuration name is used internally to identify a specific processor configuration. For example the name is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * A processor handles the connection to a third part company (a Payment Service Provider) that technically manages the transaction and therefore processes the payment. For the same processor multiple processor configuration can be setup. - * - * @var int - */ - private $processor; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns contractId. - * - * The contract links the processor configuration with the contract that is used to process payments. - * - * @return int - */ - public function getContractId() { - return $this->contractId; - } - - /** - * Sets contractId. - * - * @param int $contractId - * @return PaymentProcessorConfiguration - */ - protected function setContractId($contractId) { - $this->contractId = $contractId; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return PaymentProcessorConfiguration - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return PaymentProcessorConfiguration - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * The processor configuration name is used internally to identify a specific processor configuration. For example the name is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return PaymentProcessorConfiguration - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return PaymentProcessorConfiguration - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns processor. - * - * A processor handles the connection to a third part company (a Payment Service Provider) that technically manages the transaction and therefore processes the payment. For the same processor multiple processor configuration can be setup. - * - * @return int - */ - public function getProcessor() { - return $this->processor; - } - - /** - * Sets processor. - * - * @param int $processor - * @return PaymentProcessorConfiguration - */ - protected function setProcessor($processor) { - $this->processor = $processor; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return PaymentProcessorConfiguration - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return PaymentProcessorConfiguration - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class PaymentProcessorConfiguration implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'PaymentProcessorConfiguration'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'contract_id' => 'int', + 'id' => 'int', + 'linked_space_id' => 'int', + 'name' => 'string', + 'planned_purge_date' => '\DateTime', + 'processor' => 'int', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'contract_id' => 'int64', + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'name' => null, + 'planned_purge_date' => 'date-time', + 'processor' => 'int64', + 'state' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'contract_id' => 'contractId', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'planned_purge_date' => 'plannedPurgeDate', + 'processor' => 'processor', + 'state' => 'state', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'contract_id' => 'setContractId', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'processor' => 'setProcessor', + 'state' => 'setState', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'contract_id' => 'getContractId', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'processor' => 'getProcessor', + 'state' => 'getState', + 'version' => 'getVersion' + ]; + + + + /** + * 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['contract_id'] = isset($data['contract_id']) ? $data['contract_id'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['processor'] = isset($data['processor']) ? $data['processor'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 contract_id + * + * @return int + */ + public function getContractId() + { + return $this->container['contract_id']; + } + + /** + * Sets contract_id + * + * @param int $contract_id The contract links the processor configuration with the contract that is used to process payments. + * + * @return $this + */ + public function setContractId($contract_id) + { + $this->container['contract_id'] = $contract_id; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The processor configuration name is used internally to identify a specific processor configuration. For example the name is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets processor + * + * @return int + */ + public function getProcessor() + { + return $this->container['processor']; + } + + /** + * Sets processor + * + * @param int $processor A processor handles the connection to a third part company (a Payment Service Provider) that technically manages the transaction and therefore processes the payment. For the same processor multiple processor configuration can be setup. + * + * @return $this + */ + public function setProcessor($processor) + { + $this->container['processor'] = $processor; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/PaymentTerminal.php b/wallee-sdk/lib/Model/PaymentTerminal.php new file mode 100644 index 0000000..255770b --- /dev/null +++ b/wallee-sdk/lib/Model/PaymentTerminal.php @@ -0,0 +1,618 @@ + '\Wallee\Sdk\Model\PaymentTerminalConfigurationVersion', + 'id' => 'int', + 'identifier' => 'string', + 'linked_space_id' => 'int', + 'location_version' => '\Wallee\Sdk\Model\PaymentTerminalLocationVersion', + 'name' => 'string', + 'planned_purge_date' => '\DateTime', + 'state' => '\Wallee\Sdk\Model\PaymentTerminalState', + 'terminal_device_id' => 'int', + 'type' => '\Wallee\Sdk\Model\PaymentTerminalType', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'configuration_version' => null, + 'id' => 'int64', + 'identifier' => null, + 'linked_space_id' => 'int64', + 'location_version' => null, + 'name' => null, + 'planned_purge_date' => 'date-time', + 'state' => null, + 'terminal_device_id' => 'int64', + 'type' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'configuration_version' => 'configurationVersion', + 'id' => 'id', + 'identifier' => 'identifier', + 'linked_space_id' => 'linkedSpaceId', + 'location_version' => 'locationVersion', + 'name' => 'name', + 'planned_purge_date' => 'plannedPurgeDate', + 'state' => 'state', + 'terminal_device_id' => 'terminalDeviceId', + 'type' => 'type', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'configuration_version' => 'setConfigurationVersion', + 'id' => 'setId', + 'identifier' => 'setIdentifier', + 'linked_space_id' => 'setLinkedSpaceId', + 'location_version' => 'setLocationVersion', + 'name' => 'setName', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'state' => 'setState', + 'terminal_device_id' => 'setTerminalDeviceId', + 'type' => 'setType', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'configuration_version' => 'getConfigurationVersion', + 'id' => 'getId', + 'identifier' => 'getIdentifier', + 'linked_space_id' => 'getLinkedSpaceId', + 'location_version' => 'getLocationVersion', + 'name' => 'getName', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'state' => 'getState', + 'terminal_device_id' => 'getTerminalDeviceId', + 'type' => 'getType', + 'version' => 'getVersion' + ]; + + + + /** + * 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['configuration_version'] = isset($data['configuration_version']) ? $data['configuration_version'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['identifier'] = isset($data['identifier']) ? $data['identifier'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['location_version'] = isset($data['location_version']) ? $data['location_version'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['terminal_device_id'] = isset($data['terminal_device_id']) ? $data['terminal_device_id'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 configuration_version + * + * @return \Wallee\Sdk\Model\PaymentTerminalConfigurationVersion + */ + public function getConfigurationVersion() + { + return $this->container['configuration_version']; + } + + /** + * Sets configuration_version + * + * @param \Wallee\Sdk\Model\PaymentTerminalConfigurationVersion $configuration_version + * + * @return $this + */ + public function setConfigurationVersion($configuration_version) + { + $this->container['configuration_version'] = $configuration_version; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets identifier + * + * @return string + */ + public function getIdentifier() + { + return $this->container['identifier']; + } + + /** + * Sets identifier + * + * @param string $identifier The identifier uniquely identifies the terminal. Normally it is visible on the device or in the display of the device. + * + * @return $this + */ + public function setIdentifier($identifier) + { + $this->container['identifier'] = $identifier; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets location_version + * + * @return \Wallee\Sdk\Model\PaymentTerminalLocationVersion + */ + public function getLocationVersion() + { + return $this->container['location_version']; + } + + /** + * Sets location_version + * + * @param \Wallee\Sdk\Model\PaymentTerminalLocationVersion $location_version + * + * @return $this + */ + public function setLocationVersion($location_version) + { + $this->container['location_version'] = $location_version; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The terminal name is used internally to identify the terminal in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\PaymentTerminalState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\PaymentTerminalState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets terminal_device_id + * + * @return int + */ + public function getTerminalDeviceId() + { + return $this->container['terminal_device_id']; + } + + /** + * Sets terminal_device_id + * + * @param int $terminal_device_id + * + * @return $this + */ + public function setTerminalDeviceId($terminal_device_id) + { + $this->container['terminal_device_id'] = $terminal_device_id; + + return $this; + } + + + /** + * Gets type + * + * @return \Wallee\Sdk\Model\PaymentTerminalType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Wallee\Sdk\Model\PaymentTerminalType $type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/PaymentTerminalAddress.php b/wallee-sdk/lib/Model/PaymentTerminalAddress.php new file mode 100644 index 0000000..2b4215e --- /dev/null +++ b/wallee-sdk/lib/Model/PaymentTerminalAddress.php @@ -0,0 +1,714 @@ + 'string', + 'country' => 'string', + 'dependent_locality' => 'string', + 'email_address' => 'string', + 'family_name' => 'string', + 'given_name' => 'string', + 'mobile_phone_number' => 'string', + 'organization_name' => 'string', + 'phone_number' => 'string', + 'post_code' => 'string', + 'postal_state' => 'string', + 'salutation' => 'string', + 'sorting_code' => 'string', + 'street' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'city' => null, + 'country' => null, + 'dependent_locality' => null, + 'email_address' => null, + 'family_name' => null, + 'given_name' => null, + 'mobile_phone_number' => null, + 'organization_name' => null, + 'phone_number' => null, + 'post_code' => null, + 'postal_state' => null, + 'salutation' => null, + 'sorting_code' => null, + 'street' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'country' => 'country', + 'dependent_locality' => 'dependentLocality', + 'email_address' => 'emailAddress', + 'family_name' => 'familyName', + 'given_name' => 'givenName', + 'mobile_phone_number' => 'mobilePhoneNumber', + 'organization_name' => 'organizationName', + 'phone_number' => 'phoneNumber', + 'post_code' => 'postCode', + 'postal_state' => 'postalState', + 'salutation' => 'salutation', + 'sorting_code' => 'sortingCode', + 'street' => 'street' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'country' => 'setCountry', + 'dependent_locality' => 'setDependentLocality', + 'email_address' => 'setEmailAddress', + 'family_name' => 'setFamilyName', + 'given_name' => 'setGivenName', + 'mobile_phone_number' => 'setMobilePhoneNumber', + 'organization_name' => 'setOrganizationName', + 'phone_number' => 'setPhoneNumber', + 'post_code' => 'setPostCode', + 'postal_state' => 'setPostalState', + 'salutation' => 'setSalutation', + 'sorting_code' => 'setSortingCode', + 'street' => 'setStreet' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'country' => 'getCountry', + 'dependent_locality' => 'getDependentLocality', + 'email_address' => 'getEmailAddress', + 'family_name' => 'getFamilyName', + 'given_name' => 'getGivenName', + 'mobile_phone_number' => 'getMobilePhoneNumber', + 'organization_name' => 'getOrganizationName', + 'phone_number' => 'getPhoneNumber', + 'post_code' => 'getPostCode', + 'postal_state' => 'getPostalState', + 'salutation' => 'getSalutation', + 'sorting_code' => 'getSortingCode', + 'street' => 'getStreet' + ]; + + + + /** + * 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['city'] = isset($data['city']) ? $data['city'] : null; + + $this->container['country'] = isset($data['country']) ? $data['country'] : null; + + $this->container['dependent_locality'] = isset($data['dependent_locality']) ? $data['dependent_locality'] : null; + + $this->container['email_address'] = isset($data['email_address']) ? $data['email_address'] : null; + + $this->container['family_name'] = isset($data['family_name']) ? $data['family_name'] : null; + + $this->container['given_name'] = isset($data['given_name']) ? $data['given_name'] : null; + + $this->container['mobile_phone_number'] = isset($data['mobile_phone_number']) ? $data['mobile_phone_number'] : null; + + $this->container['organization_name'] = isset($data['organization_name']) ? $data['organization_name'] : null; + + $this->container['phone_number'] = isset($data['phone_number']) ? $data['phone_number'] : null; + + $this->container['post_code'] = isset($data['post_code']) ? $data['post_code'] : null; + + $this->container['postal_state'] = isset($data['postal_state']) ? $data['postal_state'] : null; + + $this->container['salutation'] = isset($data['salutation']) ? $data['salutation'] : null; + + $this->container['sorting_code'] = isset($data['sorting_code']) ? $data['sorting_code'] : null; + + $this->container['street'] = isset($data['street']) ? $data['street'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 city + * + * @return string + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string $city + * + * @return $this + */ + public function setCity($city) + { + $this->container['city'] = $city; + + return $this; + } + + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country + * + * @return $this + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + + + /** + * Gets dependent_locality + * + * @return string + */ + public function getDependentLocality() + { + return $this->container['dependent_locality']; + } + + /** + * Sets dependent_locality + * + * @param string $dependent_locality + * + * @return $this + */ + public function setDependentLocality($dependent_locality) + { + $this->container['dependent_locality'] = $dependent_locality; + + return $this; + } + + + /** + * Gets email_address + * + * @return string + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string $email_address + * + * @return $this + */ + public function setEmailAddress($email_address) + { + $this->container['email_address'] = $email_address; + + return $this; + } + + + /** + * Gets family_name + * + * @return string + */ + public function getFamilyName() + { + return $this->container['family_name']; + } + + /** + * Sets family_name + * + * @param string $family_name + * + * @return $this + */ + public function setFamilyName($family_name) + { + $this->container['family_name'] = $family_name; + + return $this; + } + + + /** + * Gets given_name + * + * @return string + */ + public function getGivenName() + { + return $this->container['given_name']; + } + + /** + * Sets given_name + * + * @param string $given_name + * + * @return $this + */ + public function setGivenName($given_name) + { + $this->container['given_name'] = $given_name; + + return $this; + } + + + /** + * Gets mobile_phone_number + * + * @return string + */ + public function getMobilePhoneNumber() + { + return $this->container['mobile_phone_number']; + } + + /** + * Sets mobile_phone_number + * + * @param string $mobile_phone_number + * + * @return $this + */ + public function setMobilePhoneNumber($mobile_phone_number) + { + $this->container['mobile_phone_number'] = $mobile_phone_number; + + return $this; + } + + + /** + * Gets organization_name + * + * @return string + */ + public function getOrganizationName() + { + return $this->container['organization_name']; + } + + /** + * Sets organization_name + * + * @param string $organization_name + * + * @return $this + */ + public function setOrganizationName($organization_name) + { + $this->container['organization_name'] = $organization_name; + + return $this; + } + + + /** + * Gets phone_number + * + * @return string + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string $phone_number + * + * @return $this + */ + public function setPhoneNumber($phone_number) + { + $this->container['phone_number'] = $phone_number; + + return $this; + } + + + /** + * Gets post_code + * + * @return string + */ + public function getPostCode() + { + return $this->container['post_code']; + } + + /** + * Sets post_code + * + * @param string $post_code + * + * @return $this + */ + public function setPostCode($post_code) + { + $this->container['post_code'] = $post_code; + + return $this; + } + + + /** + * Gets postal_state + * + * @return string + */ + public function getPostalState() + { + return $this->container['postal_state']; + } + + /** + * Sets postal_state + * + * @param string $postal_state + * + * @return $this + */ + public function setPostalState($postal_state) + { + $this->container['postal_state'] = $postal_state; + + return $this; + } + + + /** + * Gets salutation + * + * @return string + */ + public function getSalutation() + { + return $this->container['salutation']; + } + + /** + * Sets salutation + * + * @param string $salutation + * + * @return $this + */ + public function setSalutation($salutation) + { + $this->container['salutation'] = $salutation; + + return $this; + } + + + /** + * Gets sorting_code + * + * @return string + */ + public function getSortingCode() + { + return $this->container['sorting_code']; + } + + /** + * Sets sorting_code + * + * @param string $sorting_code The sorting code identifies the post office at which the post box is located in. + * + * @return $this + */ + public function setSortingCode($sorting_code) + { + $this->container['sorting_code'] = $sorting_code; + + return $this; + } + + + /** + * Gets street + * + * @return string + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string $street + * + * @return $this + */ + public function setStreet($street) + { + $this->container['street'] = $street; + + 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/wallee-sdk/lib/Model/PaymentTerminalConfiguration.php b/wallee-sdk/lib/Model/PaymentTerminalConfiguration.php new file mode 100644 index 0000000..93a1fe2 --- /dev/null +++ b/wallee-sdk/lib/Model/PaymentTerminalConfiguration.php @@ -0,0 +1,490 @@ + 'int', + 'linked_space_id' => 'int', + 'name' => 'string', + 'planned_purge_date' => '\DateTime', + 'state' => '\Wallee\Sdk\Model\PaymentTerminalConfigurationState', + 'type' => '\Wallee\Sdk\Model\PaymentTerminalType', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'name' => null, + 'planned_purge_date' => 'date-time', + 'state' => null, + 'type' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'planned_purge_date' => 'plannedPurgeDate', + 'state' => 'state', + 'type' => 'type', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'state' => 'setState', + 'type' => 'setType', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'state' => 'getState', + 'type' => 'getType', + 'version' => 'getVersion' + ]; + + + + /** + * 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['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The terminal configuration name is used internally to identify the terminal in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\PaymentTerminalConfigurationState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\PaymentTerminalConfigurationState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets type + * + * @return \Wallee\Sdk\Model\PaymentTerminalType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Wallee\Sdk\Model\PaymentTerminalType $type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/PaymentTerminalConfigurationState.php b/wallee-sdk/lib/Model/PaymentTerminalConfigurationState.php new file mode 100644 index 0000000..3441926 --- /dev/null +++ b/wallee-sdk/lib/Model/PaymentTerminalConfigurationState.php @@ -0,0 +1,58 @@ + '\Wallee\Sdk\Model\PaymentTerminalConfiguration', + 'connector_configurations' => 'int[]', + 'created_by' => 'int', + 'created_on' => '\DateTime', + 'id' => 'int', + 'linked_space_id' => 'int', + 'maintenance_window_duration' => 'string', + 'maintenance_window_start' => 'string', + 'planned_purge_date' => '\DateTime', + 'state' => '\Wallee\Sdk\Model\PaymentTerminalConfigurationVersionState', + 'time_zone' => 'string', + 'version' => 'int', + 'version_applied_immediately' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'configuration' => null, + 'connector_configurations' => 'int64', + 'created_by' => 'int64', + 'created_on' => 'date-time', + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'maintenance_window_duration' => null, + 'maintenance_window_start' => null, + 'planned_purge_date' => 'date-time', + 'state' => null, + 'time_zone' => null, + 'version' => 'int32', + 'version_applied_immediately' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'configuration' => 'configuration', + 'connector_configurations' => 'connectorConfigurations', + 'created_by' => 'createdBy', + 'created_on' => 'createdOn', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'maintenance_window_duration' => 'maintenanceWindowDuration', + 'maintenance_window_start' => 'maintenanceWindowStart', + 'planned_purge_date' => 'plannedPurgeDate', + 'state' => 'state', + 'time_zone' => 'timeZone', + 'version' => 'version', + 'version_applied_immediately' => 'versionAppliedImmediately' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'configuration' => 'setConfiguration', + 'connector_configurations' => 'setConnectorConfigurations', + 'created_by' => 'setCreatedBy', + 'created_on' => 'setCreatedOn', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'maintenance_window_duration' => 'setMaintenanceWindowDuration', + 'maintenance_window_start' => 'setMaintenanceWindowStart', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'state' => 'setState', + 'time_zone' => 'setTimeZone', + 'version' => 'setVersion', + 'version_applied_immediately' => 'setVersionAppliedImmediately' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'configuration' => 'getConfiguration', + 'connector_configurations' => 'getConnectorConfigurations', + 'created_by' => 'getCreatedBy', + 'created_on' => 'getCreatedOn', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'maintenance_window_duration' => 'getMaintenanceWindowDuration', + 'maintenance_window_start' => 'getMaintenanceWindowStart', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'state' => 'getState', + 'time_zone' => 'getTimeZone', + 'version' => 'getVersion', + 'version_applied_immediately' => 'getVersionAppliedImmediately' + ]; + + + + /** + * 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['configuration'] = isset($data['configuration']) ? $data['configuration'] : null; + + $this->container['connector_configurations'] = isset($data['connector_configurations']) ? $data['connector_configurations'] : null; + + $this->container['created_by'] = isset($data['created_by']) ? $data['created_by'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['maintenance_window_duration'] = isset($data['maintenance_window_duration']) ? $data['maintenance_window_duration'] : null; + + $this->container['maintenance_window_start'] = isset($data['maintenance_window_start']) ? $data['maintenance_window_start'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['time_zone'] = isset($data['time_zone']) ? $data['time_zone'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + $this->container['version_applied_immediately'] = isset($data['version_applied_immediately']) ? $data['version_applied_immediately'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 configuration + * + * @return \Wallee\Sdk\Model\PaymentTerminalConfiguration + */ + public function getConfiguration() + { + return $this->container['configuration']; + } + + /** + * Sets configuration + * + * @param \Wallee\Sdk\Model\PaymentTerminalConfiguration $configuration + * + * @return $this + */ + public function setConfiguration($configuration) + { + $this->container['configuration'] = $configuration; + + return $this; + } + + + /** + * Gets connector_configurations + * + * @return int[] + */ + public function getConnectorConfigurations() + { + return $this->container['connector_configurations']; + } + + /** + * Sets connector_configurations + * + * @param int[] $connector_configurations + * + * @return $this + */ + public function setConnectorConfigurations($connector_configurations) + { + $this->container['connector_configurations'] = $connector_configurations; + + return $this; + } + + + /** + * Gets created_by + * + * @return int + */ + public function getCreatedBy() + { + return $this->container['created_by']; + } + + /** + * Sets created_by + * + * @param int $created_by + * + * @return $this + */ + public function setCreatedBy($created_by) + { + $this->container['created_by'] = $created_by; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets maintenance_window_duration + * + * @return string + */ + public function getMaintenanceWindowDuration() + { + return $this->container['maintenance_window_duration']; + } + + /** + * Sets maintenance_window_duration + * + * @param string $maintenance_window_duration + * + * @return $this + */ + public function setMaintenanceWindowDuration($maintenance_window_duration) + { + $this->container['maintenance_window_duration'] = $maintenance_window_duration; + + return $this; + } + + + /** + * Gets maintenance_window_start + * + * @return string + */ + public function getMaintenanceWindowStart() + { + return $this->container['maintenance_window_start']; + } + + /** + * Sets maintenance_window_start + * + * @param string $maintenance_window_start + * + * @return $this + */ + public function setMaintenanceWindowStart($maintenance_window_start) + { + $this->container['maintenance_window_start'] = $maintenance_window_start; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\PaymentTerminalConfigurationVersionState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\PaymentTerminalConfigurationVersionState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets time_zone + * + * @return string + */ + public function getTimeZone() + { + return $this->container['time_zone']; + } + + /** + * Sets time_zone + * + * @param string $time_zone + * + * @return $this + */ + public function setTimeZone($time_zone) + { + $this->container['time_zone'] = $time_zone; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + + /** + * Gets version_applied_immediately + * + * @return bool + */ + public function getVersionAppliedImmediately() + { + return $this->container['version_applied_immediately']; + } + + /** + * Sets version_applied_immediately + * + * @param bool $version_applied_immediately + * + * @return $this + */ + public function setVersionAppliedImmediately($version_applied_immediately) + { + $this->container['version_applied_immediately'] = $version_applied_immediately; + + 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/wallee-sdk/lib/Model/PaymentTerminalConfigurationVersionState.php b/wallee-sdk/lib/Model/PaymentTerminalConfigurationVersionState.php new file mode 100644 index 0000000..df05e18 --- /dev/null +++ b/wallee-sdk/lib/Model/PaymentTerminalConfigurationVersionState.php @@ -0,0 +1,60 @@ + '\Wallee\Sdk\Model\Account', + 'created_on' => '\DateTime', + 'id' => 'int', + 'model' => '\Wallee\Sdk\Model\PaymentTerminalDeviceModel', + 'name' => 'string', + 'serial_number' => 'string', + 'state' => '\Wallee\Sdk\Model\PaymentTerminalDeviceState', + 'terminal' => '\Wallee\Sdk\Model\PaymentTerminalReference', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'account' => null, + 'created_on' => 'date-time', + 'id' => 'int64', + 'model' => null, + 'name' => null, + 'serial_number' => null, + 'state' => null, + 'terminal' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account' => 'account', + 'created_on' => 'createdOn', + 'id' => 'id', + 'model' => 'model', + 'name' => 'name', + 'serial_number' => 'serialNumber', + 'state' => 'state', + 'terminal' => 'terminal', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account' => 'setAccount', + 'created_on' => 'setCreatedOn', + 'id' => 'setId', + 'model' => 'setModel', + 'name' => 'setName', + 'serial_number' => 'setSerialNumber', + 'state' => 'setState', + 'terminal' => 'setTerminal', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account' => 'getAccount', + 'created_on' => 'getCreatedOn', + 'id' => 'getId', + 'model' => 'getModel', + 'name' => 'getName', + 'serial_number' => 'getSerialNumber', + 'state' => 'getState', + 'terminal' => 'getTerminal', + 'version' => 'getVersion' + ]; + + + + /** + * 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['account'] = isset($data['account']) ? $data['account'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['model'] = isset($data['model']) ? $data['model'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['serial_number'] = isset($data['serial_number']) ? $data['serial_number'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['terminal'] = isset($data['terminal']) ? $data['terminal'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 account + * + * @return \Wallee\Sdk\Model\Account + */ + public function getAccount() + { + return $this->container['account']; + } + + /** + * Sets account + * + * @param \Wallee\Sdk\Model\Account $account + * + * @return $this + */ + public function setAccount($account) + { + $this->container['account'] = $account; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets model + * + * @return \Wallee\Sdk\Model\PaymentTerminalDeviceModel + */ + public function getModel() + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \Wallee\Sdk\Model\PaymentTerminalDeviceModel $model + * + * @return $this + */ + public function setModel($model) + { + $this->container['model'] = $model; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets serial_number + * + * @return string + */ + public function getSerialNumber() + { + return $this->container['serial_number']; + } + + /** + * Sets serial_number + * + * @param string $serial_number + * + * @return $this + */ + public function setSerialNumber($serial_number) + { + $this->container['serial_number'] = $serial_number; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\PaymentTerminalDeviceState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\PaymentTerminalDeviceState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets terminal + * + * @return \Wallee\Sdk\Model\PaymentTerminalReference + */ + public function getTerminal() + { + return $this->container['terminal']; + } + + /** + * Sets terminal + * + * @param \Wallee\Sdk\Model\PaymentTerminalReference $terminal + * + * @return $this + */ + public function setTerminal($terminal) + { + $this->container['terminal'] = $terminal; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/PaymentTerminalDeviceManufacturer.php b/wallee-sdk/lib/Model/PaymentTerminalDeviceManufacturer.php new file mode 100644 index 0000000..f0f98b9 --- /dev/null +++ b/wallee-sdk/lib/Model/PaymentTerminalDeviceManufacturer.php @@ -0,0 +1,490 @@ + 'int', + 'name' => 'string', + 'planned_purge_date' => '\DateTime', + 'scope' => '\Wallee\Sdk\Model\Scope', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'title' => '\Wallee\Sdk\Model\DatabaseTranslatedString', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'name' => null, + 'planned_purge_date' => 'date-time', + 'scope' => null, + 'state' => null, + 'title' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'planned_purge_date' => 'plannedPurgeDate', + 'scope' => 'scope', + 'state' => 'state', + 'title' => 'title', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'scope' => 'setScope', + 'state' => 'setState', + 'title' => 'setTitle', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'scope' => 'getScope', + 'state' => 'getState', + 'title' => 'getTitle', + 'version' => 'getVersion' + ]; + + + + /** + * 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['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['scope'] = isset($data['scope']) ? $data['scope'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['title'] = isset($data['title']) ? $data['title'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets scope + * + * @return \Wallee\Sdk\Model\Scope + */ + public function getScope() + { + return $this->container['scope']; + } + + /** + * Sets scope + * + * @param \Wallee\Sdk\Model\Scope $scope + * + * @return $this + */ + public function setScope($scope) + { + $this->container['scope'] = $scope; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets title + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedString + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedString $title + * + * @return $this + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/PaymentTerminalDeviceModel.php b/wallee-sdk/lib/Model/PaymentTerminalDeviceModel.php new file mode 100644 index 0000000..40ebb3b --- /dev/null +++ b/wallee-sdk/lib/Model/PaymentTerminalDeviceModel.php @@ -0,0 +1,650 @@ + '\Wallee\Sdk\Model\DatabaseTranslatedString', + 'id' => 'int', + 'image' => 'string[]', + 'image_type' => 'string', + 'manufacturer' => '\Wallee\Sdk\Model\PaymentTerminalDeviceManufacturer', + 'model_id' => 'string', + 'name' => 'string', + 'planned_purge_date' => '\DateTime', + 'scope' => '\Wallee\Sdk\Model\Scope', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'title' => '\Wallee\Sdk\Model\DatabaseTranslatedString', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'id' => 'int64', + 'image' => 'byte', + 'image_type' => null, + 'manufacturer' => null, + 'model_id' => null, + 'name' => null, + 'planned_purge_date' => 'date-time', + 'scope' => null, + 'state' => null, + 'title' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'id' => 'id', + 'image' => 'image', + 'image_type' => 'imageType', + 'manufacturer' => 'manufacturer', + 'model_id' => 'modelId', + 'name' => 'name', + 'planned_purge_date' => 'plannedPurgeDate', + 'scope' => 'scope', + 'state' => 'state', + 'title' => 'title', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'image' => 'setImage', + 'image_type' => 'setImageType', + 'manufacturer' => 'setManufacturer', + 'model_id' => 'setModelId', + 'name' => 'setName', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'scope' => 'setScope', + 'state' => 'setState', + 'title' => 'setTitle', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'image' => 'getImage', + 'image_type' => 'getImageType', + 'manufacturer' => 'getManufacturer', + 'model_id' => 'getModelId', + 'name' => 'getName', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'scope' => 'getScope', + 'state' => 'getState', + 'title' => 'getTitle', + 'version' => 'getVersion' + ]; + + + + /** + * 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['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['image'] = isset($data['image']) ? $data['image'] : null; + + $this->container['image_type'] = isset($data['image_type']) ? $data['image_type'] : null; + + $this->container['manufacturer'] = isset($data['manufacturer']) ? $data['manufacturer'] : null; + + $this->container['model_id'] = isset($data['model_id']) ? $data['model_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['scope'] = isset($data['scope']) ? $data['scope'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['title'] = isset($data['title']) ? $data['title'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 description + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedString + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedString $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets image + * + * @return string[] + */ + public function getImage() + { + return $this->container['image']; + } + + /** + * Sets image + * + * @param string[] $image + * + * @return $this + */ + public function setImage($image) + { + $this->container['image'] = $image; + + return $this; + } + + + /** + * Gets image_type + * + * @return string + */ + public function getImageType() + { + return $this->container['image_type']; + } + + /** + * Sets image_type + * + * @param string $image_type + * + * @return $this + */ + public function setImageType($image_type) + { + $this->container['image_type'] = $image_type; + + return $this; + } + + + /** + * Gets manufacturer + * + * @return \Wallee\Sdk\Model\PaymentTerminalDeviceManufacturer + */ + public function getManufacturer() + { + return $this->container['manufacturer']; + } + + /** + * Sets manufacturer + * + * @param \Wallee\Sdk\Model\PaymentTerminalDeviceManufacturer $manufacturer + * + * @return $this + */ + public function setManufacturer($manufacturer) + { + $this->container['manufacturer'] = $manufacturer; + + return $this; + } + + + /** + * Gets model_id + * + * @return string + */ + public function getModelId() + { + return $this->container['model_id']; + } + + /** + * Sets model_id + * + * @param string $model_id The model identifier of the device. The model identifier can be a number (e.g. a part number) or a name of the device model. + * + * @return $this + */ + public function setModelId($model_id) + { + $this->container['model_id'] = $model_id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets scope + * + * @return \Wallee\Sdk\Model\Scope + */ + public function getScope() + { + return $this->container['scope']; + } + + /** + * Sets scope + * + * @param \Wallee\Sdk\Model\Scope $scope + * + * @return $this + */ + public function setScope($scope) + { + $this->container['scope'] = $scope; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets title + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedString + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedString $title + * + * @return $this + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/PaymentTerminalDeviceState.php b/wallee-sdk/lib/Model/PaymentTerminalDeviceState.php new file mode 100644 index 0000000..9bcd7b9 --- /dev/null +++ b/wallee-sdk/lib/Model/PaymentTerminalDeviceState.php @@ -0,0 +1,60 @@ + '\Wallee\Sdk\Model\PaymentTerminalConfiguration', + 'delivery_address' => '\Wallee\Sdk\Model\PaymentTerminalAddress', + 'id' => 'int', + 'linked_space_id' => 'int', + 'name' => 'string', + 'planned_purge_date' => '\DateTime', + 'state' => '\Wallee\Sdk\Model\PaymentTerminalLocationState', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'default_configuration' => null, + 'delivery_address' => null, + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'name' => null, + 'planned_purge_date' => 'date-time', + 'state' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'default_configuration' => 'defaultConfiguration', + 'delivery_address' => 'deliveryAddress', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'planned_purge_date' => 'plannedPurgeDate', + 'state' => 'state', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'default_configuration' => 'setDefaultConfiguration', + 'delivery_address' => 'setDeliveryAddress', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'state' => 'setState', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'default_configuration' => 'getDefaultConfiguration', + 'delivery_address' => 'getDeliveryAddress', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'state' => 'getState', + 'version' => 'getVersion' + ]; + + + + /** + * 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['default_configuration'] = isset($data['default_configuration']) ? $data['default_configuration'] : null; + + $this->container['delivery_address'] = isset($data['delivery_address']) ? $data['delivery_address'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 default_configuration + * + * @return \Wallee\Sdk\Model\PaymentTerminalConfiguration + */ + public function getDefaultConfiguration() + { + return $this->container['default_configuration']; + } + + /** + * Sets default_configuration + * + * @param \Wallee\Sdk\Model\PaymentTerminalConfiguration $default_configuration + * + * @return $this + */ + public function setDefaultConfiguration($default_configuration) + { + $this->container['default_configuration'] = $default_configuration; + + return $this; + } + + + /** + * Gets delivery_address + * + * @return \Wallee\Sdk\Model\PaymentTerminalAddress + */ + public function getDeliveryAddress() + { + return $this->container['delivery_address']; + } + + /** + * Sets delivery_address + * + * @param \Wallee\Sdk\Model\PaymentTerminalAddress $delivery_address + * + * @return $this + */ + public function setDeliveryAddress($delivery_address) + { + $this->container['delivery_address'] = $delivery_address; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The terminal location name is used internally to identify the terminal in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\PaymentTerminalLocationState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\PaymentTerminalLocationState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/PaymentTerminalLocationState.php b/wallee-sdk/lib/Model/PaymentTerminalLocationState.php new file mode 100644 index 0000000..cb340ae --- /dev/null +++ b/wallee-sdk/lib/Model/PaymentTerminalLocationState.php @@ -0,0 +1,58 @@ + '\Wallee\Sdk\Model\PaymentTerminalAddress', + 'created_by' => 'int', + 'created_on' => '\DateTime', + 'id' => 'int', + 'linked_space_id' => 'int', + 'location' => '\Wallee\Sdk\Model\PaymentTerminalLocation', + 'planned_purge_date' => '\DateTime', + 'state' => '\Wallee\Sdk\Model\PaymentTerminalLocationVersionState', + 'version' => 'int', + 'version_applied_immediately' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'address' => null, + 'created_by' => 'int64', + 'created_on' => 'date-time', + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'location' => null, + 'planned_purge_date' => 'date-time', + 'state' => null, + 'version' => 'int32', + 'version_applied_immediately' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'created_by' => 'createdBy', + 'created_on' => 'createdOn', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'location' => 'location', + 'planned_purge_date' => 'plannedPurgeDate', + 'state' => 'state', + 'version' => 'version', + 'version_applied_immediately' => 'versionAppliedImmediately' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'created_by' => 'setCreatedBy', + 'created_on' => 'setCreatedOn', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'location' => 'setLocation', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'state' => 'setState', + 'version' => 'setVersion', + 'version_applied_immediately' => 'setVersionAppliedImmediately' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'created_by' => 'getCreatedBy', + 'created_on' => 'getCreatedOn', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'location' => 'getLocation', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'state' => 'getState', + 'version' => 'getVersion', + 'version_applied_immediately' => 'getVersionAppliedImmediately' + ]; + + + + /** + * 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['address'] = isset($data['address']) ? $data['address'] : null; + + $this->container['created_by'] = isset($data['created_by']) ? $data['created_by'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['location'] = isset($data['location']) ? $data['location'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + $this->container['version_applied_immediately'] = isset($data['version_applied_immediately']) ? $data['version_applied_immediately'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets address + * + * @return \Wallee\Sdk\Model\PaymentTerminalAddress + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Wallee\Sdk\Model\PaymentTerminalAddress $address + * + * @return $this + */ + public function setAddress($address) + { + $this->container['address'] = $address; + + return $this; + } + + + /** + * Gets created_by + * + * @return int + */ + public function getCreatedBy() + { + return $this->container['created_by']; + } + + /** + * Sets created_by + * + * @param int $created_by + * + * @return $this + */ + public function setCreatedBy($created_by) + { + $this->container['created_by'] = $created_by; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets location + * + * @return \Wallee\Sdk\Model\PaymentTerminalLocation + */ + public function getLocation() + { + return $this->container['location']; + } + + /** + * Sets location + * + * @param \Wallee\Sdk\Model\PaymentTerminalLocation $location + * + * @return $this + */ + public function setLocation($location) + { + $this->container['location'] = $location; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\PaymentTerminalLocationVersionState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\PaymentTerminalLocationVersionState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + + /** + * Gets version_applied_immediately + * + * @return bool + */ + public function getVersionAppliedImmediately() + { + return $this->container['version_applied_immediately']; + } + + /** + * Sets version_applied_immediately + * + * @param bool $version_applied_immediately + * + * @return $this + */ + public function setVersionAppliedImmediately($version_applied_immediately) + { + $this->container['version_applied_immediately'] = $version_applied_immediately; + + 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/wallee-sdk/lib/Model/PaymentTerminalLocationVersionState.php b/wallee-sdk/lib/Model/PaymentTerminalLocationVersionState.php new file mode 100644 index 0000000..e740fe8 --- /dev/null +++ b/wallee-sdk/lib/Model/PaymentTerminalLocationVersionState.php @@ -0,0 +1,60 @@ + '\DateTime', + 'id' => 'int', + 'linked_space_id' => 'int', + 'planned_purge_date' => '\DateTime', + 'space' => '\Wallee\Sdk\Model\Space', + 'state' => '\Wallee\Sdk\Model\PaymentTerminalState', + 'terminal_id' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'created_on' => 'date-time', + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'planned_purge_date' => 'date-time', + 'space' => null, + 'state' => null, + 'terminal_id' => 'int64', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'created_on' => 'createdOn', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'planned_purge_date' => 'plannedPurgeDate', + 'space' => 'space', + 'state' => 'state', + 'terminal_id' => 'terminalId', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'created_on' => 'setCreatedOn', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'space' => 'setSpace', + 'state' => 'setState', + 'terminal_id' => 'setTerminalId', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'created_on' => 'getCreatedOn', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'space' => 'getSpace', + 'state' => 'getState', + 'terminal_id' => 'getTerminalId', + 'version' => 'getVersion' + ]; + + + + /** + * 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['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['space'] = isset($data['space']) ? $data['space'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['terminal_id'] = isset($data['terminal_id']) ? $data['terminal_id'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets space + * + * @return \Wallee\Sdk\Model\Space + */ + public function getSpace() + { + return $this->container['space']; + } + + /** + * Sets space + * + * @param \Wallee\Sdk\Model\Space $space + * + * @return $this + */ + public function setSpace($space) + { + $this->container['space'] = $space; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\PaymentTerminalState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\PaymentTerminalState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets terminal_id + * + * @return int + */ + public function getTerminalId() + { + return $this->container['terminal_id']; + } + + /** + * Sets terminal_id + * + * @param int $terminal_id + * + * @return $this + */ + public function setTerminalId($terminal_id) + { + $this->container['terminal_id'] = $terminal_id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/PaymentTerminalState.php b/wallee-sdk/lib/Model/PaymentTerminalState.php new file mode 100644 index 0000000..d23fcb0 --- /dev/null +++ b/wallee-sdk/lib/Model/PaymentTerminalState.php @@ -0,0 +1,60 @@ + 'map[string,string]', + 'id' => 'int', + 'name' => 'map[string,string]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'id' => 'int64', + 'name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'name' => 'getName' + ]; + + + + /** + * 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['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + 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/wallee-sdk/lib/Model/Permission.php b/wallee-sdk/lib/Model/Permission.php index 3cc99cf..745b841 100644 --- a/wallee-sdk/lib/Model/Permission.php +++ b/wallee-sdk/lib/Model/Permission.php @@ -1,10 +1,8 @@ 'map[string,string]', - 'feature' => 'int', - 'group' => 'bool', - 'id' => 'int', - 'leaf' => 'bool', - 'name' => 'map[string,string]', - 'parent' => 'int', - 'pathToRoot' => 'int[]', - 'title' => 'map[string,string]', - 'twoFactorRequired' => 'bool' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * - * - * @var int - */ - private $feature; - - /** - * - * - * @var bool - */ - private $group; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var bool - */ - private $leaf; - - /** - * - * - * @var map[string,string] - */ - private $name; - - /** - * - * - * @var int - */ - private $parent; - - /** - * - * - * @var int[] - */ - private $pathToRoot; - - /** - * - * - * @var map[string,string] - */ - private $title; - - /** - * - * - * @var bool - */ - private $twoFactorRequired; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['pathToRoot'])) { - $this->setPathToRoot($data['pathToRoot']); - } - if (isset($data['title'])) { - $this->setTitle($data['title']); - } - } - - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return Permission - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns feature. - * - * - * - * @return int - */ - public function getFeature() { - return $this->feature; - } - - /** - * Sets feature. - * - * @param int $feature - * @return Permission - */ - protected function setFeature($feature) { - $this->feature = $feature; - - return $this; - } - - /** - * Returns group. - * - * - * - * @return bool - */ - public function getGroup() { - return $this->group; - } - - /** - * Sets group. - * - * @param bool $group - * @return Permission - */ - protected function setGroup($group) { - $this->group = $group; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return Permission - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns leaf. - * - * - * - * @return bool - */ - public function getLeaf() { - return $this->leaf; - } - - /** - * Sets leaf. - * - * @param bool $leaf - * @return Permission - */ - protected function setLeaf($leaf) { - $this->leaf = $leaf; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return Permission - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Returns parent. - * - * - * - * @return int - */ - public function getParent() { - return $this->parent; - } - - /** - * Sets parent. - * - * @param int $parent - * @return Permission - */ - protected function setParent($parent) { - $this->parent = $parent; - - return $this; - } - - /** - * Returns pathToRoot. - * - * - * - * @return int[] - */ - public function getPathToRoot() { - return $this->pathToRoot; - } - - /** - * Sets pathToRoot. - * - * @param int[] $pathToRoot - * @return Permission - */ - public function setPathToRoot($pathToRoot) { - $this->pathToRoot = $pathToRoot; - - return $this; - } - - /** - * Returns title. - * - * - * - * @return map[string,string] - */ - public function getTitle() { - return $this->title; - } - - /** - * Sets title. - * - * @param map[string,string] $title - * @return Permission - */ - public function setTitle($title) { - if (is_array($title) && empty($title)) { - $this->title = new \stdClass; - } else { - $this->title = $title; - } - - return $this; - } - - /** - * Returns twoFactorRequired. - * - * - * - * @return bool - */ - public function getTwoFactorRequired() { - return $this->twoFactorRequired; - } - - /** - * Sets twoFactorRequired. - * - * @param bool $twoFactorRequired - * @return Permission - */ - protected function setTwoFactorRequired($twoFactorRequired) { - $this->twoFactorRequired = $twoFactorRequired; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class Permission implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Permission'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'description' => 'map[string,string]', + 'feature' => 'int', + 'group' => 'bool', + 'id' => 'int', + 'leaf' => 'bool', + 'name' => 'map[string,string]', + 'parent' => 'int', + 'path_to_root' => 'int[]', + 'title' => 'map[string,string]', + 'two_factor_required' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'feature' => 'int64', + 'group' => null, + 'id' => 'int64', + 'leaf' => null, + 'name' => null, + 'parent' => 'int64', + 'path_to_root' => 'int64', + 'title' => null, + 'two_factor_required' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'feature' => 'feature', + 'group' => 'group', + 'id' => 'id', + 'leaf' => 'leaf', + 'name' => 'name', + 'parent' => 'parent', + 'path_to_root' => 'pathToRoot', + 'title' => 'title', + 'two_factor_required' => 'twoFactorRequired' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'feature' => 'setFeature', + 'group' => 'setGroup', + 'id' => 'setId', + 'leaf' => 'setLeaf', + 'name' => 'setName', + 'parent' => 'setParent', + 'path_to_root' => 'setPathToRoot', + 'title' => 'setTitle', + 'two_factor_required' => 'setTwoFactorRequired' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'feature' => 'getFeature', + 'group' => 'getGroup', + 'id' => 'getId', + 'leaf' => 'getLeaf', + 'name' => 'getName', + 'parent' => 'getParent', + 'path_to_root' => 'getPathToRoot', + 'title' => 'getTitle', + 'two_factor_required' => 'getTwoFactorRequired' + ]; + + + + /** + * 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['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['feature'] = isset($data['feature']) ? $data['feature'] : null; + + $this->container['group'] = isset($data['group']) ? $data['group'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['leaf'] = isset($data['leaf']) ? $data['leaf'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['parent'] = isset($data['parent']) ? $data['parent'] : null; + + $this->container['path_to_root'] = isset($data['path_to_root']) ? $data['path_to_root'] : null; + + $this->container['title'] = isset($data['title']) ? $data['title'] : null; + + $this->container['two_factor_required'] = isset($data['two_factor_required']) ? $data['two_factor_required'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets feature + * + * @return int + */ + public function getFeature() + { + return $this->container['feature']; + } + + /** + * Sets feature + * + * @param int $feature + * + * @return $this + */ + public function setFeature($feature) + { + $this->container['feature'] = $feature; + + return $this; + } + + + /** + * Gets group + * + * @return bool + */ + public function getGroup() + { + return $this->container['group']; + } + + /** + * Sets group + * + * @param bool $group + * + * @return $this + */ + public function setGroup($group) + { + $this->container['group'] = $group; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets leaf + * + * @return bool + */ + public function getLeaf() + { + return $this->container['leaf']; + } + + /** + * Sets leaf + * + * @param bool $leaf + * + * @return $this + */ + public function setLeaf($leaf) + { + $this->container['leaf'] = $leaf; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets parent + * + * @return int + */ + public function getParent() + { + return $this->container['parent']; + } + + /** + * Sets parent + * + * @param int $parent + * + * @return $this + */ + public function setParent($parent) + { + $this->container['parent'] = $parent; + + return $this; + } + + + /** + * Gets path_to_root + * + * @return int[] + */ + public function getPathToRoot() + { + return $this->container['path_to_root']; + } + + /** + * Sets path_to_root + * + * @param int[] $path_to_root + * + * @return $this + */ + public function setPathToRoot($path_to_root) + { + $this->container['path_to_root'] = $path_to_root; + + return $this; + } + + + /** + * Gets title + * + * @return map[string,string] + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param map[string,string] $title + * + * @return $this + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + + + /** + * Gets two_factor_required + * + * @return bool + */ + public function getTwoFactorRequired() + { + return $this->container['two_factor_required']; + } + + /** + * Sets two_factor_required + * + * @param bool $two_factor_required + * + * @return $this + */ + public function setTwoFactorRequired($two_factor_required) + { + $this->container['two_factor_required'] = $two_factor_required; + + 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/wallee-sdk/lib/Model/PersistableCurrencyAmount.php b/wallee-sdk/lib/Model/PersistableCurrencyAmount.php index 7d81a69..8f5be82 100644 --- a/wallee-sdk/lib/Model/PersistableCurrencyAmount.php +++ b/wallee-sdk/lib/Model/PersistableCurrencyAmount.php @@ -1,10 +1,8 @@ 'float', - 'currency' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var float - */ - private $amount; - - /** - * - * - * @var string - */ - private $currency; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - } - - - /** - * Returns amount. - * - * - * - * @return float - */ - public function getAmount() { - return $this->amount; - } - - /** - * Sets amount. - * - * @param float $amount - * @return PersistableCurrencyAmount - */ - protected function setAmount($amount) { - $this->amount = $amount; - - return $this; - } - - /** - * Returns currency. - * - * - * - * @return string - */ - public function getCurrency() { - return $this->currency; - } - - /** - * Sets currency. - * - * @param string $currency - * @return PersistableCurrencyAmount - */ - protected function setCurrency($currency) { - $this->currency = $currency; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class PersistableCurrencyAmount implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'PersistableCurrencyAmount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'amount' => 'float', + 'currency' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'amount' => null, + 'currency' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'currency' => 'currency' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'currency' => 'setCurrency' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'currency' => 'getCurrency' + ]; + + + + /** + * 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['amount'] = isset($data['amount']) ? $data['amount'] : null; + + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 amount + * + * @return float + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param float $amount + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + 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/wallee-sdk/lib/Model/PersistableCurrencyAmountUpdate.php b/wallee-sdk/lib/Model/PersistableCurrencyAmountUpdate.php index 4a6e1ef..710b649 100644 --- a/wallee-sdk/lib/Model/PersistableCurrencyAmountUpdate.php +++ b/wallee-sdk/lib/Model/PersistableCurrencyAmountUpdate.php @@ -1,10 +1,8 @@ 'float', - 'currency' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var float - */ - private $amount; - - /** - * - * - * @var string - */ - private $currency; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['amount'])) { - $this->setAmount($data['amount']); - } - if (isset($data['currency'])) { - $this->setCurrency($data['currency']); - } - } - - - /** - * Returns amount. - * - * - * - * @return float - */ - public function getAmount() { - return $this->amount; - } - - /** - * Sets amount. - * - * @param float $amount - * @return PersistableCurrencyAmountUpdate - */ - public function setAmount($amount) { - $this->amount = $amount; - - return $this; - } - - /** - * Returns currency. - * - * - * - * @return string - */ - public function getCurrency() { - return $this->currency; - } - - /** - * Sets currency. - * - * @param string $currency - * @return PersistableCurrencyAmountUpdate - */ - public function setCurrency($currency) { - $this->currency = $currency; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class PersistableCurrencyAmountUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'PersistableCurrencyAmount.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'amount' => 'float', + 'currency' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'amount' => null, + 'currency' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'currency' => 'currency' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'currency' => 'setCurrency' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'currency' => 'getCurrency' + ]; + + + + /** + * 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['amount'] = isset($data['amount']) ? $data['amount'] : null; + + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 amount + * + * @return float + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param float $amount + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + 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/wallee-sdk/lib/Model/ProductFeeType.php b/wallee-sdk/lib/Model/ProductFeeType.php index d6857f9..7a864b0 100644 --- a/wallee-sdk/lib/Model/ProductFeeType.php +++ b/wallee-sdk/lib/Model/ProductFeeType.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\SubscriptionProductComponent', - 'description' => '\Wallee\Sdk\Model\DatabaseTranslatedString', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'metric' => '\Wallee\Sdk\Model\SubscriptionMetric', - 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedString', - 'tierPricing' => '\Wallee\Sdk\Model\ProductMeteredTierPricing', - 'type' => '\Wallee\Sdk\Model\ProductFeeType', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionProductComponent - */ - private $component; - - /** - * The description of a component fee describes the fee to the subscriber. The description may be shown in documents or on certain user interfaces. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedString - */ - private $description; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionMetric - */ - private $metric; - - /** - * The name of the fee should describe for the subscriber in few words for what the fee is for. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedString - */ - private $name; - - /** - * The tier pricing determines the calculation method of the tiers. The prices of the different tiers can be applied in different ways. The tier pricing controls this calculation. - * - * @var \Wallee\Sdk\Model\ProductMeteredTierPricing - */ - private $tierPricing; - - /** - * - * - * @var \Wallee\Sdk\Model\ProductFeeType - */ - private $type; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['component'])) { - $this->setComponent($data['component']); - } - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['metric'])) { - $this->setMetric($data['metric']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['tierPricing'])) { - $this->setTierPricing($data['tierPricing']); - } - if (isset($data['type'])) { - $this->setType($data['type']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns component. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionProductComponent - */ - public function getComponent() { - return $this->component; - } - - /** - * Sets component. - * - * @param \Wallee\Sdk\Model\SubscriptionProductComponent $component - * @return ProductMeteredFee - */ - public function setComponent($component) { - $this->component = $component; - - return $this; - } - - /** - * Returns description. - * - * The description of a component fee describes the fee to the subscriber. The description may be shown in documents or on certain user interfaces. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedString - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedString $description - * @return ProductMeteredFee - */ - public function setDescription($description) { - $this->description = $description; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return ProductMeteredFee - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return ProductMeteredFee - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns metric. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionMetric - */ - public function getMetric() { - return $this->metric; - } - - /** - * Sets metric. - * - * @param \Wallee\Sdk\Model\SubscriptionMetric $metric - * @return ProductMeteredFee - */ - public function setMetric($metric) { - $this->metric = $metric; - - return $this; - } - - /** - * Returns name. - * - * The name of the fee should describe for the subscriber in few words for what the fee is for. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedString - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedString $name - * @return ProductMeteredFee - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns tierPricing. - * - * The tier pricing determines the calculation method of the tiers. The prices of the different tiers can be applied in different ways. The tier pricing controls this calculation. - * - * @return \Wallee\Sdk\Model\ProductMeteredTierPricing - */ - public function getTierPricing() { - return $this->tierPricing; - } - - /** - * Sets tierPricing. - * - * @param \Wallee\Sdk\Model\ProductMeteredTierPricing $tierPricing - * @return ProductMeteredFee - */ - public function setTierPricing($tierPricing) { - $this->tierPricing = $tierPricing; - - return $this; - } - - /** - * Returns type. - * - * - * - * @return \Wallee\Sdk\Model\ProductFeeType - */ - public function getType() { - return $this->type; - } - - /** - * Sets type. - * - * @param \Wallee\Sdk\Model\ProductFeeType $type - * @return ProductMeteredFee - */ - public function setType($type) { - $this->type = $type; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return ProductMeteredFee - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class ProductMeteredFee implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ProductMeteredFee'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'component' => '\Wallee\Sdk\Model\SubscriptionProductComponent', + 'description' => '\Wallee\Sdk\Model\DatabaseTranslatedString', + 'id' => 'int', + 'linked_space_id' => 'int', + 'metric' => '\Wallee\Sdk\Model\SubscriptionMetric', + 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedString', + 'tier_pricing' => '\Wallee\Sdk\Model\ProductMeteredTierPricing', + 'type' => '\Wallee\Sdk\Model\ProductFeeType', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'component' => null, + 'description' => null, + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'metric' => null, + 'name' => null, + 'tier_pricing' => null, + 'type' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'component' => 'component', + 'description' => 'description', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'metric' => 'metric', + 'name' => 'name', + 'tier_pricing' => 'tierPricing', + 'type' => 'type', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'component' => 'setComponent', + 'description' => 'setDescription', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'metric' => 'setMetric', + 'name' => 'setName', + 'tier_pricing' => 'setTierPricing', + 'type' => 'setType', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'component' => 'getComponent', + 'description' => 'getDescription', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'metric' => 'getMetric', + 'name' => 'getName', + 'tier_pricing' => 'getTierPricing', + 'type' => 'getType', + 'version' => 'getVersion' + ]; + + + + /** + * 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['component'] = isset($data['component']) ? $data['component'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['metric'] = isset($data['metric']) ? $data['metric'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['tier_pricing'] = isset($data['tier_pricing']) ? $data['tier_pricing'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 component + * + * @return \Wallee\Sdk\Model\SubscriptionProductComponent + */ + public function getComponent() + { + return $this->container['component']; + } + + /** + * Sets component + * + * @param \Wallee\Sdk\Model\SubscriptionProductComponent $component + * + * @return $this + */ + public function setComponent($component) + { + $this->container['component'] = $component; + + return $this; + } + + + /** + * Gets description + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedString + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedString $description The description of a component fee describes the fee to the subscriber. The description may be shown in documents or on certain user interfaces. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets metric + * + * @return \Wallee\Sdk\Model\SubscriptionMetric + */ + public function getMetric() + { + return $this->container['metric']; + } + + /** + * Sets metric + * + * @param \Wallee\Sdk\Model\SubscriptionMetric $metric + * + * @return $this + */ + public function setMetric($metric) + { + $this->container['metric'] = $metric; + + return $this; + } + + + /** + * Gets name + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedString + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedString $name The name of the fee should describe for the subscriber in few words for what the fee is for. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets tier_pricing + * + * @return \Wallee\Sdk\Model\ProductMeteredTierPricing + */ + public function getTierPricing() + { + return $this->container['tier_pricing']; + } + + /** + * Sets tier_pricing + * + * @param \Wallee\Sdk\Model\ProductMeteredTierPricing $tier_pricing The tier pricing determines the calculation method of the tiers. The prices of the different tiers can be applied in different ways. The tier pricing controls this calculation. + * + * @return $this + */ + public function setTierPricing($tier_pricing) + { + $this->container['tier_pricing'] = $tier_pricing; + + return $this; + } + + + /** + * Gets type + * + * @return \Wallee\Sdk\Model\ProductFeeType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Wallee\Sdk\Model\ProductFeeType $type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/ProductMeteredFeeUpdate.php b/wallee-sdk/lib/Model/ProductMeteredFeeUpdate.php index 1eacbfe..e30615f 100644 --- a/wallee-sdk/lib/Model/ProductMeteredFeeUpdate.php +++ b/wallee-sdk/lib/Model/ProductMeteredFeeUpdate.php @@ -1,10 +1,8 @@ 'int', - 'version' => 'int', - 'component' => 'int', - 'description' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', - 'metric' => 'int', - 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', - 'tierPricing' => '\Wallee\Sdk\Model\ProductMeteredTierPricing' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - /** - * - * - * @var int - */ - private $component; - - /** - * The description of a component fee describes the fee to the subscriber. The description may be shown in documents or on certain user interfaces. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - private $description; - - /** - * - * - * @var int - */ - private $metric; - - /** - * The name of the fee should describe for the subscriber in few words for what the fee is for. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - private $name; - - /** - * The tier pricing determines the calculation method of the tiers. The prices of the different tiers can be applied in different ways. The tier pricing controls this calculation. - * - * @var \Wallee\Sdk\Model\ProductMeteredTierPricing - */ - private $tierPricing; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - if (isset($data['component'])) { - $this->setComponent($data['component']); - } - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['metric'])) { - $this->setMetric($data['metric']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['tierPricing'])) { - $this->setTierPricing($data['tierPricing']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return ProductMeteredFeeUpdate - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return ProductMeteredFeeUpdate - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Returns component. - * - * - * - * @return int - */ - public function getComponent() { - return $this->component; - } - - /** - * Sets component. - * - * @param int $component - * @return ProductMeteredFeeUpdate - */ - public function setComponent($component) { - $this->component = $component; - - return $this; - } - - /** - * Returns description. - * - * The description of a component fee describes the fee to the subscriber. The description may be shown in documents or on certain user interfaces. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $description - * @return ProductMeteredFeeUpdate - */ - public function setDescription($description) { - $this->description = $description; - - return $this; - } - - /** - * Returns metric. - * - * - * - * @return int - */ - public function getMetric() { - return $this->metric; - } - - /** - * Sets metric. - * - * @param int $metric - * @return ProductMeteredFeeUpdate - */ - public function setMetric($metric) { - $this->metric = $metric; - - return $this; - } - - /** - * Returns name. - * - * The name of the fee should describe for the subscriber in few words for what the fee is for. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $name - * @return ProductMeteredFeeUpdate - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns tierPricing. - * - * The tier pricing determines the calculation method of the tiers. The prices of the different tiers can be applied in different ways. The tier pricing controls this calculation. - * - * @return \Wallee\Sdk\Model\ProductMeteredTierPricing - */ - public function getTierPricing() { - return $this->tierPricing; - } - - /** - * Sets tierPricing. - * - * @param \Wallee\Sdk\Model\ProductMeteredTierPricing $tierPricing - * @return ProductMeteredFeeUpdate - */ - public function setTierPricing($tierPricing) { - $this->tierPricing = $tierPricing; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getId() === null) { - throw new ValidationException("'id' can't be null", 'id', $this); - } - if ($this->getVersion() === null) { - throw new ValidationException("'version' can't be null", 'version', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class ProductMeteredFeeUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ProductMeteredFee.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'version' => 'int', + 'component' => 'int', + 'description' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', + 'metric' => 'int', + 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', + 'tier_pricing' => '\Wallee\Sdk\Model\ProductMeteredTierPricing' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64', + 'component' => 'int64', + 'description' => null, + 'metric' => 'int64', + 'name' => null, + 'tier_pricing' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version', + 'component' => 'component', + 'description' => 'description', + 'metric' => 'metric', + 'name' => 'name', + 'tier_pricing' => 'tierPricing' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion', + 'component' => 'setComponent', + 'description' => 'setDescription', + 'metric' => 'setMetric', + 'name' => 'setName', + 'tier_pricing' => 'setTierPricing' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion', + 'component' => 'getComponent', + 'description' => 'getDescription', + 'metric' => 'getMetric', + 'name' => 'getName', + 'tier_pricing' => 'getTierPricing' + ]; + + + + /** + * 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['version'] = isset($data['version']) ? $data['version'] : null; + + $this->container['component'] = isset($data['component']) ? $data['component'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['metric'] = isset($data['metric']) ? $data['metric'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['tier_pricing'] = isset($data['tier_pricing']) ? $data['tier_pricing'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + + /** + * Gets component + * + * @return int + */ + public function getComponent() + { + return $this->container['component']; + } + + /** + * Sets component + * + * @param int $component + * + * @return $this + */ + public function setComponent($component) + { + $this->container['component'] = $component; + + return $this; + } + + + /** + * Gets description + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $description The description of a component fee describes the fee to the subscriber. The description may be shown in documents or on certain user interfaces. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets metric + * + * @return int + */ + public function getMetric() + { + return $this->container['metric']; + } + + /** + * Sets metric + * + * @param int $metric + * + * @return $this + */ + public function setMetric($metric) + { + $this->container['metric'] = $metric; + + return $this; + } + + + /** + * Gets name + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $name The name of the fee should describe for the subscriber in few words for what the fee is for. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets tier_pricing + * + * @return \Wallee\Sdk\Model\ProductMeteredTierPricing + */ + public function getTierPricing() + { + return $this->container['tier_pricing']; + } + + /** + * Sets tier_pricing + * + * @param \Wallee\Sdk\Model\ProductMeteredTierPricing $tier_pricing The tier pricing determines the calculation method of the tiers. The prices of the different tiers can be applied in different ways. The tier pricing controls this calculation. + * + * @return $this + */ + public function setTierPricing($tier_pricing) + { + $this->container['tier_pricing'] = $tier_pricing; + + 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/wallee-sdk/lib/Model/ProductMeteredTierFee.php b/wallee-sdk/lib/Model/ProductMeteredTierFee.php index 29568e2..13014d0 100644 --- a/wallee-sdk/lib/Model/ProductMeteredTierFee.php +++ b/wallee-sdk/lib/Model/ProductMeteredTierFee.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\PersistableCurrencyAmount[]', - 'id' => 'int', - 'meteredFee' => '\Wallee\Sdk\Model\ProductMeteredFee', - 'startRange' => 'float', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The fee determines the amount which is charged. The consumed metric is multiplied by the defined fee. The resulting amount is charged at the end of the period. - * - * @var \Wallee\Sdk\Model\PersistableCurrencyAmount[] - */ - private $fee; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var \Wallee\Sdk\Model\ProductMeteredFee - */ - private $meteredFee; - - /** - * The start range defines the metered consumption of the metric from which on the defined fee gets applied. This means when a subscription consumes a value of 10 or more and the start range is set to 10 the fee defined on the tier will be applied. - * - * @var float - */ - private $startRange; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['fee'])) { - $this->setFee($data['fee']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['meteredFee'])) { - $this->setMeteredFee($data['meteredFee']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns fee. - * - * The fee determines the amount which is charged. The consumed metric is multiplied by the defined fee. The resulting amount is charged at the end of the period. - * - * @return \Wallee\Sdk\Model\PersistableCurrencyAmount[] - */ - public function getFee() { - return $this->fee; - } - - /** - * Sets fee. - * - * @param \Wallee\Sdk\Model\PersistableCurrencyAmount[] $fee - * @return ProductMeteredTierFee - */ - public function setFee($fee) { - $this->fee = $fee; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return ProductMeteredTierFee - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns meteredFee. - * - * - * - * @return \Wallee\Sdk\Model\ProductMeteredFee - */ - public function getMeteredFee() { - return $this->meteredFee; - } - - /** - * Sets meteredFee. - * - * @param \Wallee\Sdk\Model\ProductMeteredFee $meteredFee - * @return ProductMeteredTierFee - */ - public function setMeteredFee($meteredFee) { - $this->meteredFee = $meteredFee; - - return $this; - } - - /** - * Returns startRange. - * - * The start range defines the metered consumption of the metric from which on the defined fee gets applied. This means when a subscription consumes a value of 10 or more and the start range is set to 10 the fee defined on the tier will be applied. - * - * @return float - */ - public function getStartRange() { - return $this->startRange; - } - - /** - * Sets startRange. - * - * @param float $startRange - * @return ProductMeteredTierFee - */ - protected function setStartRange($startRange) { - $this->startRange = $startRange; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return ProductMeteredTierFee - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class ProductMeteredTierFee implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ProductMeteredTierFee'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'fee' => '\Wallee\Sdk\Model\PersistableCurrencyAmount[]', + 'id' => 'int', + 'metered_fee' => '\Wallee\Sdk\Model\ProductMeteredFee', + 'start_range' => 'float', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'fee' => null, + 'id' => 'int64', + 'metered_fee' => null, + 'start_range' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'fee' => 'fee', + 'id' => 'id', + 'metered_fee' => 'meteredFee', + 'start_range' => 'startRange', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'fee' => 'setFee', + 'id' => 'setId', + 'metered_fee' => 'setMeteredFee', + 'start_range' => 'setStartRange', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'fee' => 'getFee', + 'id' => 'getId', + 'metered_fee' => 'getMeteredFee', + 'start_range' => 'getStartRange', + 'version' => 'getVersion' + ]; + + + + /** + * 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['fee'] = isset($data['fee']) ? $data['fee'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['metered_fee'] = isset($data['metered_fee']) ? $data['metered_fee'] : null; + + $this->container['start_range'] = isset($data['start_range']) ? $data['start_range'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 fee + * + * @return \Wallee\Sdk\Model\PersistableCurrencyAmount[] + */ + public function getFee() + { + return $this->container['fee']; + } + + /** + * Sets fee + * + * @param \Wallee\Sdk\Model\PersistableCurrencyAmount[] $fee The fee determines the amount which is charged. The consumed metric is multiplied by the defined fee. The resulting amount is charged at the end of the period. + * + * @return $this + */ + public function setFee($fee) + { + $this->container['fee'] = $fee; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets metered_fee + * + * @return \Wallee\Sdk\Model\ProductMeteredFee + */ + public function getMeteredFee() + { + return $this->container['metered_fee']; + } + + /** + * Sets metered_fee + * + * @param \Wallee\Sdk\Model\ProductMeteredFee $metered_fee + * + * @return $this + */ + public function setMeteredFee($metered_fee) + { + $this->container['metered_fee'] = $metered_fee; + + return $this; + } + + + /** + * Gets start_range + * + * @return float + */ + public function getStartRange() + { + return $this->container['start_range']; + } + + /** + * Sets start_range + * + * @param float $start_range The start range defines the metered consumption of the metric from which on the defined fee gets applied. This means when a subscription consumes a value of 10 or more and the start range is set to 10 the fee defined on the tier will be applied. + * + * @return $this + */ + public function setStartRange($start_range) + { + $this->container['start_range'] = $start_range; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/ProductMeteredTierFeeUpdate.php b/wallee-sdk/lib/Model/ProductMeteredTierFeeUpdate.php index 762342c..0e58798 100644 --- a/wallee-sdk/lib/Model/ProductMeteredTierFeeUpdate.php +++ b/wallee-sdk/lib/Model/ProductMeteredTierFeeUpdate.php @@ -1,10 +1,8 @@ 'int', - 'version' => 'int', - 'fee' => '\Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[]', - 'meteredFee' => 'int', - 'startRange' => 'float' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - /** - * The fee determines the amount which is charged. The consumed metric is multiplied by the defined fee. The resulting amount is charged at the end of the period. - * - * @var \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] - */ - private $fee; - - /** - * - * - * @var int - */ - private $meteredFee; - - /** - * The start range defines the metered consumption of the metric from which on the defined fee gets applied. This means when a subscription consumes a value of 10 or more and the start range is set to 10 the fee defined on the tier will be applied. - * - * @var float - */ - private $startRange; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - if (isset($data['fee'])) { - $this->setFee($data['fee']); - } - if (isset($data['meteredFee'])) { - $this->setMeteredFee($data['meteredFee']); - } - if (isset($data['startRange'])) { - $this->setStartRange($data['startRange']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return ProductMeteredTierFeeUpdate - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return ProductMeteredTierFeeUpdate - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Returns fee. - * - * The fee determines the amount which is charged. The consumed metric is multiplied by the defined fee. The resulting amount is charged at the end of the period. - * - * @return \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] - */ - public function getFee() { - return $this->fee; - } - - /** - * Sets fee. - * - * @param \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] $fee - * @return ProductMeteredTierFeeUpdate - */ - public function setFee($fee) { - $this->fee = $fee; - - return $this; - } - - /** - * Returns meteredFee. - * - * - * - * @return int - */ - public function getMeteredFee() { - return $this->meteredFee; - } - - /** - * Sets meteredFee. - * - * @param int $meteredFee - * @return ProductMeteredTierFeeUpdate - */ - public function setMeteredFee($meteredFee) { - $this->meteredFee = $meteredFee; - - return $this; - } - - /** - * Returns startRange. - * - * The start range defines the metered consumption of the metric from which on the defined fee gets applied. This means when a subscription consumes a value of 10 or more and the start range is set to 10 the fee defined on the tier will be applied. - * - * @return float - */ - public function getStartRange() { - return $this->startRange; - } - - /** - * Sets startRange. - * - * @param float $startRange - * @return ProductMeteredTierFeeUpdate - */ - public function setStartRange($startRange) { - $this->startRange = $startRange; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getId() === null) { - throw new ValidationException("'id' can't be null", 'id', $this); - } - if ($this->getVersion() === null) { - throw new ValidationException("'version' can't be null", 'version', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class ProductMeteredTierFeeUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ProductMeteredTierFee.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'version' => 'int', + 'fee' => '\Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[]', + 'metered_fee' => 'int', + 'start_range' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64', + 'fee' => null, + 'metered_fee' => 'int64', + 'start_range' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version', + 'fee' => 'fee', + 'metered_fee' => 'meteredFee', + 'start_range' => 'startRange' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion', + 'fee' => 'setFee', + 'metered_fee' => 'setMeteredFee', + 'start_range' => 'setStartRange' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion', + 'fee' => 'getFee', + 'metered_fee' => 'getMeteredFee', + 'start_range' => 'getStartRange' + ]; + + + + /** + * 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['version'] = isset($data['version']) ? $data['version'] : null; + + $this->container['fee'] = isset($data['fee']) ? $data['fee'] : null; + + $this->container['metered_fee'] = isset($data['metered_fee']) ? $data['metered_fee'] : null; + + $this->container['start_range'] = isset($data['start_range']) ? $data['start_range'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + + /** + * Gets fee + * + * @return \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] + */ + public function getFee() + { + return $this->container['fee']; + } + + /** + * Sets fee + * + * @param \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] $fee The fee determines the amount which is charged. The consumed metric is multiplied by the defined fee. The resulting amount is charged at the end of the period. + * + * @return $this + */ + public function setFee($fee) + { + $this->container['fee'] = $fee; + + return $this; + } + + + /** + * Gets metered_fee + * + * @return int + */ + public function getMeteredFee() + { + return $this->container['metered_fee']; + } + + /** + * Sets metered_fee + * + * @param int $metered_fee + * + * @return $this + */ + public function setMeteredFee($metered_fee) + { + $this->container['metered_fee'] = $metered_fee; + + return $this; + } + + + /** + * Gets start_range + * + * @return float + */ + public function getStartRange() + { + return $this->container['start_range']; + } + + /** + * Sets start_range + * + * @param float $start_range The start range defines the metered consumption of the metric from which on the defined fee gets applied. This means when a subscription consumes a value of 10 or more and the start range is set to 10 the fee defined on the tier will be applied. + * + * @return $this + */ + public function setStartRange($start_range) + { + $this->container['start_range'] = $start_range; + + 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/wallee-sdk/lib/Model/ProductMeteredTierPricing.php b/wallee-sdk/lib/Model/ProductMeteredTierPricing.php index 1f4880a..1625e63 100644 --- a/wallee-sdk/lib/Model/ProductMeteredTierPricing.php +++ b/wallee-sdk/lib/Model/ProductMeteredTierPricing.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\SubscriptionProductComponent', - 'description' => '\Wallee\Sdk\Model\DatabaseTranslatedString', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedString', - 'numberOfFreeTrialPeriods' => 'int', - 'periodFee' => '\Wallee\Sdk\Model\PersistableCurrencyAmount[]', - 'type' => '\Wallee\Sdk\Model\ProductFeeType', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionProductComponent - */ - private $component; - - /** - * The description of a component fee describes the fee to the subscriber. The description may be shown in documents or on certain user interfaces. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedString - */ - private $description; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The name of the fee should describe for the subscriber in few words for what the fee is for. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedString - */ - private $name; - - /** - * The number of free trial periods specify how many periods are free of charge at the begining of the subscription. - * - * @var int - */ - private $numberOfFreeTrialPeriods; - - /** - * The period fee is charged for every period of the subscription except for those periods which are trial periods. - * - * @var \Wallee\Sdk\Model\PersistableCurrencyAmount[] - */ - private $periodFee; - - /** - * - * - * @var \Wallee\Sdk\Model\ProductFeeType - */ - private $type; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['component'])) { - $this->setComponent($data['component']); - } - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['periodFee'])) { - $this->setPeriodFee($data['periodFee']); - } - if (isset($data['type'])) { - $this->setType($data['type']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns component. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionProductComponent - */ - public function getComponent() { - return $this->component; - } - - /** - * Sets component. - * - * @param \Wallee\Sdk\Model\SubscriptionProductComponent $component - * @return ProductPeriodFee - */ - public function setComponent($component) { - $this->component = $component; - - return $this; - } - - /** - * Returns description. - * - * The description of a component fee describes the fee to the subscriber. The description may be shown in documents or on certain user interfaces. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedString - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedString $description - * @return ProductPeriodFee - */ - public function setDescription($description) { - $this->description = $description; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return ProductPeriodFee - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return ProductPeriodFee - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * The name of the fee should describe for the subscriber in few words for what the fee is for. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedString - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedString $name - * @return ProductPeriodFee - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns numberOfFreeTrialPeriods. - * - * The number of free trial periods specify how many periods are free of charge at the begining of the subscription. - * - * @return int - */ - public function getNumberOfFreeTrialPeriods() { - return $this->numberOfFreeTrialPeriods; - } - - /** - * Sets numberOfFreeTrialPeriods. - * - * @param int $numberOfFreeTrialPeriods - * @return ProductPeriodFee - */ - protected function setNumberOfFreeTrialPeriods($numberOfFreeTrialPeriods) { - $this->numberOfFreeTrialPeriods = $numberOfFreeTrialPeriods; - - return $this; - } - - /** - * Returns periodFee. - * - * The period fee is charged for every period of the subscription except for those periods which are trial periods. - * - * @return \Wallee\Sdk\Model\PersistableCurrencyAmount[] - */ - public function getPeriodFee() { - return $this->periodFee; - } - - /** - * Sets periodFee. - * - * @param \Wallee\Sdk\Model\PersistableCurrencyAmount[] $periodFee - * @return ProductPeriodFee - */ - public function setPeriodFee($periodFee) { - $this->periodFee = $periodFee; - - return $this; - } - - /** - * Returns type. - * - * - * - * @return \Wallee\Sdk\Model\ProductFeeType - */ - public function getType() { - return $this->type; - } - - /** - * Sets type. - * - * @param \Wallee\Sdk\Model\ProductFeeType $type - * @return ProductPeriodFee - */ - public function setType($type) { - $this->type = $type; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return ProductPeriodFee - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class ProductPeriodFee implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ProductPeriodFee'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'component' => '\Wallee\Sdk\Model\SubscriptionProductComponent', + 'description' => '\Wallee\Sdk\Model\DatabaseTranslatedString', + 'id' => 'int', + 'ledger_entry_title' => '\Wallee\Sdk\Model\DatabaseTranslatedString', + 'linked_space_id' => 'int', + 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedString', + 'number_of_free_trial_periods' => 'int', + 'period_fee' => '\Wallee\Sdk\Model\PersistableCurrencyAmount[]', + 'type' => '\Wallee\Sdk\Model\ProductFeeType', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'component' => null, + 'description' => null, + 'id' => 'int64', + 'ledger_entry_title' => null, + 'linked_space_id' => 'int64', + 'name' => null, + 'number_of_free_trial_periods' => 'int32', + 'period_fee' => null, + 'type' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'component' => 'component', + 'description' => 'description', + 'id' => 'id', + 'ledger_entry_title' => 'ledgerEntryTitle', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'number_of_free_trial_periods' => 'numberOfFreeTrialPeriods', + 'period_fee' => 'periodFee', + 'type' => 'type', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'component' => 'setComponent', + 'description' => 'setDescription', + 'id' => 'setId', + 'ledger_entry_title' => 'setLedgerEntryTitle', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'number_of_free_trial_periods' => 'setNumberOfFreeTrialPeriods', + 'period_fee' => 'setPeriodFee', + 'type' => 'setType', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'component' => 'getComponent', + 'description' => 'getDescription', + 'id' => 'getId', + 'ledger_entry_title' => 'getLedgerEntryTitle', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'number_of_free_trial_periods' => 'getNumberOfFreeTrialPeriods', + 'period_fee' => 'getPeriodFee', + 'type' => 'getType', + 'version' => 'getVersion' + ]; + + + + /** + * 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['component'] = isset($data['component']) ? $data['component'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['ledger_entry_title'] = isset($data['ledger_entry_title']) ? $data['ledger_entry_title'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['number_of_free_trial_periods'] = isset($data['number_of_free_trial_periods']) ? $data['number_of_free_trial_periods'] : null; + + $this->container['period_fee'] = isset($data['period_fee']) ? $data['period_fee'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 component + * + * @return \Wallee\Sdk\Model\SubscriptionProductComponent + */ + public function getComponent() + { + return $this->container['component']; + } + + /** + * Sets component + * + * @param \Wallee\Sdk\Model\SubscriptionProductComponent $component + * + * @return $this + */ + public function setComponent($component) + { + $this->container['component'] = $component; + + return $this; + } + + + /** + * Gets description + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedString + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedString $description The description of a component fee describes the fee to the subscriber. The description may be shown in documents or on certain user interfaces. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets ledger_entry_title + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedString + */ + public function getLedgerEntryTitle() + { + return $this->container['ledger_entry_title']; + } + + /** + * Sets ledger_entry_title + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedString $ledger_entry_title The ledger entry title will be used for the title in the ledger entry and in the invoice. + * + * @return $this + */ + public function setLedgerEntryTitle($ledger_entry_title) + { + $this->container['ledger_entry_title'] = $ledger_entry_title; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedString + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedString $name The name of the fee should describe for the subscriber in few words for what the fee is for. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets number_of_free_trial_periods + * + * @return int + */ + public function getNumberOfFreeTrialPeriods() + { + return $this->container['number_of_free_trial_periods']; + } + + /** + * Sets number_of_free_trial_periods + * + * @param int $number_of_free_trial_periods The number of free trial periods specify how many periods are free of charge at the begining of the subscription. + * + * @return $this + */ + public function setNumberOfFreeTrialPeriods($number_of_free_trial_periods) + { + $this->container['number_of_free_trial_periods'] = $number_of_free_trial_periods; + + return $this; + } + + + /** + * Gets period_fee + * + * @return \Wallee\Sdk\Model\PersistableCurrencyAmount[] + */ + public function getPeriodFee() + { + return $this->container['period_fee']; + } + + /** + * Sets period_fee + * + * @param \Wallee\Sdk\Model\PersistableCurrencyAmount[] $period_fee The period fee is charged for every period of the subscription except for those periods which are trial periods. + * + * @return $this + */ + public function setPeriodFee($period_fee) + { + $this->container['period_fee'] = $period_fee; + + return $this; + } + + + /** + * Gets type + * + * @return \Wallee\Sdk\Model\ProductFeeType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Wallee\Sdk\Model\ProductFeeType $type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/ProductPeriodFeeUpdate.php b/wallee-sdk/lib/Model/ProductPeriodFeeUpdate.php index 0781517..a2d5b2b 100644 --- a/wallee-sdk/lib/Model/ProductPeriodFeeUpdate.php +++ b/wallee-sdk/lib/Model/ProductPeriodFeeUpdate.php @@ -1,10 +1,8 @@ 'int', - 'version' => 'int', - 'component' => 'int', - 'description' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', - 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', - 'numberOfFreeTrialPeriods' => 'int', - 'periodFee' => '\Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - /** - * - * - * @var int - */ - private $component; - - /** - * The description of a component fee describes the fee to the subscriber. The description may be shown in documents or on certain user interfaces. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - private $description; - - /** - * The name of the fee should describe for the subscriber in few words for what the fee is for. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - private $name; - - /** - * The number of free trial periods specify how many periods are free of charge at the begining of the subscription. - * - * @var int - */ - private $numberOfFreeTrialPeriods; - - /** - * The period fee is charged for every period of the subscription except for those periods which are trial periods. - * - * @var \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] - */ - private $periodFee; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - if (isset($data['component'])) { - $this->setComponent($data['component']); - } - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['numberOfFreeTrialPeriods'])) { - $this->setNumberOfFreeTrialPeriods($data['numberOfFreeTrialPeriods']); - } - if (isset($data['periodFee'])) { - $this->setPeriodFee($data['periodFee']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return ProductPeriodFeeUpdate - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return ProductPeriodFeeUpdate - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Returns component. - * - * - * - * @return int - */ - public function getComponent() { - return $this->component; - } - - /** - * Sets component. - * - * @param int $component - * @return ProductPeriodFeeUpdate - */ - public function setComponent($component) { - $this->component = $component; - - return $this; - } - - /** - * Returns description. - * - * The description of a component fee describes the fee to the subscriber. The description may be shown in documents or on certain user interfaces. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $description - * @return ProductPeriodFeeUpdate - */ - public function setDescription($description) { - $this->description = $description; - - return $this; - } - - /** - * Returns name. - * - * The name of the fee should describe for the subscriber in few words for what the fee is for. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $name - * @return ProductPeriodFeeUpdate - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns numberOfFreeTrialPeriods. - * - * The number of free trial periods specify how many periods are free of charge at the begining of the subscription. - * - * @return int - */ - public function getNumberOfFreeTrialPeriods() { - return $this->numberOfFreeTrialPeriods; - } - - /** - * Sets numberOfFreeTrialPeriods. - * - * @param int $numberOfFreeTrialPeriods - * @return ProductPeriodFeeUpdate - */ - public function setNumberOfFreeTrialPeriods($numberOfFreeTrialPeriods) { - $this->numberOfFreeTrialPeriods = $numberOfFreeTrialPeriods; - - return $this; - } - - /** - * Returns periodFee. - * - * The period fee is charged for every period of the subscription except for those periods which are trial periods. - * - * @return \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] - */ - public function getPeriodFee() { - return $this->periodFee; - } - - /** - * Sets periodFee. - * - * @param \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] $periodFee - * @return ProductPeriodFeeUpdate - */ - public function setPeriodFee($periodFee) { - $this->periodFee = $periodFee; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getId() === null) { - throw new ValidationException("'id' can't be null", 'id', $this); - } - if ($this->getVersion() === null) { - throw new ValidationException("'version' can't be null", 'version', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class ProductPeriodFeeUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ProductPeriodFee.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'version' => 'int', + 'component' => 'int', + 'description' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', + 'ledger_entry_title' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', + 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', + 'number_of_free_trial_periods' => 'int', + 'period_fee' => '\Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64', + 'component' => 'int64', + 'description' => null, + 'ledger_entry_title' => null, + 'name' => null, + 'number_of_free_trial_periods' => 'int32', + 'period_fee' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version', + 'component' => 'component', + 'description' => 'description', + 'ledger_entry_title' => 'ledgerEntryTitle', + 'name' => 'name', + 'number_of_free_trial_periods' => 'numberOfFreeTrialPeriods', + 'period_fee' => 'periodFee' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion', + 'component' => 'setComponent', + 'description' => 'setDescription', + 'ledger_entry_title' => 'setLedgerEntryTitle', + 'name' => 'setName', + 'number_of_free_trial_periods' => 'setNumberOfFreeTrialPeriods', + 'period_fee' => 'setPeriodFee' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion', + 'component' => 'getComponent', + 'description' => 'getDescription', + 'ledger_entry_title' => 'getLedgerEntryTitle', + 'name' => 'getName', + 'number_of_free_trial_periods' => 'getNumberOfFreeTrialPeriods', + 'period_fee' => 'getPeriodFee' + ]; + + + + /** + * 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['version'] = isset($data['version']) ? $data['version'] : null; + + $this->container['component'] = isset($data['component']) ? $data['component'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['ledger_entry_title'] = isset($data['ledger_entry_title']) ? $data['ledger_entry_title'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['number_of_free_trial_periods'] = isset($data['number_of_free_trial_periods']) ? $data['number_of_free_trial_periods'] : null; + + $this->container['period_fee'] = isset($data['period_fee']) ? $data['period_fee'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + + /** + * Gets component + * + * @return int + */ + public function getComponent() + { + return $this->container['component']; + } + + /** + * Sets component + * + * @param int $component + * + * @return $this + */ + public function setComponent($component) + { + $this->container['component'] = $component; + + return $this; + } + + + /** + * Gets description + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $description The description of a component fee describes the fee to the subscriber. The description may be shown in documents or on certain user interfaces. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets ledger_entry_title + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate + */ + public function getLedgerEntryTitle() + { + return $this->container['ledger_entry_title']; + } + + /** + * Sets ledger_entry_title + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $ledger_entry_title The ledger entry title will be used for the title in the ledger entry and in the invoice. + * + * @return $this + */ + public function setLedgerEntryTitle($ledger_entry_title) + { + $this->container['ledger_entry_title'] = $ledger_entry_title; + + return $this; + } + + + /** + * Gets name + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $name The name of the fee should describe for the subscriber in few words for what the fee is for. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets number_of_free_trial_periods + * + * @return int + */ + public function getNumberOfFreeTrialPeriods() + { + return $this->container['number_of_free_trial_periods']; + } + + /** + * Sets number_of_free_trial_periods + * + * @param int $number_of_free_trial_periods The number of free trial periods specify how many periods are free of charge at the begining of the subscription. + * + * @return $this + */ + public function setNumberOfFreeTrialPeriods($number_of_free_trial_periods) + { + $this->container['number_of_free_trial_periods'] = $number_of_free_trial_periods; + + return $this; + } + + + /** + * Gets period_fee + * + * @return \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] + */ + public function getPeriodFee() + { + return $this->container['period_fee']; + } + + /** + * Sets period_fee + * + * @param \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] $period_fee The period fee is charged for every period of the subscription except for those periods which are trial periods. + * + * @return $this + */ + public function setPeriodFee($period_fee) + { + $this->container['period_fee'] = $period_fee; + + 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/wallee-sdk/lib/Model/ProductSetupFee.php b/wallee-sdk/lib/Model/ProductSetupFee.php index ae809e9..4352a7c 100644 --- a/wallee-sdk/lib/Model/ProductSetupFee.php +++ b/wallee-sdk/lib/Model/ProductSetupFee.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\SubscriptionProductComponent', - 'description' => '\Wallee\Sdk\Model\DatabaseTranslatedString', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedString', - 'onDowngradeCreditedAmount' => '\Wallee\Sdk\Model\PersistableCurrencyAmount[]', - 'onUpgradeCreditedAmount' => '\Wallee\Sdk\Model\PersistableCurrencyAmount[]', - 'setupFee' => '\Wallee\Sdk\Model\PersistableCurrencyAmount[]', - 'type' => '\Wallee\Sdk\Model\ProductFeeType', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionProductComponent - */ - private $component; - - /** - * The description of a component fee describes the fee to the subscriber. The description may be shown in documents or on certain user interfaces. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedString - */ - private $description; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The name of the fee should describe for the subscriber in few words for what the fee is for. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedString - */ - private $name; - - /** - * When the subscription is changed and the change is considered as a downgrade the amount defined by this property will be credited to the subscriber. - * - * @var \Wallee\Sdk\Model\PersistableCurrencyAmount[] - */ - private $onDowngradeCreditedAmount; - - /** - * When the subscription is changed and the change is considered as a upgrade the amount defined by this property will be credited to the subscriber. - * - * @var \Wallee\Sdk\Model\PersistableCurrencyAmount[] - */ - private $onUpgradeCreditedAmount; - - /** - * The setup fee is charged when the subscriber subscribes to this component. The setup fee is debited with the first charge for the subscriptions. - * - * @var \Wallee\Sdk\Model\PersistableCurrencyAmount[] - */ - private $setupFee; - - /** - * - * - * @var \Wallee\Sdk\Model\ProductFeeType - */ - private $type; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['component'])) { - $this->setComponent($data['component']); - } - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['onDowngradeCreditedAmount'])) { - $this->setOnDowngradeCreditedAmount($data['onDowngradeCreditedAmount']); - } - if (isset($data['onUpgradeCreditedAmount'])) { - $this->setOnUpgradeCreditedAmount($data['onUpgradeCreditedAmount']); - } - if (isset($data['setupFee'])) { - $this->setSetupFee($data['setupFee']); - } - if (isset($data['type'])) { - $this->setType($data['type']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns component. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionProductComponent - */ - public function getComponent() { - return $this->component; - } - - /** - * Sets component. - * - * @param \Wallee\Sdk\Model\SubscriptionProductComponent $component - * @return ProductSetupFee - */ - public function setComponent($component) { - $this->component = $component; - - return $this; - } - - /** - * Returns description. - * - * The description of a component fee describes the fee to the subscriber. The description may be shown in documents or on certain user interfaces. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedString - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedString $description - * @return ProductSetupFee - */ - public function setDescription($description) { - $this->description = $description; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return ProductSetupFee - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return ProductSetupFee - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * The name of the fee should describe for the subscriber in few words for what the fee is for. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedString - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedString $name - * @return ProductSetupFee - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns onDowngradeCreditedAmount. - * - * When the subscription is changed and the change is considered as a downgrade the amount defined by this property will be credited to the subscriber. - * - * @return \Wallee\Sdk\Model\PersistableCurrencyAmount[] - */ - public function getOnDowngradeCreditedAmount() { - return $this->onDowngradeCreditedAmount; - } - - /** - * Sets onDowngradeCreditedAmount. - * - * @param \Wallee\Sdk\Model\PersistableCurrencyAmount[] $onDowngradeCreditedAmount - * @return ProductSetupFee - */ - public function setOnDowngradeCreditedAmount($onDowngradeCreditedAmount) { - $this->onDowngradeCreditedAmount = $onDowngradeCreditedAmount; - - return $this; - } - - /** - * Returns onUpgradeCreditedAmount. - * - * When the subscription is changed and the change is considered as a upgrade the amount defined by this property will be credited to the subscriber. - * - * @return \Wallee\Sdk\Model\PersistableCurrencyAmount[] - */ - public function getOnUpgradeCreditedAmount() { - return $this->onUpgradeCreditedAmount; - } - - /** - * Sets onUpgradeCreditedAmount. - * - * @param \Wallee\Sdk\Model\PersistableCurrencyAmount[] $onUpgradeCreditedAmount - * @return ProductSetupFee - */ - public function setOnUpgradeCreditedAmount($onUpgradeCreditedAmount) { - $this->onUpgradeCreditedAmount = $onUpgradeCreditedAmount; - - return $this; - } - - /** - * Returns setupFee. - * - * The setup fee is charged when the subscriber subscribes to this component. The setup fee is debited with the first charge for the subscriptions. - * - * @return \Wallee\Sdk\Model\PersistableCurrencyAmount[] - */ - public function getSetupFee() { - return $this->setupFee; - } - - /** - * Sets setupFee. - * - * @param \Wallee\Sdk\Model\PersistableCurrencyAmount[] $setupFee - * @return ProductSetupFee - */ - public function setSetupFee($setupFee) { - $this->setupFee = $setupFee; - - return $this; - } - - /** - * Returns type. - * - * - * - * @return \Wallee\Sdk\Model\ProductFeeType - */ - public function getType() { - return $this->type; - } - - /** - * Sets type. - * - * @param \Wallee\Sdk\Model\ProductFeeType $type - * @return ProductSetupFee - */ - public function setType($type) { - $this->type = $type; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return ProductSetupFee - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class ProductSetupFee implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ProductSetupFee'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'component' => '\Wallee\Sdk\Model\SubscriptionProductComponent', + 'description' => '\Wallee\Sdk\Model\DatabaseTranslatedString', + 'id' => 'int', + 'linked_space_id' => 'int', + 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedString', + 'on_downgrade_credited_amount' => '\Wallee\Sdk\Model\PersistableCurrencyAmount[]', + 'on_upgrade_credited_amount' => '\Wallee\Sdk\Model\PersistableCurrencyAmount[]', + 'setup_fee' => '\Wallee\Sdk\Model\PersistableCurrencyAmount[]', + 'type' => '\Wallee\Sdk\Model\ProductFeeType', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'component' => null, + 'description' => null, + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'name' => null, + 'on_downgrade_credited_amount' => null, + 'on_upgrade_credited_amount' => null, + 'setup_fee' => null, + 'type' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'component' => 'component', + 'description' => 'description', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'on_downgrade_credited_amount' => 'onDowngradeCreditedAmount', + 'on_upgrade_credited_amount' => 'onUpgradeCreditedAmount', + 'setup_fee' => 'setupFee', + 'type' => 'type', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'component' => 'setComponent', + 'description' => 'setDescription', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'on_downgrade_credited_amount' => 'setOnDowngradeCreditedAmount', + 'on_upgrade_credited_amount' => 'setOnUpgradeCreditedAmount', + 'setup_fee' => 'setSetupFee', + 'type' => 'setType', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'component' => 'getComponent', + 'description' => 'getDescription', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'on_downgrade_credited_amount' => 'getOnDowngradeCreditedAmount', + 'on_upgrade_credited_amount' => 'getOnUpgradeCreditedAmount', + 'setup_fee' => 'getSetupFee', + 'type' => 'getType', + 'version' => 'getVersion' + ]; + + + + /** + * 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['component'] = isset($data['component']) ? $data['component'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['on_downgrade_credited_amount'] = isset($data['on_downgrade_credited_amount']) ? $data['on_downgrade_credited_amount'] : null; + + $this->container['on_upgrade_credited_amount'] = isset($data['on_upgrade_credited_amount']) ? $data['on_upgrade_credited_amount'] : null; + + $this->container['setup_fee'] = isset($data['setup_fee']) ? $data['setup_fee'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 component + * + * @return \Wallee\Sdk\Model\SubscriptionProductComponent + */ + public function getComponent() + { + return $this->container['component']; + } + + /** + * Sets component + * + * @param \Wallee\Sdk\Model\SubscriptionProductComponent $component + * + * @return $this + */ + public function setComponent($component) + { + $this->container['component'] = $component; + + return $this; + } + + + /** + * Gets description + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedString + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedString $description The description of a component fee describes the fee to the subscriber. The description may be shown in documents or on certain user interfaces. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedString + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedString $name The name of the fee should describe for the subscriber in few words for what the fee is for. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets on_downgrade_credited_amount + * + * @return \Wallee\Sdk\Model\PersistableCurrencyAmount[] + */ + public function getOnDowngradeCreditedAmount() + { + return $this->container['on_downgrade_credited_amount']; + } + + /** + * Sets on_downgrade_credited_amount + * + * @param \Wallee\Sdk\Model\PersistableCurrencyAmount[] $on_downgrade_credited_amount When the subscription is changed and the change is considered as a downgrade the amount defined by this property will be credited to the subscriber. + * + * @return $this + */ + public function setOnDowngradeCreditedAmount($on_downgrade_credited_amount) + { + $this->container['on_downgrade_credited_amount'] = $on_downgrade_credited_amount; + + return $this; + } + + + /** + * Gets on_upgrade_credited_amount + * + * @return \Wallee\Sdk\Model\PersistableCurrencyAmount[] + */ + public function getOnUpgradeCreditedAmount() + { + return $this->container['on_upgrade_credited_amount']; + } + + /** + * Sets on_upgrade_credited_amount + * + * @param \Wallee\Sdk\Model\PersistableCurrencyAmount[] $on_upgrade_credited_amount When the subscription is changed and the change is considered as a upgrade the amount defined by this property will be credited to the subscriber. + * + * @return $this + */ + public function setOnUpgradeCreditedAmount($on_upgrade_credited_amount) + { + $this->container['on_upgrade_credited_amount'] = $on_upgrade_credited_amount; + + return $this; + } + + + /** + * Gets setup_fee + * + * @return \Wallee\Sdk\Model\PersistableCurrencyAmount[] + */ + public function getSetupFee() + { + return $this->container['setup_fee']; + } + + /** + * Sets setup_fee + * + * @param \Wallee\Sdk\Model\PersistableCurrencyAmount[] $setup_fee The setup fee is charged when the subscriber subscribes to this component. The setup fee is debited with the first charge for the subscriptions. + * + * @return $this + */ + public function setSetupFee($setup_fee) + { + $this->container['setup_fee'] = $setup_fee; + + return $this; + } + + + /** + * Gets type + * + * @return \Wallee\Sdk\Model\ProductFeeType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Wallee\Sdk\Model\ProductFeeType $type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/ProductSetupFeeUpdate.php b/wallee-sdk/lib/Model/ProductSetupFeeUpdate.php index 60b7168..c628ac6 100644 --- a/wallee-sdk/lib/Model/ProductSetupFeeUpdate.php +++ b/wallee-sdk/lib/Model/ProductSetupFeeUpdate.php @@ -1,10 +1,8 @@ 'int', - 'version' => 'int', - 'component' => 'int', - 'description' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', - 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', - 'onDowngradeCreditedAmount' => '\Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[]', - 'onUpgradeCreditedAmount' => '\Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[]', - 'setupFee' => '\Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - /** - * - * - * @var int - */ - private $component; - - /** - * The description of a component fee describes the fee to the subscriber. The description may be shown in documents or on certain user interfaces. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - private $description; - - /** - * The name of the fee should describe for the subscriber in few words for what the fee is for. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - private $name; - - /** - * When the subscription is changed and the change is considered as a downgrade the amount defined by this property will be credited to the subscriber. - * - * @var \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] - */ - private $onDowngradeCreditedAmount; - - /** - * When the subscription is changed and the change is considered as a upgrade the amount defined by this property will be credited to the subscriber. - * - * @var \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] - */ - private $onUpgradeCreditedAmount; - - /** - * The setup fee is charged when the subscriber subscribes to this component. The setup fee is debited with the first charge for the subscriptions. - * - * @var \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] - */ - private $setupFee; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - if (isset($data['component'])) { - $this->setComponent($data['component']); - } - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['onDowngradeCreditedAmount'])) { - $this->setOnDowngradeCreditedAmount($data['onDowngradeCreditedAmount']); - } - if (isset($data['onUpgradeCreditedAmount'])) { - $this->setOnUpgradeCreditedAmount($data['onUpgradeCreditedAmount']); - } - if (isset($data['setupFee'])) { - $this->setSetupFee($data['setupFee']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return ProductSetupFeeUpdate - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return ProductSetupFeeUpdate - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Returns component. - * - * - * - * @return int - */ - public function getComponent() { - return $this->component; - } - - /** - * Sets component. - * - * @param int $component - * @return ProductSetupFeeUpdate - */ - public function setComponent($component) { - $this->component = $component; - - return $this; - } - - /** - * Returns description. - * - * The description of a component fee describes the fee to the subscriber. The description may be shown in documents or on certain user interfaces. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $description - * @return ProductSetupFeeUpdate - */ - public function setDescription($description) { - $this->description = $description; - - return $this; - } - - /** - * Returns name. - * - * The name of the fee should describe for the subscriber in few words for what the fee is for. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $name - * @return ProductSetupFeeUpdate - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns onDowngradeCreditedAmount. - * - * When the subscription is changed and the change is considered as a downgrade the amount defined by this property will be credited to the subscriber. - * - * @return \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] - */ - public function getOnDowngradeCreditedAmount() { - return $this->onDowngradeCreditedAmount; - } - - /** - * Sets onDowngradeCreditedAmount. - * - * @param \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] $onDowngradeCreditedAmount - * @return ProductSetupFeeUpdate - */ - public function setOnDowngradeCreditedAmount($onDowngradeCreditedAmount) { - $this->onDowngradeCreditedAmount = $onDowngradeCreditedAmount; - - return $this; - } - - /** - * Returns onUpgradeCreditedAmount. - * - * When the subscription is changed and the change is considered as a upgrade the amount defined by this property will be credited to the subscriber. - * - * @return \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] - */ - public function getOnUpgradeCreditedAmount() { - return $this->onUpgradeCreditedAmount; - } - - /** - * Sets onUpgradeCreditedAmount. - * - * @param \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] $onUpgradeCreditedAmount - * @return ProductSetupFeeUpdate - */ - public function setOnUpgradeCreditedAmount($onUpgradeCreditedAmount) { - $this->onUpgradeCreditedAmount = $onUpgradeCreditedAmount; - - return $this; - } - - /** - * Returns setupFee. - * - * The setup fee is charged when the subscriber subscribes to this component. The setup fee is debited with the first charge for the subscriptions. - * - * @return \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] - */ - public function getSetupFee() { - return $this->setupFee; - } - - /** - * Sets setupFee. - * - * @param \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] $setupFee - * @return ProductSetupFeeUpdate - */ - public function setSetupFee($setupFee) { - $this->setupFee = $setupFee; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getId() === null) { - throw new ValidationException("'id' can't be null", 'id', $this); - } - if ($this->getVersion() === null) { - throw new ValidationException("'version' can't be null", 'version', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class ProductSetupFeeUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ProductSetupFee.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'version' => 'int', + 'component' => 'int', + 'description' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', + 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', + 'on_downgrade_credited_amount' => '\Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[]', + 'on_upgrade_credited_amount' => '\Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[]', + 'setup_fee' => '\Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64', + 'component' => 'int64', + 'description' => null, + 'name' => null, + 'on_downgrade_credited_amount' => null, + 'on_upgrade_credited_amount' => null, + 'setup_fee' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version', + 'component' => 'component', + 'description' => 'description', + 'name' => 'name', + 'on_downgrade_credited_amount' => 'onDowngradeCreditedAmount', + 'on_upgrade_credited_amount' => 'onUpgradeCreditedAmount', + 'setup_fee' => 'setupFee' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion', + 'component' => 'setComponent', + 'description' => 'setDescription', + 'name' => 'setName', + 'on_downgrade_credited_amount' => 'setOnDowngradeCreditedAmount', + 'on_upgrade_credited_amount' => 'setOnUpgradeCreditedAmount', + 'setup_fee' => 'setSetupFee' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion', + 'component' => 'getComponent', + 'description' => 'getDescription', + 'name' => 'getName', + 'on_downgrade_credited_amount' => 'getOnDowngradeCreditedAmount', + 'on_upgrade_credited_amount' => 'getOnUpgradeCreditedAmount', + 'setup_fee' => 'getSetupFee' + ]; + + + + /** + * 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['version'] = isset($data['version']) ? $data['version'] : null; + + $this->container['component'] = isset($data['component']) ? $data['component'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['on_downgrade_credited_amount'] = isset($data['on_downgrade_credited_amount']) ? $data['on_downgrade_credited_amount'] : null; + + $this->container['on_upgrade_credited_amount'] = isset($data['on_upgrade_credited_amount']) ? $data['on_upgrade_credited_amount'] : null; + + $this->container['setup_fee'] = isset($data['setup_fee']) ? $data['setup_fee'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + + /** + * Gets component + * + * @return int + */ + public function getComponent() + { + return $this->container['component']; + } + + /** + * Sets component + * + * @param int $component + * + * @return $this + */ + public function setComponent($component) + { + $this->container['component'] = $component; + + return $this; + } + + + /** + * Gets description + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $description The description of a component fee describes the fee to the subscriber. The description may be shown in documents or on certain user interfaces. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets name + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $name The name of the fee should describe for the subscriber in few words for what the fee is for. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets on_downgrade_credited_amount + * + * @return \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] + */ + public function getOnDowngradeCreditedAmount() + { + return $this->container['on_downgrade_credited_amount']; + } + + /** + * Sets on_downgrade_credited_amount + * + * @param \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] $on_downgrade_credited_amount When the subscription is changed and the change is considered as a downgrade the amount defined by this property will be credited to the subscriber. + * + * @return $this + */ + public function setOnDowngradeCreditedAmount($on_downgrade_credited_amount) + { + $this->container['on_downgrade_credited_amount'] = $on_downgrade_credited_amount; + + return $this; + } + + + /** + * Gets on_upgrade_credited_amount + * + * @return \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] + */ + public function getOnUpgradeCreditedAmount() + { + return $this->container['on_upgrade_credited_amount']; + } + + /** + * Sets on_upgrade_credited_amount + * + * @param \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] $on_upgrade_credited_amount When the subscription is changed and the change is considered as a upgrade the amount defined by this property will be credited to the subscriber. + * + * @return $this + */ + public function setOnUpgradeCreditedAmount($on_upgrade_credited_amount) + { + $this->container['on_upgrade_credited_amount'] = $on_upgrade_credited_amount; + + return $this; + } + + + /** + * Gets setup_fee + * + * @return \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] + */ + public function getSetupFee() + { + return $this->container['setup_fee']; + } + + /** + * Sets setup_fee + * + * @param \Wallee\Sdk\Model\PersistableCurrencyAmountUpdate[] $setup_fee The setup fee is charged when the subscriber subscribes to this component. The setup fee is debited with the first charge for the subscriptions. + * + * @return $this + */ + public function setSetupFee($setup_fee) + { + $this->container['setup_fee'] = $setup_fee; + + 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/wallee-sdk/lib/Model/Refund.php b/wallee-sdk/lib/Model/Refund.php index d09bf5b..3173078 100644 --- a/wallee-sdk/lib/Model/Refund.php +++ b/wallee-sdk/lib/Model/Refund.php @@ -1,10 +1,8 @@ 'float', - 'baseLineItems' => '\Wallee\Sdk\Model\LineItem[]', - 'createdBy' => 'int', - 'createdOn' => '\DateTime', - 'environment' => '\Wallee\Sdk\Model\Environment', - 'externalId' => 'string', - 'failedOn' => '\DateTime', - 'failureReason' => '\Wallee\Sdk\Model\FailureReason', - 'id' => 'int', - 'labels' => '\Wallee\Sdk\Model\Label[]', - 'language' => 'string', - 'lineItems' => '\Wallee\Sdk\Model\LineItem[]', - 'linkedSpaceId' => 'int', - 'merchantReference' => 'string', - 'nextUpdateOn' => '\DateTime', - 'plannedPurgeDate' => '\DateTime', - 'processorReference' => 'string', - 'reducedLineItems' => '\Wallee\Sdk\Model\LineItem[]', - 'reductions' => '\Wallee\Sdk\Model\LineItemReduction[]', - 'state' => '\Wallee\Sdk\Model\RefundState', - 'succeededOn' => '\DateTime', - 'taxes' => '\Wallee\Sdk\Model\Tax[]', - 'timeoutOn' => '\DateTime', - 'transaction' => '\Wallee\Sdk\Model\Transaction', - 'type' => '\Wallee\Sdk\Model\RefundType', - 'updatedInvoice' => 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var float - */ - private $amount; - - /** - * - * - * @var \Wallee\Sdk\Model\LineItem[] - */ - private $baseLineItems; - - /** - * - * - * @var int - */ - private $createdBy; - - /** - * The created on date indicates the date on which the entity was stored into the database. - * - * @var \DateTime - */ - private $createdOn; - - /** - * - * - * @var \Wallee\Sdk\Model\Environment - */ - private $environment; - - /** - * The external id helps to identify duplicate calls to the refund service. As such the external ID has to be unique per transaction. - * - * @var string - */ - private $externalId; - - /** - * - * - * @var \DateTime - */ - private $failedOn; - - /** - * - * - * @var \Wallee\Sdk\Model\FailureReason - */ - private $failureReason; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var \Wallee\Sdk\Model\Label[] - */ - private $labels; - - /** - * - * - * @var string - */ - private $language; - - /** - * - * - * @var \Wallee\Sdk\Model\LineItem[] - */ - private $lineItems; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * - * - * @var string - */ - private $merchantReference; - - /** - * - * - * @var \DateTime - */ - private $nextUpdateOn; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var string - */ - private $processorReference; - - /** - * - * - * @var \Wallee\Sdk\Model\LineItem[] - */ - private $reducedLineItems; - - /** - * - * - * @var \Wallee\Sdk\Model\LineItemReduction[] - */ - private $reductions; - - /** - * - * - * @var \Wallee\Sdk\Model\RefundState - */ - private $state; - - /** - * - * - * @var \DateTime - */ - private $succeededOn; - - /** - * - * - * @var \Wallee\Sdk\Model\Tax[] - */ - private $taxes; - - /** - * - * - * @var \DateTime - */ - private $timeoutOn; - - /** - * - * - * @var \Wallee\Sdk\Model\Transaction - */ - private $transaction; - - /** - * - * - * @var \Wallee\Sdk\Model\RefundType - */ - private $type; - - /** - * - * - * @var int - */ - private $updatedInvoice; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['baseLineItems'])) { - $this->setBaseLineItems($data['baseLineItems']); - } - if (isset($data['environment'])) { - $this->setEnvironment($data['environment']); - } - if (isset($data['failureReason'])) { - $this->setFailureReason($data['failureReason']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['labels'])) { - $this->setLabels($data['labels']); - } - if (isset($data['lineItems'])) { - $this->setLineItems($data['lineItems']); - } - if (isset($data['reducedLineItems'])) { - $this->setReducedLineItems($data['reducedLineItems']); - } - if (isset($data['reductions'])) { - $this->setReductions($data['reductions']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['taxes'])) { - $this->setTaxes($data['taxes']); - } - if (isset($data['transaction'])) { - $this->setTransaction($data['transaction']); - } - if (isset($data['type'])) { - $this->setType($data['type']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns amount. - * - * - * - * @return float - */ - public function getAmount() { - return $this->amount; - } - - /** - * Sets amount. - * - * @param float $amount - * @return Refund - */ - protected function setAmount($amount) { - $this->amount = $amount; - - return $this; - } - - /** - * Returns baseLineItems. - * - * - * - * @return \Wallee\Sdk\Model\LineItem[] - */ - public function getBaseLineItems() { - return $this->baseLineItems; - } - - /** - * Sets baseLineItems. - * - * @param \Wallee\Sdk\Model\LineItem[] $baseLineItems - * @return Refund - */ - public function setBaseLineItems($baseLineItems) { - $this->baseLineItems = $baseLineItems; - - return $this; - } - - /** - * Returns createdBy. - * - * - * - * @return int - */ - public function getCreatedBy() { - return $this->createdBy; - } - - /** - * Sets createdBy. - * - * @param int $createdBy - * @return Refund - */ - protected function setCreatedBy($createdBy) { - $this->createdBy = $createdBy; - - return $this; - } - - /** - * Returns createdOn. - * - * The created on date indicates the date on which the entity was stored into the database. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return Refund - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns environment. - * - * - * - * @return \Wallee\Sdk\Model\Environment - */ - public function getEnvironment() { - return $this->environment; - } - - /** - * Sets environment. - * - * @param \Wallee\Sdk\Model\Environment $environment - * @return Refund - */ - public function setEnvironment($environment) { - $this->environment = $environment; - - return $this; - } - - /** - * Returns externalId. - * - * The external id helps to identify duplicate calls to the refund service. As such the external ID has to be unique per transaction. - * - * @return string - */ - public function getExternalId() { - return $this->externalId; - } - - /** - * Sets externalId. - * - * @param string $externalId - * @return Refund - */ - protected function setExternalId($externalId) { - $this->externalId = $externalId; - - return $this; - } - - /** - * Returns failedOn. - * - * - * - * @return \DateTime - */ - public function getFailedOn() { - return $this->failedOn; - } - - /** - * Sets failedOn. - * - * @param \DateTime $failedOn - * @return Refund - */ - protected function setFailedOn($failedOn) { - $this->failedOn = $failedOn; - - return $this; - } - - /** - * Returns failureReason. - * - * - * - * @return \Wallee\Sdk\Model\FailureReason - */ - public function getFailureReason() { - return $this->failureReason; - } - - /** - * Sets failureReason. - * - * @param \Wallee\Sdk\Model\FailureReason $failureReason - * @return Refund - */ - public function setFailureReason($failureReason) { - $this->failureReason = $failureReason; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return Refund - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns labels. - * - * - * - * @return \Wallee\Sdk\Model\Label[] - */ - public function getLabels() { - return $this->labels; - } - - /** - * Sets labels. - * - * @param \Wallee\Sdk\Model\Label[] $labels - * @return Refund - */ - public function setLabels($labels) { - $this->labels = $labels; - - return $this; - } - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return Refund - */ - protected function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns lineItems. - * - * - * - * @return \Wallee\Sdk\Model\LineItem[] - */ - public function getLineItems() { - return $this->lineItems; - } - - /** - * Sets lineItems. - * - * @param \Wallee\Sdk\Model\LineItem[] $lineItems - * @return Refund - */ - public function setLineItems($lineItems) { - $this->lineItems = $lineItems; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return Refund - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns merchantReference. - * - * - * - * @return string - */ - public function getMerchantReference() { - return $this->merchantReference; - } - - /** - * Sets merchantReference. - * - * @param string $merchantReference - * @return Refund - */ - protected function setMerchantReference($merchantReference) { - $this->merchantReference = $merchantReference; - - return $this; - } - - /** - * Returns nextUpdateOn. - * - * - * - * @return \DateTime - */ - public function getNextUpdateOn() { - return $this->nextUpdateOn; - } - - /** - * Sets nextUpdateOn. - * - * @param \DateTime $nextUpdateOn - * @return Refund - */ - protected function setNextUpdateOn($nextUpdateOn) { - $this->nextUpdateOn = $nextUpdateOn; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return Refund - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns processorReference. - * - * - * - * @return string - */ - public function getProcessorReference() { - return $this->processorReference; - } - - /** - * Sets processorReference. - * - * @param string $processorReference - * @return Refund - */ - protected function setProcessorReference($processorReference) { - $this->processorReference = $processorReference; - - return $this; - } - - /** - * Returns reducedLineItems. - * - * - * - * @return \Wallee\Sdk\Model\LineItem[] - */ - public function getReducedLineItems() { - return $this->reducedLineItems; - } - - /** - * Sets reducedLineItems. - * - * @param \Wallee\Sdk\Model\LineItem[] $reducedLineItems - * @return Refund - */ - public function setReducedLineItems($reducedLineItems) { - $this->reducedLineItems = $reducedLineItems; - - return $this; - } - - /** - * Returns reductions. - * - * - * - * @return \Wallee\Sdk\Model\LineItemReduction[] - */ - public function getReductions() { - return $this->reductions; - } - - /** - * Sets reductions. - * - * @param \Wallee\Sdk\Model\LineItemReduction[] $reductions - * @return Refund - */ - public function setReductions($reductions) { - $this->reductions = $reductions; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\RefundState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\RefundState $state - * @return Refund - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns succeededOn. - * - * - * - * @return \DateTime - */ - public function getSucceededOn() { - return $this->succeededOn; - } - - /** - * Sets succeededOn. - * - * @param \DateTime $succeededOn - * @return Refund - */ - protected function setSucceededOn($succeededOn) { - $this->succeededOn = $succeededOn; - - return $this; - } - - /** - * Returns taxes. - * - * - * - * @return \Wallee\Sdk\Model\Tax[] - */ - public function getTaxes() { - return $this->taxes; - } - - /** - * Sets taxes. - * - * @param \Wallee\Sdk\Model\Tax[] $taxes - * @return Refund - */ - public function setTaxes($taxes) { - $this->taxes = $taxes; - - return $this; - } - - /** - * Returns timeoutOn. - * - * - * - * @return \DateTime - */ - public function getTimeoutOn() { - return $this->timeoutOn; - } - - /** - * Sets timeoutOn. - * - * @param \DateTime $timeoutOn - * @return Refund - */ - protected function setTimeoutOn($timeoutOn) { - $this->timeoutOn = $timeoutOn; - - return $this; - } - - /** - * Returns transaction. - * - * - * - * @return \Wallee\Sdk\Model\Transaction - */ - public function getTransaction() { - return $this->transaction; - } - - /** - * Sets transaction. - * - * @param \Wallee\Sdk\Model\Transaction $transaction - * @return Refund - */ - public function setTransaction($transaction) { - $this->transaction = $transaction; - - return $this; - } - - /** - * Returns type. - * - * - * - * @return \Wallee\Sdk\Model\RefundType - */ - public function getType() { - return $this->type; - } - - /** - * Sets type. - * - * @param \Wallee\Sdk\Model\RefundType $type - * @return Refund - */ - public function setType($type) { - $this->type = $type; - - return $this; - } - - /** - * Returns updatedInvoice. - * - * - * - * @return int - */ - public function getUpdatedInvoice() { - return $this->updatedInvoice; - } - - /** - * Sets updatedInvoice. - * - * @param int $updatedInvoice - * @return Refund - */ - protected function setUpdatedInvoice($updatedInvoice) { - $this->updatedInvoice = $updatedInvoice; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return Refund - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class Refund implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Refund'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'amount' => 'float', + 'base_line_items' => '\Wallee\Sdk\Model\LineItem[]', + 'completion' => 'int', + 'created_by' => 'int', + 'created_on' => '\DateTime', + 'environment' => '\Wallee\Sdk\Model\Environment', + 'external_id' => 'string', + 'failed_on' => '\DateTime', + 'failure_reason' => '\Wallee\Sdk\Model\FailureReason', + 'id' => 'int', + 'labels' => '\Wallee\Sdk\Model\Label[]', + 'language' => 'string', + 'line_items' => '\Wallee\Sdk\Model\LineItem[]', + 'linked_space_id' => 'int', + 'merchant_reference' => 'string', + 'next_update_on' => '\DateTime', + 'planned_purge_date' => '\DateTime', + 'processing_on' => '\DateTime', + 'processor_reference' => 'string', + 'reduced_line_items' => '\Wallee\Sdk\Model\LineItem[]', + 'reductions' => '\Wallee\Sdk\Model\LineItemReduction[]', + 'state' => '\Wallee\Sdk\Model\RefundState', + 'succeeded_on' => '\DateTime', + 'taxes' => '\Wallee\Sdk\Model\Tax[]', + 'time_zone' => 'string', + 'timeout_on' => '\DateTime', + 'transaction' => '\Wallee\Sdk\Model\Transaction', + 'type' => '\Wallee\Sdk\Model\RefundType', + 'updated_invoice' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'amount' => null, + 'base_line_items' => null, + 'completion' => 'int64', + 'created_by' => 'int64', + 'created_on' => 'date-time', + 'environment' => null, + 'external_id' => null, + 'failed_on' => 'date-time', + 'failure_reason' => null, + 'id' => 'int64', + 'labels' => null, + 'language' => null, + 'line_items' => null, + 'linked_space_id' => 'int64', + 'merchant_reference' => null, + 'next_update_on' => 'date-time', + 'planned_purge_date' => 'date-time', + 'processing_on' => 'date-time', + 'processor_reference' => null, + 'reduced_line_items' => null, + 'reductions' => null, + 'state' => null, + 'succeeded_on' => 'date-time', + 'taxes' => null, + 'time_zone' => null, + 'timeout_on' => 'date-time', + 'transaction' => null, + 'type' => null, + 'updated_invoice' => 'int64', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'base_line_items' => 'baseLineItems', + 'completion' => 'completion', + 'created_by' => 'createdBy', + 'created_on' => 'createdOn', + 'environment' => 'environment', + 'external_id' => 'externalId', + 'failed_on' => 'failedOn', + 'failure_reason' => 'failureReason', + 'id' => 'id', + 'labels' => 'labels', + 'language' => 'language', + 'line_items' => 'lineItems', + 'linked_space_id' => 'linkedSpaceId', + 'merchant_reference' => 'merchantReference', + 'next_update_on' => 'nextUpdateOn', + 'planned_purge_date' => 'plannedPurgeDate', + 'processing_on' => 'processingOn', + 'processor_reference' => 'processorReference', + 'reduced_line_items' => 'reducedLineItems', + 'reductions' => 'reductions', + 'state' => 'state', + 'succeeded_on' => 'succeededOn', + 'taxes' => 'taxes', + 'time_zone' => 'timeZone', + 'timeout_on' => 'timeoutOn', + 'transaction' => 'transaction', + 'type' => 'type', + 'updated_invoice' => 'updatedInvoice', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'base_line_items' => 'setBaseLineItems', + 'completion' => 'setCompletion', + 'created_by' => 'setCreatedBy', + 'created_on' => 'setCreatedOn', + 'environment' => 'setEnvironment', + 'external_id' => 'setExternalId', + 'failed_on' => 'setFailedOn', + 'failure_reason' => 'setFailureReason', + 'id' => 'setId', + 'labels' => 'setLabels', + 'language' => 'setLanguage', + 'line_items' => 'setLineItems', + 'linked_space_id' => 'setLinkedSpaceId', + 'merchant_reference' => 'setMerchantReference', + 'next_update_on' => 'setNextUpdateOn', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'processing_on' => 'setProcessingOn', + 'processor_reference' => 'setProcessorReference', + 'reduced_line_items' => 'setReducedLineItems', + 'reductions' => 'setReductions', + 'state' => 'setState', + 'succeeded_on' => 'setSucceededOn', + 'taxes' => 'setTaxes', + 'time_zone' => 'setTimeZone', + 'timeout_on' => 'setTimeoutOn', + 'transaction' => 'setTransaction', + 'type' => 'setType', + 'updated_invoice' => 'setUpdatedInvoice', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'base_line_items' => 'getBaseLineItems', + 'completion' => 'getCompletion', + 'created_by' => 'getCreatedBy', + 'created_on' => 'getCreatedOn', + 'environment' => 'getEnvironment', + 'external_id' => 'getExternalId', + 'failed_on' => 'getFailedOn', + 'failure_reason' => 'getFailureReason', + 'id' => 'getId', + 'labels' => 'getLabels', + 'language' => 'getLanguage', + 'line_items' => 'getLineItems', + 'linked_space_id' => 'getLinkedSpaceId', + 'merchant_reference' => 'getMerchantReference', + 'next_update_on' => 'getNextUpdateOn', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'processing_on' => 'getProcessingOn', + 'processor_reference' => 'getProcessorReference', + 'reduced_line_items' => 'getReducedLineItems', + 'reductions' => 'getReductions', + 'state' => 'getState', + 'succeeded_on' => 'getSucceededOn', + 'taxes' => 'getTaxes', + 'time_zone' => 'getTimeZone', + 'timeout_on' => 'getTimeoutOn', + 'transaction' => 'getTransaction', + 'type' => 'getType', + 'updated_invoice' => 'getUpdatedInvoice', + 'version' => 'getVersion' + ]; + + + + /** + * 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['amount'] = isset($data['amount']) ? $data['amount'] : null; + + $this->container['base_line_items'] = isset($data['base_line_items']) ? $data['base_line_items'] : null; + + $this->container['completion'] = isset($data['completion']) ? $data['completion'] : null; + + $this->container['created_by'] = isset($data['created_by']) ? $data['created_by'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['environment'] = isset($data['environment']) ? $data['environment'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['failed_on'] = isset($data['failed_on']) ? $data['failed_on'] : null; + + $this->container['failure_reason'] = isset($data['failure_reason']) ? $data['failure_reason'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['labels'] = isset($data['labels']) ? $data['labels'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['line_items'] = isset($data['line_items']) ? $data['line_items'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['merchant_reference'] = isset($data['merchant_reference']) ? $data['merchant_reference'] : null; + + $this->container['next_update_on'] = isset($data['next_update_on']) ? $data['next_update_on'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['processing_on'] = isset($data['processing_on']) ? $data['processing_on'] : null; + + $this->container['processor_reference'] = isset($data['processor_reference']) ? $data['processor_reference'] : null; + + $this->container['reduced_line_items'] = isset($data['reduced_line_items']) ? $data['reduced_line_items'] : null; + + $this->container['reductions'] = isset($data['reductions']) ? $data['reductions'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['succeeded_on'] = isset($data['succeeded_on']) ? $data['succeeded_on'] : null; + + $this->container['taxes'] = isset($data['taxes']) ? $data['taxes'] : null; + + $this->container['time_zone'] = isset($data['time_zone']) ? $data['time_zone'] : null; + + $this->container['timeout_on'] = isset($data['timeout_on']) ? $data['timeout_on'] : null; + + $this->container['transaction'] = isset($data['transaction']) ? $data['transaction'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + $this->container['updated_invoice'] = isset($data['updated_invoice']) ? $data['updated_invoice'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 amount + * + * @return float + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param float $amount + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + + /** + * Gets base_line_items + * + * @return \Wallee\Sdk\Model\LineItem[] + */ + public function getBaseLineItems() + { + return $this->container['base_line_items']; + } + + /** + * Sets base_line_items + * + * @param \Wallee\Sdk\Model\LineItem[] $base_line_items + * + * @return $this + */ + public function setBaseLineItems($base_line_items) + { + $this->container['base_line_items'] = $base_line_items; + + return $this; + } + + + /** + * Gets completion + * + * @return int + */ + public function getCompletion() + { + return $this->container['completion']; + } + + /** + * Sets completion + * + * @param int $completion + * + * @return $this + */ + public function setCompletion($completion) + { + $this->container['completion'] = $completion; + + return $this; + } + + + /** + * Gets created_by + * + * @return int + */ + public function getCreatedBy() + { + return $this->container['created_by']; + } + + /** + * Sets created_by + * + * @param int $created_by + * + * @return $this + */ + public function setCreatedBy($created_by) + { + $this->container['created_by'] = $created_by; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets environment + * + * @return \Wallee\Sdk\Model\Environment + */ + public function getEnvironment() + { + return $this->container['environment']; + } + + /** + * Sets environment + * + * @param \Wallee\Sdk\Model\Environment $environment + * + * @return $this + */ + public function setEnvironment($environment) + { + $this->container['environment'] = $environment; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id helps to identify duplicate calls to the refund service. As such the external ID has to be unique per transaction. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets failed_on + * + * @return \DateTime + */ + public function getFailedOn() + { + return $this->container['failed_on']; + } + + /** + * Sets failed_on + * + * @param \DateTime $failed_on + * + * @return $this + */ + public function setFailedOn($failed_on) + { + $this->container['failed_on'] = $failed_on; + + return $this; + } + + + /** + * Gets failure_reason + * + * @return \Wallee\Sdk\Model\FailureReason + */ + public function getFailureReason() + { + return $this->container['failure_reason']; + } + + /** + * Sets failure_reason + * + * @param \Wallee\Sdk\Model\FailureReason $failure_reason + * + * @return $this + */ + public function setFailureReason($failure_reason) + { + $this->container['failure_reason'] = $failure_reason; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets labels + * + * @return \Wallee\Sdk\Model\Label[] + */ + public function getLabels() + { + return $this->container['labels']; + } + + /** + * Sets labels + * + * @param \Wallee\Sdk\Model\Label[] $labels + * + * @return $this + */ + public function setLabels($labels) + { + $this->container['labels'] = $labels; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets line_items + * + * @return \Wallee\Sdk\Model\LineItem[] + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Wallee\Sdk\Model\LineItem[] $line_items + * + * @return $this + */ + public function setLineItems($line_items) + { + $this->container['line_items'] = $line_items; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets merchant_reference + * + * @return string + */ + public function getMerchantReference() + { + return $this->container['merchant_reference']; + } + + /** + * Sets merchant_reference + * + * @param string $merchant_reference + * + * @return $this + */ + public function setMerchantReference($merchant_reference) + { + $this->container['merchant_reference'] = $merchant_reference; + + return $this; + } + + + /** + * Gets next_update_on + * + * @return \DateTime + */ + public function getNextUpdateOn() + { + return $this->container['next_update_on']; + } + + /** + * Sets next_update_on + * + * @param \DateTime $next_update_on + * + * @return $this + */ + public function setNextUpdateOn($next_update_on) + { + $this->container['next_update_on'] = $next_update_on; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets processing_on + * + * @return \DateTime + */ + public function getProcessingOn() + { + return $this->container['processing_on']; + } + + /** + * Sets processing_on + * + * @param \DateTime $processing_on + * + * @return $this + */ + public function setProcessingOn($processing_on) + { + $this->container['processing_on'] = $processing_on; + + return $this; + } + + + /** + * Gets processor_reference + * + * @return string + */ + public function getProcessorReference() + { + return $this->container['processor_reference']; + } + + /** + * Sets processor_reference + * + * @param string $processor_reference + * + * @return $this + */ + public function setProcessorReference($processor_reference) + { + $this->container['processor_reference'] = $processor_reference; + + return $this; + } + + + /** + * Gets reduced_line_items + * + * @return \Wallee\Sdk\Model\LineItem[] + */ + public function getReducedLineItems() + { + return $this->container['reduced_line_items']; + } + + /** + * Sets reduced_line_items + * + * @param \Wallee\Sdk\Model\LineItem[] $reduced_line_items + * + * @return $this + */ + public function setReducedLineItems($reduced_line_items) + { + $this->container['reduced_line_items'] = $reduced_line_items; + + return $this; + } + + + /** + * Gets reductions + * + * @return \Wallee\Sdk\Model\LineItemReduction[] + */ + public function getReductions() + { + return $this->container['reductions']; + } + + /** + * Sets reductions + * + * @param \Wallee\Sdk\Model\LineItemReduction[] $reductions + * + * @return $this + */ + public function setReductions($reductions) + { + $this->container['reductions'] = $reductions; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\RefundState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\RefundState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets succeeded_on + * + * @return \DateTime + */ + public function getSucceededOn() + { + return $this->container['succeeded_on']; + } + + /** + * Sets succeeded_on + * + * @param \DateTime $succeeded_on + * + * @return $this + */ + public function setSucceededOn($succeeded_on) + { + $this->container['succeeded_on'] = $succeeded_on; + + return $this; + } + + + /** + * Gets taxes + * + * @return \Wallee\Sdk\Model\Tax[] + */ + public function getTaxes() + { + return $this->container['taxes']; + } + + /** + * Sets taxes + * + * @param \Wallee\Sdk\Model\Tax[] $taxes + * + * @return $this + */ + public function setTaxes($taxes) + { + $this->container['taxes'] = $taxes; + + return $this; + } + + + /** + * Gets time_zone + * + * @return string + */ + public function getTimeZone() + { + return $this->container['time_zone']; + } + + /** + * Sets time_zone + * + * @param string $time_zone + * + * @return $this + */ + public function setTimeZone($time_zone) + { + $this->container['time_zone'] = $time_zone; + + return $this; + } + + + /** + * Gets timeout_on + * + * @return \DateTime + */ + public function getTimeoutOn() + { + return $this->container['timeout_on']; + } + + /** + * Sets timeout_on + * + * @param \DateTime $timeout_on + * + * @return $this + */ + public function setTimeoutOn($timeout_on) + { + $this->container['timeout_on'] = $timeout_on; + + return $this; + } + + + /** + * Gets transaction + * + * @return \Wallee\Sdk\Model\Transaction + */ + public function getTransaction() + { + return $this->container['transaction']; + } + + /** + * Sets transaction + * + * @param \Wallee\Sdk\Model\Transaction $transaction + * + * @return $this + */ + public function setTransaction($transaction) + { + $this->container['transaction'] = $transaction; + + return $this; + } + + + /** + * Gets type + * + * @return \Wallee\Sdk\Model\RefundType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Wallee\Sdk\Model\RefundType $type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + + /** + * Gets updated_invoice + * + * @return int + */ + public function getUpdatedInvoice() + { + return $this->container['updated_invoice']; + } + + /** + * Sets updated_invoice + * + * @param int $updated_invoice + * + * @return $this + */ + public function setUpdatedInvoice($updated_invoice) + { + $this->container['updated_invoice'] = $updated_invoice; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/RefundComment.php b/wallee-sdk/lib/Model/RefundComment.php new file mode 100644 index 0000000..4a78f0d --- /dev/null +++ b/wallee-sdk/lib/Model/RefundComment.php @@ -0,0 +1,586 @@ + 'string', + 'created_by' => 'int', + 'created_on' => '\DateTime', + 'edited_by' => 'int', + 'edited_on' => '\DateTime', + 'id' => 'int', + 'linked_space_id' => 'int', + 'pinned' => 'bool', + 'refund' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'content' => null, + 'created_by' => 'int64', + 'created_on' => 'date-time', + 'edited_by' => 'int64', + 'edited_on' => 'date-time', + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'pinned' => null, + 'refund' => 'int64', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'content' => 'content', + 'created_by' => 'createdBy', + 'created_on' => 'createdOn', + 'edited_by' => 'editedBy', + 'edited_on' => 'editedOn', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'pinned' => 'pinned', + 'refund' => 'refund', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent', + 'created_by' => 'setCreatedBy', + 'created_on' => 'setCreatedOn', + 'edited_by' => 'setEditedBy', + 'edited_on' => 'setEditedOn', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'pinned' => 'setPinned', + 'refund' => 'setRefund', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent', + 'created_by' => 'getCreatedBy', + 'created_on' => 'getCreatedOn', + 'edited_by' => 'getEditedBy', + 'edited_on' => 'getEditedOn', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'pinned' => 'getPinned', + 'refund' => 'getRefund', + 'version' => 'getVersion' + ]; + + + + /** + * 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['created_by'] = isset($data['created_by']) ? $data['created_by'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['edited_by'] = isset($data['edited_by']) ? $data['edited_by'] : null; + + $this->container['edited_on'] = isset($data['edited_on']) ? $data['edited_on'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['pinned'] = isset($data['pinned']) ? $data['pinned'] : null; + + $this->container['refund'] = isset($data['refund']) ? $data['refund'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content + * + * @return $this + */ + public function setContent($content) + { + $this->container['content'] = $content; + + return $this; + } + + + /** + * Gets created_by + * + * @return int + */ + public function getCreatedBy() + { + return $this->container['created_by']; + } + + /** + * Sets created_by + * + * @param int $created_by + * + * @return $this + */ + public function setCreatedBy($created_by) + { + $this->container['created_by'] = $created_by; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets edited_by + * + * @return int + */ + public function getEditedBy() + { + return $this->container['edited_by']; + } + + /** + * Sets edited_by + * + * @param int $edited_by + * + * @return $this + */ + public function setEditedBy($edited_by) + { + $this->container['edited_by'] = $edited_by; + + return $this; + } + + + /** + * Gets edited_on + * + * @return \DateTime + */ + public function getEditedOn() + { + return $this->container['edited_on']; + } + + /** + * Sets edited_on + * + * @param \DateTime $edited_on The date on which the comment was last edited. + * + * @return $this + */ + public function setEditedOn($edited_on) + { + $this->container['edited_on'] = $edited_on; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets pinned + * + * @return bool + */ + public function getPinned() + { + return $this->container['pinned']; + } + + /** + * Sets pinned + * + * @param bool $pinned + * + * @return $this + */ + public function setPinned($pinned) + { + $this->container['pinned'] = $pinned; + + return $this; + } + + + /** + * Gets refund + * + * @return int + */ + public function getRefund() + { + return $this->container['refund']; + } + + /** + * Sets refund + * + * @param int $refund + * + * @return $this + */ + public function setRefund($refund) + { + $this->container['refund'] = $refund; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/RefundCommentActive.php b/wallee-sdk/lib/Model/RefundCommentActive.php new file mode 100644 index 0000000..8c2fdb8 --- /dev/null +++ b/wallee-sdk/lib/Model/RefundCommentActive.php @@ -0,0 +1,330 @@ + 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/RefundCommentCreate.php b/wallee-sdk/lib/Model/RefundCommentCreate.php new file mode 100644 index 0000000..8bd2bdd --- /dev/null +++ b/wallee-sdk/lib/Model/RefundCommentCreate.php @@ -0,0 +1,295 @@ + 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'refund' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'refund' => 'refund' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'refund' => 'setRefund' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'refund' => 'getRefund' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['refund'] = isset($data['refund']) ? $data['refund'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['refund'] === null) { + $invalidProperties[] = "'refund' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 refund + * + * @return int + */ + public function getRefund() + { + return $this->container['refund']; + } + + /** + * Sets refund + * + * @param int $refund + * + * @return $this + */ + public function setRefund($refund) + { + $this->container['refund'] = $refund; + + 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/wallee-sdk/lib/Model/RefundCreate.php b/wallee-sdk/lib/Model/RefundCreate.php index 8e6996d..9011bb9 100644 --- a/wallee-sdk/lib/Model/RefundCreate.php +++ b/wallee-sdk/lib/Model/RefundCreate.php @@ -1,10 +1,8 @@ 'string', - 'merchantReference' => 'string', - 'reductions' => '\Wallee\Sdk\Model\LineItemReductionCreate[]', - 'transaction' => 'int', - 'type' => '\Wallee\Sdk\Model\RefundType' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The external id helps to identify duplicate calls to the refund service. As such the external ID has to be unique per transaction. - * - * @var string - */ - private $externalId; - - /** - * - * - * @var string - */ - private $merchantReference; - - /** - * - * - * @var \Wallee\Sdk\Model\LineItemReductionCreate[] - */ - private $reductions; - - /** - * - * - * @var int - */ - private $transaction; - - /** - * - * - * @var \Wallee\Sdk\Model\RefundType - */ - private $type; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['externalId'])) { - $this->setExternalId($data['externalId']); - } - if (isset($data['merchantReference'])) { - $this->setMerchantReference($data['merchantReference']); - } - if (isset($data['reductions'])) { - $this->setReductions($data['reductions']); - } - if (isset($data['transaction'])) { - $this->setTransaction($data['transaction']); - } - if (isset($data['type'])) { - $this->setType($data['type']); - } - } - - - /** - * Returns externalId. - * - * The external id helps to identify duplicate calls to the refund service. As such the external ID has to be unique per transaction. - * - * @return string - */ - public function getExternalId() { - return $this->externalId; - } - - /** - * Sets externalId. - * - * @param string $externalId - * @return RefundCreate - */ - public function setExternalId($externalId) { - $this->externalId = $externalId; - - return $this; - } - - /** - * Returns merchantReference. - * - * - * - * @return string - */ - public function getMerchantReference() { - return $this->merchantReference; - } - - /** - * Sets merchantReference. - * - * @param string $merchantReference - * @return RefundCreate - */ - public function setMerchantReference($merchantReference) { - $this->merchantReference = $merchantReference; - - return $this; - } - - /** - * Returns reductions. - * - * - * - * @return \Wallee\Sdk\Model\LineItemReductionCreate[] - */ - public function getReductions() { - return $this->reductions; - } - - /** - * Sets reductions. - * - * @param \Wallee\Sdk\Model\LineItemReductionCreate[] $reductions - * @return RefundCreate - */ - public function setReductions($reductions) { - $this->reductions = $reductions; - - return $this; - } - - /** - * Returns transaction. - * - * - * - * @return int - */ - public function getTransaction() { - return $this->transaction; - } - - /** - * Sets transaction. - * - * @param int $transaction - * @return RefundCreate - */ - public function setTransaction($transaction) { - $this->transaction = $transaction; - - return $this; - } - - /** - * Returns type. - * - * - * - * @return \Wallee\Sdk\Model\RefundType - */ - public function getType() { - return $this->type; - } - - /** - * Sets type. - * - * @param \Wallee\Sdk\Model\RefundType $type - * @return RefundCreate - */ - public function setType($type) { - $this->type = $type; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getExternalId() === null) { - throw new ValidationException("'externalId' can't be null", 'externalId', $this); - } - if ($this->getReductions() === null) { - throw new ValidationException("'reductions' can't be null", 'reductions', $this); - } - if ($this->getTransaction() === null) { - throw new ValidationException("'transaction' can't be null", 'transaction', $this); - } - if ($this->getType() === null) { - throw new ValidationException("'type' can't be null", 'type', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class RefundCreate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Refund.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'completion' => 'int', + 'external_id' => 'string', + 'merchant_reference' => 'string', + 'reductions' => '\Wallee\Sdk\Model\LineItemReductionCreate[]', + 'transaction' => 'int', + 'type' => '\Wallee\Sdk\Model\RefundType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'completion' => 'int64', + 'external_id' => null, + 'merchant_reference' => null, + 'reductions' => null, + 'transaction' => 'int64', + 'type' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'completion' => 'completion', + 'external_id' => 'externalId', + 'merchant_reference' => 'merchantReference', + 'reductions' => 'reductions', + 'transaction' => 'transaction', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'completion' => 'setCompletion', + 'external_id' => 'setExternalId', + 'merchant_reference' => 'setMerchantReference', + 'reductions' => 'setReductions', + 'transaction' => 'setTransaction', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'completion' => 'getCompletion', + 'external_id' => 'getExternalId', + 'merchant_reference' => 'getMerchantReference', + 'reductions' => 'getReductions', + 'transaction' => 'getTransaction', + 'type' => 'getType' + ]; + + + + /** + * 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['completion'] = isset($data['completion']) ? $data['completion'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['merchant_reference'] = isset($data['merchant_reference']) ? $data['merchant_reference'] : null; + + $this->container['reductions'] = isset($data['reductions']) ? $data['reductions'] : null; + + $this->container['transaction'] = isset($data['transaction']) ? $data['transaction'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['external_id'] === null) { + $invalidProperties[] = "'external_id' can't be null"; + } + if ($this->container['reductions'] === null) { + $invalidProperties[] = "'reductions' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 completion + * + * @return int + */ + public function getCompletion() + { + return $this->container['completion']; + } + + /** + * Sets completion + * + * @param int $completion + * + * @return $this + */ + public function setCompletion($completion) + { + $this->container['completion'] = $completion; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id helps to identify duplicate calls to the refund service. As such the external ID has to be unique per transaction. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets merchant_reference + * + * @return string + */ + public function getMerchantReference() + { + return $this->container['merchant_reference']; + } + + /** + * Sets merchant_reference + * + * @param string $merchant_reference + * + * @return $this + */ + public function setMerchantReference($merchant_reference) + { + $this->container['merchant_reference'] = $merchant_reference; + + return $this; + } + + + /** + * Gets reductions + * + * @return \Wallee\Sdk\Model\LineItemReductionCreate[] + */ + public function getReductions() + { + return $this->container['reductions']; + } + + /** + * Sets reductions + * + * @param \Wallee\Sdk\Model\LineItemReductionCreate[] $reductions + * + * @return $this + */ + public function setReductions($reductions) + { + $this->container['reductions'] = $reductions; + + return $this; + } + + + /** + * Gets transaction + * + * @return int + */ + public function getTransaction() + { + return $this->container['transaction']; + } + + /** + * Sets transaction + * + * @param int $transaction + * + * @return $this + */ + public function setTransaction($transaction) + { + $this->container['transaction'] = $transaction; + + return $this; + } + + + /** + * Gets type + * + * @return \Wallee\Sdk\Model\RefundType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Wallee\Sdk\Model\RefundType $type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + 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/wallee-sdk/lib/Model/RefundState.php b/wallee-sdk/lib/Model/RefundState.php index 964dd0d..57d311c 100644 --- a/wallee-sdk/lib/Model/RefundState.php +++ b/wallee-sdk/lib/Model/RefundState.php @@ -1,10 +1,8 @@ 'string', - 'documentTemplateType' => 'int', - 'mimeType' => 'string', - 'title' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var string - */ - private $data; - - /** - * - * - * @var int - */ - private $documentTemplateType; - - /** - * - * - * @var string - */ - private $mimeType; - - /** - * - * - * @var string - */ - private $title; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['data'])) { - $this->setData($data['data']); - } - } - - - /** - * Returns data. - * - * - * - * @return string - */ - public function getData() { - return $this->data; - } - - /** - * Sets data. - * - * @param string $data - * @return RenderedDocument - */ - public function setData($data) { - $this->data = $data; - - return $this; - } - - /** - * Returns documentTemplateType. - * - * - * - * @return int - */ - public function getDocumentTemplateType() { - return $this->documentTemplateType; - } - - /** - * Sets documentTemplateType. - * - * @param int $documentTemplateType - * @return RenderedDocument - */ - protected function setDocumentTemplateType($documentTemplateType) { - $this->documentTemplateType = $documentTemplateType; - - return $this; - } - - /** - * Returns mimeType. - * - * - * - * @return string - */ - public function getMimeType() { - return $this->mimeType; - } - - /** - * Sets mimeType. - * - * @param string $mimeType - * @return RenderedDocument - */ - protected function setMimeType($mimeType) { - $this->mimeType = $mimeType; - - return $this; - } - - /** - * Returns title. - * - * - * - * @return string - */ - public function getTitle() { - return $this->title; - } - - /** - * Sets title. - * - * @param string $title - * @return RenderedDocument - */ - protected function setTitle($title) { - $this->title = $title; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class RenderedDocument implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'RenderedDocument'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'data' => 'string[]', + 'document_template_type' => 'int', + 'mime_type' => 'string', + 'title' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'data' => 'byte', + 'document_template_type' => 'int64', + 'mime_type' => null, + 'title' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'document_template_type' => 'documentTemplateType', + 'mime_type' => 'mimeType', + 'title' => 'title' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'document_template_type' => 'setDocumentTemplateType', + 'mime_type' => 'setMimeType', + 'title' => 'setTitle' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'document_template_type' => 'getDocumentTemplateType', + 'mime_type' => 'getMimeType', + 'title' => 'getTitle' + ]; + + + + /** + * 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['data'] = isset($data['data']) ? $data['data'] : null; + + $this->container['document_template_type'] = isset($data['document_template_type']) ? $data['document_template_type'] : null; + + $this->container['mime_type'] = isset($data['mime_type']) ? $data['mime_type'] : null; + + $this->container['title'] = isset($data['title']) ? $data['title'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 data + * + * @return string[] + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param string[] $data + * + * @return $this + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + + + /** + * Gets document_template_type + * + * @return int + */ + public function getDocumentTemplateType() + { + return $this->container['document_template_type']; + } + + /** + * Sets document_template_type + * + * @param int $document_template_type + * + * @return $this + */ + public function setDocumentTemplateType($document_template_type) + { + $this->container['document_template_type'] = $document_template_type; + + return $this; + } + + + /** + * Gets mime_type + * + * @return string + */ + public function getMimeType() + { + return $this->container['mime_type']; + } + + /** + * Sets mime_type + * + * @param string $mime_type + * + * @return $this + */ + public function setMimeType($mime_type) + { + $this->container['mime_type'] = $mime_type; + + return $this; + } + + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title + * + * @return $this + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + 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/wallee-sdk/lib/Model/ResourceState.php b/wallee-sdk/lib/Model/ResourceState.php index e054b76..aab6b93 100644 --- a/wallee-sdk/lib/Model/ResourceState.php +++ b/wallee-sdk/lib/Model/ResourceState.php @@ -1,10 +1,8 @@ 'string[]', - 'postCodeRegex' => 'string', - 'requiredFields' => '\Wallee\Sdk\Model\RestAddressFormatField[]', - 'usedFields' => '\Wallee\Sdk\Model\RestAddressFormatField[]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The example post codes allow the user to understand what we expect here. - * - * @var string[] - */ - private $postCodeExamples; - - /** - * The post code regex is a regular expression which can validates the input of the post code. - * - * @var string - */ - private $postCodeRegex; - - /** - * The required fields indicate what fields are required within an address to comply with the address format. - * - * @var \Wallee\Sdk\Model\RestAddressFormatField[] - */ - private $requiredFields; - - /** - * The used fields indicate what fields are used within this address format. - * - * @var \Wallee\Sdk\Model\RestAddressFormatField[] - */ - private $usedFields; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['postCodeExamples'])) { - $this->setPostCodeExamples($data['postCodeExamples']); - } - if (isset($data['requiredFields'])) { - $this->setRequiredFields($data['requiredFields']); - } - if (isset($data['usedFields'])) { - $this->setUsedFields($data['usedFields']); - } - } - - - /** - * Returns postCodeExamples. - * - * The example post codes allow the user to understand what we expect here. - * - * @return string[] - */ - public function getPostCodeExamples() { - return $this->postCodeExamples; - } - - /** - * Sets postCodeExamples. - * - * @param string[] $postCodeExamples - * @return RestAddressFormat - */ - public function setPostCodeExamples($postCodeExamples) { - $this->postCodeExamples = $postCodeExamples; - - return $this; - } - - /** - * Returns postCodeRegex. - * - * The post code regex is a regular expression which can validates the input of the post code. - * - * @return string - */ - public function getPostCodeRegex() { - return $this->postCodeRegex; - } - - /** - * Sets postCodeRegex. - * - * @param string $postCodeRegex - * @return RestAddressFormat - */ - protected function setPostCodeRegex($postCodeRegex) { - $this->postCodeRegex = $postCodeRegex; - - return $this; - } - - /** - * Returns requiredFields. - * - * The required fields indicate what fields are required within an address to comply with the address format. - * - * @return \Wallee\Sdk\Model\RestAddressFormatField[] - */ - public function getRequiredFields() { - return $this->requiredFields; - } - - /** - * Sets requiredFields. - * - * @param \Wallee\Sdk\Model\RestAddressFormatField[] $requiredFields - * @return RestAddressFormat - */ - public function setRequiredFields($requiredFields) { - $this->requiredFields = $requiredFields; - - return $this; - } - - /** - * Returns usedFields. - * - * The used fields indicate what fields are used within this address format. - * - * @return \Wallee\Sdk\Model\RestAddressFormatField[] - */ - public function getUsedFields() { - return $this->usedFields; - } - - /** - * Sets usedFields. - * - * @param \Wallee\Sdk\Model\RestAddressFormatField[] $usedFields - * @return RestAddressFormat - */ - public function setUsedFields($usedFields) { - $this->usedFields = $usedFields; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class RestAddressFormat implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'RestAddressFormat'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'post_code_examples' => 'string[]', + 'post_code_regex' => 'string', + 'required_fields' => '\Wallee\Sdk\Model\RestAddressFormatField[]', + 'used_fields' => '\Wallee\Sdk\Model\RestAddressFormatField[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'post_code_examples' => null, + 'post_code_regex' => null, + 'required_fields' => null, + 'used_fields' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'post_code_examples' => 'postCodeExamples', + 'post_code_regex' => 'postCodeRegex', + 'required_fields' => 'requiredFields', + 'used_fields' => 'usedFields' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'post_code_examples' => 'setPostCodeExamples', + 'post_code_regex' => 'setPostCodeRegex', + 'required_fields' => 'setRequiredFields', + 'used_fields' => 'setUsedFields' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'post_code_examples' => 'getPostCodeExamples', + 'post_code_regex' => 'getPostCodeRegex', + 'required_fields' => 'getRequiredFields', + 'used_fields' => 'getUsedFields' + ]; + + + + /** + * 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['post_code_examples'] = isset($data['post_code_examples']) ? $data['post_code_examples'] : null; + + $this->container['post_code_regex'] = isset($data['post_code_regex']) ? $data['post_code_regex'] : null; + + $this->container['required_fields'] = isset($data['required_fields']) ? $data['required_fields'] : null; + + $this->container['used_fields'] = isset($data['used_fields']) ? $data['used_fields'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 post_code_examples + * + * @return string[] + */ + public function getPostCodeExamples() + { + return $this->container['post_code_examples']; + } + + /** + * Sets post_code_examples + * + * @param string[] $post_code_examples The example post codes allow the user to understand what we expect here. + * + * @return $this + */ + public function setPostCodeExamples($post_code_examples) + { + $this->container['post_code_examples'] = $post_code_examples; + + return $this; + } + + + /** + * Gets post_code_regex + * + * @return string + */ + public function getPostCodeRegex() + { + return $this->container['post_code_regex']; + } + + /** + * Sets post_code_regex + * + * @param string $post_code_regex The post code regex is a regular expression which can validates the input of the post code. + * + * @return $this + */ + public function setPostCodeRegex($post_code_regex) + { + $this->container['post_code_regex'] = $post_code_regex; + + return $this; + } + + + /** + * Gets required_fields + * + * @return \Wallee\Sdk\Model\RestAddressFormatField[] + */ + public function getRequiredFields() + { + return $this->container['required_fields']; + } + + /** + * Sets required_fields + * + * @param \Wallee\Sdk\Model\RestAddressFormatField[] $required_fields The required fields indicate what fields are required within an address to comply with the address format. + * + * @return $this + */ + public function setRequiredFields($required_fields) + { + $this->container['required_fields'] = $required_fields; + + return $this; + } + + + /** + * Gets used_fields + * + * @return \Wallee\Sdk\Model\RestAddressFormatField[] + */ + public function getUsedFields() + { + return $this->container['used_fields']; + } + + /** + * Sets used_fields + * + * @param \Wallee\Sdk\Model\RestAddressFormatField[] $used_fields The used fields indicate what fields are used within this address format. + * + * @return $this + */ + public function setUsedFields($used_fields) + { + $this->container['used_fields'] = $used_fields; + + 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/wallee-sdk/lib/Model/RestAddressFormatField.php b/wallee-sdk/lib/Model/RestAddressFormatField.php index d16ecae..0ce844b 100644 --- a/wallee-sdk/lib/Model/RestAddressFormatField.php +++ b/wallee-sdk/lib/Model/RestAddressFormatField.php @@ -1,10 +1,8 @@ 'string', - 'iSOCode3Letter' => 'string', - 'addressFormat' => '\Wallee\Sdk\Model\RestAddressFormat', - 'name' => 'string', - 'numericCode' => 'string', - 'stateCodes' => 'string[]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ISO code 2 letter identifies the country by two chars as defined in ISO 3166-1 (e.g. US, DE, CH). - * - * @var string - */ - private $iSOCode2Letter; - - /** - * The ISO code 3 letter identifies the country by three chars as defined in ISO 3166-1 (e.g. CHE, USA, GBR). - * - * @var string - */ - private $iSOCode3Letter; - - /** - * The address format of the country indicates how an address has to look like for the country. - * - * @var \Wallee\Sdk\Model\RestAddressFormat - */ - private $addressFormat; - - /** - * The name labels the country by a name in English. - * - * @var string - */ - private $name; - - /** - * The numeric code identifies the country by a three digit number as defined in ISO 3166-1 (e.g. 840, 826, 756). - * - * @var string - */ - private $numericCode; - - /** - * The state codes field is a list of all states associated with this country. The list contains the identifiers of the states. The identifiers corresponds to the ISO 3166-2 subdivision identifier. - * - * @var string[] - */ - private $stateCodes; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['addressFormat'])) { - $this->setAddressFormat($data['addressFormat']); - } - if (isset($data['stateCodes'])) { - $this->setStateCodes($data['stateCodes']); - } - } - - - /** - * Returns iSOCode2Letter. - * - * The ISO code 2 letter identifies the country by two chars as defined in ISO 3166-1 (e.g. US, DE, CH). - * - * @return string - */ - public function getISOCode2Letter() { - return $this->iSOCode2Letter; - } - - /** - * Sets iSOCode2Letter. - * - * @param string $iSOCode2Letter - * @return RestCountry - */ - protected function setISOCode2Letter($iSOCode2Letter) { - $this->iSOCode2Letter = $iSOCode2Letter; - - return $this; - } - - /** - * Returns iSOCode3Letter. - * - * The ISO code 3 letter identifies the country by three chars as defined in ISO 3166-1 (e.g. CHE, USA, GBR). - * - * @return string - */ - public function getISOCode3Letter() { - return $this->iSOCode3Letter; - } - - /** - * Sets iSOCode3Letter. - * - * @param string $iSOCode3Letter - * @return RestCountry - */ - protected function setISOCode3Letter($iSOCode3Letter) { - $this->iSOCode3Letter = $iSOCode3Letter; - - return $this; - } - - /** - * Returns addressFormat. - * - * The address format of the country indicates how an address has to look like for the country. - * - * @return \Wallee\Sdk\Model\RestAddressFormat - */ - public function getAddressFormat() { - return $this->addressFormat; - } - - /** - * Sets addressFormat. - * - * @param \Wallee\Sdk\Model\RestAddressFormat $addressFormat - * @return RestCountry - */ - public function setAddressFormat($addressFormat) { - $this->addressFormat = $addressFormat; - - return $this; - } - - /** - * Returns name. - * - * The name labels the country by a name in English. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return RestCountry - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns numericCode. - * - * The numeric code identifies the country by a three digit number as defined in ISO 3166-1 (e.g. 840, 826, 756). - * - * @return string - */ - public function getNumericCode() { - return $this->numericCode; - } - - /** - * Sets numericCode. - * - * @param string $numericCode - * @return RestCountry - */ - protected function setNumericCode($numericCode) { - $this->numericCode = $numericCode; - - return $this; - } - - /** - * Returns stateCodes. - * - * The state codes field is a list of all states associated with this country. The list contains the identifiers of the states. The identifiers corresponds to the ISO 3166-2 subdivision identifier. - * - * @return string[] - */ - public function getStateCodes() { - return $this->stateCodes; - } - - /** - * Sets stateCodes. - * - * @param string[] $stateCodes - * @return RestCountry - */ - public function setStateCodes($stateCodes) { - $this->stateCodes = $stateCodes; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class RestCountry implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'RestCountry'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'iso_code2_letter' => 'string', + 'iso_code3_letter' => 'string', + 'address_format' => '\Wallee\Sdk\Model\RestAddressFormat', + 'name' => 'string', + 'numeric_code' => 'string', + 'state_codes' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'iso_code2_letter' => null, + 'iso_code3_letter' => null, + 'address_format' => null, + 'name' => null, + 'numeric_code' => null, + 'state_codes' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'iso_code2_letter' => 'ISOCode2Letter', + 'iso_code3_letter' => 'ISOCode3Letter', + 'address_format' => 'addressFormat', + 'name' => 'name', + 'numeric_code' => 'numericCode', + 'state_codes' => 'stateCodes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'iso_code2_letter' => 'setIsoCode2Letter', + 'iso_code3_letter' => 'setIsoCode3Letter', + 'address_format' => 'setAddressFormat', + 'name' => 'setName', + 'numeric_code' => 'setNumericCode', + 'state_codes' => 'setStateCodes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'iso_code2_letter' => 'getIsoCode2Letter', + 'iso_code3_letter' => 'getIsoCode3Letter', + 'address_format' => 'getAddressFormat', + 'name' => 'getName', + 'numeric_code' => 'getNumericCode', + 'state_codes' => 'getStateCodes' + ]; + + + + /** + * 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['iso_code2_letter'] = isset($data['iso_code2_letter']) ? $data['iso_code2_letter'] : null; + + $this->container['iso_code3_letter'] = isset($data['iso_code3_letter']) ? $data['iso_code3_letter'] : null; + + $this->container['address_format'] = isset($data['address_format']) ? $data['address_format'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['numeric_code'] = isset($data['numeric_code']) ? $data['numeric_code'] : null; + + $this->container['state_codes'] = isset($data['state_codes']) ? $data['state_codes'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 iso_code2_letter + * + * @return string + */ + public function getIsoCode2Letter() + { + return $this->container['iso_code2_letter']; + } + + /** + * Sets iso_code2_letter + * + * @param string $iso_code2_letter The ISO code 2 letter identifies the country by two chars as defined in ISO 3166-1 (e.g. US, DE, CH). + * + * @return $this + */ + public function setIsoCode2Letter($iso_code2_letter) + { + $this->container['iso_code2_letter'] = $iso_code2_letter; + + return $this; + } + + + /** + * Gets iso_code3_letter + * + * @return string + */ + public function getIsoCode3Letter() + { + return $this->container['iso_code3_letter']; + } + + /** + * Sets iso_code3_letter + * + * @param string $iso_code3_letter The ISO code 3 letter identifies the country by three chars as defined in ISO 3166-1 (e.g. CHE, USA, GBR). + * + * @return $this + */ + public function setIsoCode3Letter($iso_code3_letter) + { + $this->container['iso_code3_letter'] = $iso_code3_letter; + + return $this; + } + + + /** + * Gets address_format + * + * @return \Wallee\Sdk\Model\RestAddressFormat + */ + public function getAddressFormat() + { + return $this->container['address_format']; + } + + /** + * Sets address_format + * + * @param \Wallee\Sdk\Model\RestAddressFormat $address_format The address format of the country indicates how an address has to look like for the country. + * + * @return $this + */ + public function setAddressFormat($address_format) + { + $this->container['address_format'] = $address_format; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name labels the country by a name in English. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets numeric_code + * + * @return string + */ + public function getNumericCode() + { + return $this->container['numeric_code']; + } + + /** + * Sets numeric_code + * + * @param string $numeric_code The numeric code identifies the country by a three digit number as defined in ISO 3166-1 (e.g. 840, 826, 756). + * + * @return $this + */ + public function setNumericCode($numeric_code) + { + $this->container['numeric_code'] = $numeric_code; + + return $this; + } + + + /** + * Gets state_codes + * + * @return string[] + */ + public function getStateCodes() + { + return $this->container['state_codes']; + } + + /** + * Sets state_codes + * + * @param string[] $state_codes The state codes field is a list of all states associated with this country. The list contains the identifiers of the states. The identifiers corresponds to the ISO 3166-2 subdivision identifier. + * + * @return $this + */ + public function setStateCodes($state_codes) + { + $this->container['state_codes'] = $state_codes; + + 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/wallee-sdk/lib/Model/RestCountryState.php b/wallee-sdk/lib/Model/RestCountryState.php index c44fc84..3ed4b8f 100644 --- a/wallee-sdk/lib/Model/RestCountryState.php +++ b/wallee-sdk/lib/Model/RestCountryState.php @@ -1,10 +1,8 @@ 'string', - 'countryCode' => 'string', - 'id' => 'string', - 'name' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The code of the state identifies the state. The code is typically used within addresses. Some countries may not provide a code. For those the field is null. - * - * @var string - */ - private $code; - - /** - * The country code in ISO two letter format (e.g. UK, DE, CH, US). - * - * @var string - */ - private $countryCode; - - /** - * The ID of the state corresponds to the subdivision identifier defined in ISO 3166-2. The format consists of the country code followed by a dash and a subdivision identifier. - * - * @var string - */ - private $id; - - /** - * The name is a human readable label of the state in the language of the region. - * - * @var string - */ - private $name; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - } - - - /** - * Returns code. - * - * The code of the state identifies the state. The code is typically used within addresses. Some countries may not provide a code. For those the field is null. - * - * @return string - */ - public function getCode() { - return $this->code; - } - - /** - * Sets code. - * - * @param string $code - * @return RestCountryState - */ - protected function setCode($code) { - $this->code = $code; - - return $this; - } - - /** - * Returns countryCode. - * - * The country code in ISO two letter format (e.g. UK, DE, CH, US). - * - * @return string - */ - public function getCountryCode() { - return $this->countryCode; - } - - /** - * Sets countryCode. - * - * @param string $countryCode - * @return RestCountryState - */ - protected function setCountryCode($countryCode) { - $this->countryCode = $countryCode; - - return $this; - } - - /** - * Returns id. - * - * The ID of the state corresponds to the subdivision identifier defined in ISO 3166-2. The format consists of the country code followed by a dash and a subdivision identifier. - * - * @return string - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param string $id - * @return RestCountryState - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * The name is a human readable label of the state in the language of the region. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return RestCountryState - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class RestCountryState implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'RestCountryState'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'code' => 'string', + 'country_code' => 'string', + 'id' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'code' => null, + 'country_code' => null, + 'id' => null, + 'name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code', + 'country_code' => 'countryCode', + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'country_code' => 'setCountryCode', + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'country_code' => 'getCountryCode', + 'id' => 'getId', + 'name' => 'getName' + ]; + + + + /** + * 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['code'] = isset($data['code']) ? $data['code'] : null; + + $this->container['country_code'] = isset($data['country_code']) ? $data['country_code'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets code + * + * @return string + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code The code of the state identifies the state. The code is typically used within addresses. Some countries may not provide a code. For those the field is null. + * + * @return $this + */ + public function setCode($code) + { + $this->container['code'] = $code; + + return $this; + } + + + /** + * Gets country_code + * + * @return string + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string $country_code The country code in ISO two letter format (e.g. UK, DE, CH, US). + * + * @return $this + */ + public function setCountryCode($country_code) + { + $this->container['country_code'] = $country_code; + + return $this; + } + + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The ID of the state corresponds to the subdivision identifier defined in ISO 3166-2. The format consists of the country code followed by a dash and a subdivision identifier. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name is a human readable label of the state in the language of the region. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + 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/wallee-sdk/lib/Model/RestCurrency.php b/wallee-sdk/lib/Model/RestCurrency.php index 3a16550..426087f 100644 --- a/wallee-sdk/lib/Model/RestCurrency.php +++ b/wallee-sdk/lib/Model/RestCurrency.php @@ -1,10 +1,8 @@ 'string', - 'fractionDigits' => 'int', - 'numericCode' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The currency code identifies the currency with the three char long ISO 4217 code (e.g. USD, CHF, EUR). - * - * @var string - */ - private $currencyCode; - - /** - * The fraction digits indicates how many places the currency has. This also indicates with which precision we calculate internally when we do calculations with this currency. - * - * @var int - */ - private $fractionDigits; - - /** - * The numeric code identifies the currency with the three digit long ISO 4217 code (e.g. 978, 756, 840). - * - * @var int - */ - private $numericCode; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - } - - - /** - * Returns currencyCode. - * - * The currency code identifies the currency with the three char long ISO 4217 code (e.g. USD, CHF, EUR). - * - * @return string - */ - public function getCurrencyCode() { - return $this->currencyCode; - } - - /** - * Sets currencyCode. - * - * @param string $currencyCode - * @return RestCurrency - */ - protected function setCurrencyCode($currencyCode) { - $this->currencyCode = $currencyCode; - - return $this; - } - - /** - * Returns fractionDigits. - * - * The fraction digits indicates how many places the currency has. This also indicates with which precision we calculate internally when we do calculations with this currency. - * - * @return int - */ - public function getFractionDigits() { - return $this->fractionDigits; - } - - /** - * Sets fractionDigits. - * - * @param int $fractionDigits - * @return RestCurrency - */ - protected function setFractionDigits($fractionDigits) { - $this->fractionDigits = $fractionDigits; - - return $this; - } - - /** - * Returns numericCode. - * - * The numeric code identifies the currency with the three digit long ISO 4217 code (e.g. 978, 756, 840). - * - * @return int - */ - public function getNumericCode() { - return $this->numericCode; - } - - /** - * Sets numericCode. - * - * @param int $numericCode - * @return RestCurrency - */ - protected function setNumericCode($numericCode) { - $this->numericCode = $numericCode; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class RestCurrency implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'RestCurrency'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'currency_code' => 'string', + 'fraction_digits' => 'int', + 'numeric_code' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'currency_code' => null, + 'fraction_digits' => 'int32', + 'numeric_code' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency_code' => 'currencyCode', + 'fraction_digits' => 'fractionDigits', + 'numeric_code' => 'numericCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency_code' => 'setCurrencyCode', + 'fraction_digits' => 'setFractionDigits', + 'numeric_code' => 'setNumericCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency_code' => 'getCurrencyCode', + 'fraction_digits' => 'getFractionDigits', + 'numeric_code' => 'getNumericCode' + ]; + + + + /** + * 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['currency_code'] = isset($data['currency_code']) ? $data['currency_code'] : null; + + $this->container['fraction_digits'] = isset($data['fraction_digits']) ? $data['fraction_digits'] : null; + + $this->container['numeric_code'] = isset($data['numeric_code']) ? $data['numeric_code'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 currency_code + * + * @return string + */ + public function getCurrencyCode() + { + return $this->container['currency_code']; + } + + /** + * Sets currency_code + * + * @param string $currency_code The currency code identifies the currency with the three char long ISO 4217 code (e.g. USD, CHF, EUR). + * + * @return $this + */ + public function setCurrencyCode($currency_code) + { + $this->container['currency_code'] = $currency_code; + + return $this; + } + + + /** + * Gets fraction_digits + * + * @return int + */ + public function getFractionDigits() + { + return $this->container['fraction_digits']; + } + + /** + * Sets fraction_digits + * + * @param int $fraction_digits The fraction digits indicates how many places the currency has. This also indicates with which precision we calculate internally when we do calculations with this currency. + * + * @return $this + */ + public function setFractionDigits($fraction_digits) + { + $this->container['fraction_digits'] = $fraction_digits; + + return $this; + } + + + /** + * Gets numeric_code + * + * @return int + */ + public function getNumericCode() + { + return $this->container['numeric_code']; + } + + /** + * Sets numeric_code + * + * @param int $numeric_code The numeric code identifies the currency with the three digit long ISO 4217 code (e.g. 978, 756, 840). + * + * @return $this + */ + public function setNumericCode($numeric_code) + { + $this->container['numeric_code'] = $numeric_code; + + 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/wallee-sdk/lib/Model/RestLanguage.php b/wallee-sdk/lib/Model/RestLanguage.php index e6ca971..ae59f45 100644 --- a/wallee-sdk/lib/Model/RestLanguage.php +++ b/wallee-sdk/lib/Model/RestLanguage.php @@ -1,10 +1,8 @@ 'string', - 'ietfCode' => 'string', - 'iso2Code' => 'string', - 'iso3Code' => 'string', - 'pluralExpression' => 'string', - 'primaryOfGroup' => 'bool' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The country code represents the region of the language as a 2 letter ISO code. - * - * @var string - */ - private $countryCode; - - /** - * The IETF code represents the language as the two letter ISO code including the region (e.g. en-US). - * - * @var string - */ - private $ietfCode; - - /** - * The ISO 2 letter code represents the language with two letters. - * - * @var string - */ - private $iso2Code; - - /** - * The ISO 3 letter code represents the language with three letters. - * - * @var string - */ - private $iso3Code; - - /** - * The plural expression defines how to map a plural into the language index. This expression is used to determine the plural form for the translations. - * - * @var string - */ - private $pluralExpression; - - /** - * The primary language of a group indicates whether a language is the primary language of a group of languages. The group is determine by the ISO 2 letter code. - * - * @var bool - */ - private $primaryOfGroup; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - } - - - /** - * Returns countryCode. - * - * The country code represents the region of the language as a 2 letter ISO code. - * - * @return string - */ - public function getCountryCode() { - return $this->countryCode; - } - - /** - * Sets countryCode. - * - * @param string $countryCode - * @return RestLanguage - */ - protected function setCountryCode($countryCode) { - $this->countryCode = $countryCode; - - return $this; - } - - /** - * Returns ietfCode. - * - * The IETF code represents the language as the two letter ISO code including the region (e.g. en-US). - * - * @return string - */ - public function getIetfCode() { - return $this->ietfCode; - } - - /** - * Sets ietfCode. - * - * @param string $ietfCode - * @return RestLanguage - */ - protected function setIetfCode($ietfCode) { - $this->ietfCode = $ietfCode; - - return $this; - } - - /** - * Returns iso2Code. - * - * The ISO 2 letter code represents the language with two letters. - * - * @return string - */ - public function getIso2Code() { - return $this->iso2Code; - } - - /** - * Sets iso2Code. - * - * @param string $iso2Code - * @return RestLanguage - */ - protected function setIso2Code($iso2Code) { - $this->iso2Code = $iso2Code; - - return $this; - } - - /** - * Returns iso3Code. - * - * The ISO 3 letter code represents the language with three letters. - * - * @return string - */ - public function getIso3Code() { - return $this->iso3Code; - } - - /** - * Sets iso3Code. - * - * @param string $iso3Code - * @return RestLanguage - */ - protected function setIso3Code($iso3Code) { - $this->iso3Code = $iso3Code; - - return $this; - } - - /** - * Returns pluralExpression. - * - * The plural expression defines how to map a plural into the language index. This expression is used to determine the plural form for the translations. - * - * @return string - */ - public function getPluralExpression() { - return $this->pluralExpression; - } - - /** - * Sets pluralExpression. - * - * @param string $pluralExpression - * @return RestLanguage - */ - protected function setPluralExpression($pluralExpression) { - $this->pluralExpression = $pluralExpression; - - return $this; - } - - /** - * Returns primaryOfGroup. - * - * The primary language of a group indicates whether a language is the primary language of a group of languages. The group is determine by the ISO 2 letter code. - * - * @return bool - */ - public function getPrimaryOfGroup() { - return $this->primaryOfGroup; - } - - /** - * Sets primaryOfGroup. - * - * @param bool $primaryOfGroup - * @return RestLanguage - */ - protected function setPrimaryOfGroup($primaryOfGroup) { - $this->primaryOfGroup = $primaryOfGroup; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class RestLanguage implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'RestLanguage'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'country_code' => 'string', + 'ietf_code' => 'string', + 'iso2_code' => 'string', + 'iso3_code' => 'string', + 'plural_expression' => 'string', + 'primary_of_group' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'country_code' => null, + 'ietf_code' => null, + 'iso2_code' => null, + 'iso3_code' => null, + 'plural_expression' => null, + 'primary_of_group' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'country_code' => 'countryCode', + 'ietf_code' => 'ietfCode', + 'iso2_code' => 'iso2Code', + 'iso3_code' => 'iso3Code', + 'plural_expression' => 'pluralExpression', + 'primary_of_group' => 'primaryOfGroup' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'country_code' => 'setCountryCode', + 'ietf_code' => 'setIetfCode', + 'iso2_code' => 'setIso2Code', + 'iso3_code' => 'setIso3Code', + 'plural_expression' => 'setPluralExpression', + 'primary_of_group' => 'setPrimaryOfGroup' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'country_code' => 'getCountryCode', + 'ietf_code' => 'getIetfCode', + 'iso2_code' => 'getIso2Code', + 'iso3_code' => 'getIso3Code', + 'plural_expression' => 'getPluralExpression', + 'primary_of_group' => 'getPrimaryOfGroup' + ]; + + + + /** + * 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['country_code'] = isset($data['country_code']) ? $data['country_code'] : null; + + $this->container['ietf_code'] = isset($data['ietf_code']) ? $data['ietf_code'] : null; + + $this->container['iso2_code'] = isset($data['iso2_code']) ? $data['iso2_code'] : null; + + $this->container['iso3_code'] = isset($data['iso3_code']) ? $data['iso3_code'] : null; + + $this->container['plural_expression'] = isset($data['plural_expression']) ? $data['plural_expression'] : null; + + $this->container['primary_of_group'] = isset($data['primary_of_group']) ? $data['primary_of_group'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets country_code + * + * @return string + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string $country_code The country code represents the region of the language as a 2 letter ISO code. + * + * @return $this + */ + public function setCountryCode($country_code) + { + $this->container['country_code'] = $country_code; + + return $this; + } + + + /** + * Gets ietf_code + * + * @return string + */ + public function getIetfCode() + { + return $this->container['ietf_code']; + } + + /** + * Sets ietf_code + * + * @param string $ietf_code The IETF code represents the language as the two letter ISO code including the region (e.g. en-US). + * + * @return $this + */ + public function setIetfCode($ietf_code) + { + $this->container['ietf_code'] = $ietf_code; + + return $this; + } + + + /** + * Gets iso2_code + * + * @return string + */ + public function getIso2Code() + { + return $this->container['iso2_code']; + } + + /** + * Sets iso2_code + * + * @param string $iso2_code The ISO 2 letter code represents the language with two letters. + * + * @return $this + */ + public function setIso2Code($iso2_code) + { + $this->container['iso2_code'] = $iso2_code; + + return $this; + } + + + /** + * Gets iso3_code + * + * @return string + */ + public function getIso3Code() + { + return $this->container['iso3_code']; + } + + /** + * Sets iso3_code + * + * @param string $iso3_code The ISO 3 letter code represents the language with three letters. + * + * @return $this + */ + public function setIso3Code($iso3_code) + { + $this->container['iso3_code'] = $iso3_code; + + return $this; + } + + + /** + * Gets plural_expression + * + * @return string + */ + public function getPluralExpression() + { + return $this->container['plural_expression']; + } + + /** + * Sets plural_expression + * + * @param string $plural_expression The plural expression defines how to map a plural into the language index. This expression is used to determine the plural form for the translations. + * + * @return $this + */ + public function setPluralExpression($plural_expression) + { + $this->container['plural_expression'] = $plural_expression; + + return $this; + } + + + /** + * Gets primary_of_group + * + * @return bool + */ + public function getPrimaryOfGroup() + { + return $this->container['primary_of_group']; + } + + /** + * Sets primary_of_group + * + * @param bool $primary_of_group The primary language of a group indicates whether a language is the primary language of a group of languages. The group is determine by the ISO 2 letter code. + * + * @return $this + */ + public function setPrimaryOfGroup($primary_of_group) + { + $this->container['primary_of_group'] = $primary_of_group; + + 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/wallee-sdk/lib/Model/Role.php b/wallee-sdk/lib/Model/Role.php index 1593d26..ddf4b84 100644 --- a/wallee-sdk/lib/Model/Role.php +++ b/wallee-sdk/lib/Model/Role.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\Account', - 'id' => 'int', - 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedString', - 'permissions' => '\Wallee\Sdk\Model\Permission[]', - 'plannedPurgeDate' => '\DateTime', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'twoFactorRequired' => 'bool', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The account to which this role belongs to. This role can only be assigned within the assigned account and the sub accounts of the assigned account. - * - * @var \Wallee\Sdk\Model\Account - */ - private $account; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The name of this role is used to identify the role within administrative interfaces. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedString - */ - private $name; - - /** - * Set of permissions that are granted to this role. - * - * @var \Wallee\Sdk\Model\Permission[] - */ - private $permissions; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * Defines whether having been granted this role will force a user to use two-factor authentication. - * - * @var bool - */ - private $twoFactorRequired; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['account'])) { - $this->setAccount($data['account']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['permissions'])) { - $this->setPermissions($data['permissions']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns account. - * - * The account to which this role belongs to. This role can only be assigned within the assigned account and the sub accounts of the assigned account. - * - * @return \Wallee\Sdk\Model\Account - */ - public function getAccount() { - return $this->account; - } - - /** - * Sets account. - * - * @param \Wallee\Sdk\Model\Account $account - * @return Role - */ - public function setAccount($account) { - $this->account = $account; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return Role - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * The name of this role is used to identify the role within administrative interfaces. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedString - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedString $name - * @return Role - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns permissions. - * - * Set of permissions that are granted to this role. - * - * @return \Wallee\Sdk\Model\Permission[] - */ - public function getPermissions() { - return $this->permissions; - } - - /** - * Sets permissions. - * - * @param \Wallee\Sdk\Model\Permission[] $permissions - * @return Role - */ - public function setPermissions($permissions) { - $this->permissions = $permissions; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return Role - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return Role - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns twoFactorRequired. - * - * Defines whether having been granted this role will force a user to use two-factor authentication. - * - * @return bool - */ - public function getTwoFactorRequired() { - return $this->twoFactorRequired; - } - - /** - * Sets twoFactorRequired. - * - * @param bool $twoFactorRequired - * @return Role - */ - protected function setTwoFactorRequired($twoFactorRequired) { - $this->twoFactorRequired = $twoFactorRequired; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return Role - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class Role implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Role'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'account' => '\Wallee\Sdk\Model\Account', + 'id' => 'int', + 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedString', + 'permissions' => '\Wallee\Sdk\Model\Permission[]', + 'planned_purge_date' => '\DateTime', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'two_factor_required' => 'bool', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'account' => null, + 'id' => 'int64', + 'name' => null, + 'permissions' => null, + 'planned_purge_date' => 'date-time', + 'state' => null, + 'two_factor_required' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account' => 'account', + 'id' => 'id', + 'name' => 'name', + 'permissions' => 'permissions', + 'planned_purge_date' => 'plannedPurgeDate', + 'state' => 'state', + 'two_factor_required' => 'twoFactorRequired', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account' => 'setAccount', + 'id' => 'setId', + 'name' => 'setName', + 'permissions' => 'setPermissions', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'state' => 'setState', + 'two_factor_required' => 'setTwoFactorRequired', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account' => 'getAccount', + 'id' => 'getId', + 'name' => 'getName', + 'permissions' => 'getPermissions', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'state' => 'getState', + 'two_factor_required' => 'getTwoFactorRequired', + 'version' => 'getVersion' + ]; + + + + /** + * 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['account'] = isset($data['account']) ? $data['account'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['permissions'] = isset($data['permissions']) ? $data['permissions'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['two_factor_required'] = isset($data['two_factor_required']) ? $data['two_factor_required'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 account + * + * @return \Wallee\Sdk\Model\Account + */ + public function getAccount() + { + return $this->container['account']; + } + + /** + * Sets account + * + * @param \Wallee\Sdk\Model\Account $account The account to which this role belongs to. This role can only be assigned within the assigned account and the sub accounts of the assigned account. + * + * @return $this + */ + public function setAccount($account) + { + $this->container['account'] = $account; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedString + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedString $name The name of this role is used to identify the role within administrative interfaces. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets permissions + * + * @return \Wallee\Sdk\Model\Permission[] + */ + public function getPermissions() + { + return $this->container['permissions']; + } + + /** + * Sets permissions + * + * @param \Wallee\Sdk\Model\Permission[] $permissions Set of permissions that are granted to this role. + * + * @return $this + */ + public function setPermissions($permissions) + { + $this->container['permissions'] = $permissions; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets two_factor_required + * + * @return bool + */ + public function getTwoFactorRequired() + { + return $this->container['two_factor_required']; + } + + /** + * Sets two_factor_required + * + * @param bool $two_factor_required Defines whether having been granted this role will force a user to use two-factor authentication. + * + * @return $this + */ + public function setTwoFactorRequired($two_factor_required) + { + $this->container['two_factor_required'] = $two_factor_required; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/Scope.php b/wallee-sdk/lib/Model/Scope.php index 0a5ddf3..8c5670d 100644 --- a/wallee-sdk/lib/Model/Scope.php +++ b/wallee-sdk/lib/Model/Scope.php @@ -1,10 +1,8 @@ 'string', - 'features' => '\Wallee\Sdk\Model\Feature[]', - 'id' => 'int', - 'name' => 'string', - 'plannedPurgeDate' => '\DateTime', - 'port' => 'int', - 'sslActive' => 'bool', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'themes' => 'string[]', - 'url' => 'string', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The domain name to which this scope is mapped to. - * - * @var string - */ - private $domainName; - - /** - * - * - * @var \Wallee\Sdk\Model\Feature[] - */ - private $features; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The name of the scope is shown to the user where the user should select a scope. - * - * @var string - */ - private $name; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * The port number to which this scope is mapped to. - * - * @var int - */ - private $port; - - /** - * Define whether the scope supports SSL. - * - * @var bool - */ - private $sslActive; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The themes determines how the application layout, look and feel is. By providing multiple themes you can fallback to other themes. - * - * @var string[] - */ - private $themes; - - /** - * - * - * @var string - */ - private $url; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['features'])) { - $this->setFeatures($data['features']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['themes'])) { - $this->setThemes($data['themes']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns domainName. - * - * The domain name to which this scope is mapped to. - * - * @return string - */ - public function getDomainName() { - return $this->domainName; - } - - /** - * Sets domainName. - * - * @param string $domainName - * @return Scope - */ - protected function setDomainName($domainName) { - $this->domainName = $domainName; - - return $this; - } - - /** - * Returns features. - * - * - * - * @return \Wallee\Sdk\Model\Feature[] - */ - public function getFeatures() { - return $this->features; - } - - /** - * Sets features. - * - * @param \Wallee\Sdk\Model\Feature[] $features - * @return Scope - */ - public function setFeatures($features) { - $this->features = $features; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return Scope - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * The name of the scope is shown to the user where the user should select a scope. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return Scope - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return Scope - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns port. - * - * The port number to which this scope is mapped to. - * - * @return int - */ - public function getPort() { - return $this->port; - } - - /** - * Sets port. - * - * @param int $port - * @return Scope - */ - protected function setPort($port) { - $this->port = $port; - - return $this; - } - - /** - * Returns sslActive. - * - * Define whether the scope supports SSL. - * - * @return bool - */ - public function getSslActive() { - return $this->sslActive; - } - - /** - * Sets sslActive. - * - * @param bool $sslActive - * @return Scope - */ - protected function setSslActive($sslActive) { - $this->sslActive = $sslActive; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return Scope - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns themes. - * - * The themes determines how the application layout, look and feel is. By providing multiple themes you can fallback to other themes. - * - * @return string[] - */ - public function getThemes() { - return $this->themes; - } - - /** - * Sets themes. - * - * @param string[] $themes - * @return Scope - */ - public function setThemes($themes) { - $this->themes = $themes; - - return $this; - } - - /** - * Returns url. - * - * - * - * @return string - */ - public function getUrl() { - return $this->url; - } - - /** - * Sets url. - * - * @param string $url - * @return Scope - */ - protected function setUrl($url) { - $this->url = $url; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return Scope - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class Scope implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Scope'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'domain_name' => 'string', + 'features' => '\Wallee\Sdk\Model\Feature[]', + 'id' => 'int', + 'name' => 'string', + 'planned_purge_date' => '\DateTime', + 'port' => 'int', + 'ssl_active' => 'bool', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'themes' => 'string[]', + 'url' => 'string', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'domain_name' => null, + 'features' => null, + 'id' => 'int64', + 'name' => null, + 'planned_purge_date' => 'date-time', + 'port' => 'int32', + 'ssl_active' => null, + 'state' => null, + 'themes' => null, + 'url' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'domain_name' => 'domainName', + 'features' => 'features', + 'id' => 'id', + 'name' => 'name', + 'planned_purge_date' => 'plannedPurgeDate', + 'port' => 'port', + 'ssl_active' => 'sslActive', + 'state' => 'state', + 'themes' => 'themes', + 'url' => 'url', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'domain_name' => 'setDomainName', + 'features' => 'setFeatures', + 'id' => 'setId', + 'name' => 'setName', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'port' => 'setPort', + 'ssl_active' => 'setSslActive', + 'state' => 'setState', + 'themes' => 'setThemes', + 'url' => 'setUrl', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'domain_name' => 'getDomainName', + 'features' => 'getFeatures', + 'id' => 'getId', + 'name' => 'getName', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'port' => 'getPort', + 'ssl_active' => 'getSslActive', + 'state' => 'getState', + 'themes' => 'getThemes', + 'url' => 'getUrl', + 'version' => 'getVersion' + ]; + + + + /** + * 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['domain_name'] = isset($data['domain_name']) ? $data['domain_name'] : null; + + $this->container['features'] = isset($data['features']) ? $data['features'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['port'] = isset($data['port']) ? $data['port'] : null; + + $this->container['ssl_active'] = isset($data['ssl_active']) ? $data['ssl_active'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['themes'] = isset($data['themes']) ? $data['themes'] : null; + + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 domain_name + * + * @return string + */ + public function getDomainName() + { + return $this->container['domain_name']; + } + + /** + * Sets domain_name + * + * @param string $domain_name The domain name to which this scope is mapped to. + * + * @return $this + */ + public function setDomainName($domain_name) + { + $this->container['domain_name'] = $domain_name; + + return $this; + } + + + /** + * Gets features + * + * @return \Wallee\Sdk\Model\Feature[] + */ + public function getFeatures() + { + return $this->container['features']; + } + + /** + * Sets features + * + * @param \Wallee\Sdk\Model\Feature[] $features + * + * @return $this + */ + public function setFeatures($features) + { + $this->container['features'] = $features; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the scope is shown to the user where the user should select a scope. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets port + * + * @return int + */ + public function getPort() + { + return $this->container['port']; + } + + /** + * Sets port + * + * @param int $port The port number to which this scope is mapped to. + * + * @return $this + */ + public function setPort($port) + { + $this->container['port'] = $port; + + return $this; + } + + + /** + * Gets ssl_active + * + * @return bool + */ + public function getSslActive() + { + return $this->container['ssl_active']; + } + + /** + * Sets ssl_active + * + * @param bool $ssl_active Define whether the scope supports SSL. + * + * @return $this + */ + public function setSslActive($ssl_active) + { + $this->container['ssl_active'] = $ssl_active; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets themes + * + * @return string[] + */ + public function getThemes() + { + return $this->container['themes']; + } + + /** + * Sets themes + * + * @param string[] $themes The themes determines how the application layout, look and feel is. By providing multiple themes you can fallback to other themes. + * + * @return $this + */ + public function setThemes($themes) + { + $this->container['themes'] = $themes; + + return $this; + } + + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url + * + * @return $this + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/ServerError.php b/wallee-sdk/lib/Model/ServerError.php index 7489bb7..71ade9c 100644 --- a/wallee-sdk/lib/Model/ServerError.php +++ b/wallee-sdk/lib/Model/ServerError.php @@ -1,10 +1,8 @@ 'string', - 'id' => 'string', - 'message' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * Date when an error has occurred. - * - * @var string - */ - private $date; - - /** - * Unique identifier of an error. - * - * @var string - */ - private $id; - - /** - * This message describes an error. - * - * @var string - */ - private $message; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - } - - - /** - * Returns date. - * - * Date when an error has occurred. - * - * @return string - */ - public function getDate() { - return $this->date; - } - - /** - * Sets date. - * - * @param string $date - * @return ServerError - */ - protected function setDate($date) { - $this->date = $date; - - return $this; - } - - /** - * Returns id. - * - * Unique identifier of an error. - * - * @return string - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param string $id - * @return ServerError - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns message. - * - * This message describes an error. - * - * @return string - */ - public function getMessage() { - return $this->message; - } - - /** - * Sets message. - * - * @param string $message - * @return ServerError - */ - protected function setMessage($message) { - $this->message = $message; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class ServerError implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'ServerError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'date' => 'string', + 'id' => 'string', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'date' => null, + 'id' => null, + 'message' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'date' => 'date', + 'id' => 'id', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'date' => 'setDate', + 'id' => 'setId', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'date' => 'getDate', + 'id' => 'getId', + 'message' => 'getMessage' + ]; + + + + /** + * 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['date'] = isset($data['date']) ? $data['date'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 date + * + * @return string + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param string $date Date when an error has occurred. + * + * @return $this + */ + public function setDate($date) + { + $this->container['date'] = $date; + + return $this; + } + + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id Unique identifier of an error. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message This message describes an error. + * + * @return $this + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + 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/wallee-sdk/lib/Model/Space.php b/wallee-sdk/lib/Model/Space.php index 7646bca..e1ce36e 100644 --- a/wallee-sdk/lib/Model/Space.php +++ b/wallee-sdk/lib/Model/Space.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\Account', - 'active' => 'bool', - 'activeOrRestrictedActive' => 'bool', - 'database' => '\Wallee\Sdk\Model\TenantDatabase', - 'id' => 'int', - 'name' => 'string', - 'plannedPurgeDate' => '\DateTime', - 'postalAddress' => '\Wallee\Sdk\Model\SpaceAddress', - 'requestLimit' => 'int', - 'restrictedActive' => 'bool', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'technicalContactAddresses' => 'string[]', - 'timeZone' => 'string', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The account to which the space belongs to. - * - * @var \Wallee\Sdk\Model\Account - */ - private $account; - - /** - * Active means that this account and all accounts in the hierarchy are active. - * - * @var bool - */ - private $active; - - /** - * This property is true when all accounts in the hierarchy are active or restricted active. - * - * @var bool - */ - private $activeOrRestrictedActive; - - /** - * The database in which the space's data are stored in. - * - * @var \Wallee\Sdk\Model\TenantDatabase - */ - private $database; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The space name is used internally to identify the space in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * The address to use in communication with clients for example in email, documents etc. - * - * @var \Wallee\Sdk\Model\SpaceAddress - */ - private $postalAddress; - - /** - * The request limit defines the maximum number of API request accepted within 2 minutes for this space. This limit can only be changed with special privileges. - * - * @var int - */ - private $requestLimit; - - /** - * Restricted active means that at least one account in the hierarchy is only restricted active, but all are either restricted active or active. - * - * @var bool - */ - private $restrictedActive; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The email address provided as contact addresses will be informed about technical issues or errors triggered by the space. - * - * @var string[] - */ - private $technicalContactAddresses; - - /** - * The time zone assigned to the space determines the time offset for calculating dates within the space. This is typically used for background processed which needs to be triggered on a specific hour within the day. Changing the space time zone will not change the display of dates. - * - * @var string - */ - private $timeZone; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['account'])) { - $this->setAccount($data['account']); - } - if (isset($data['database'])) { - $this->setDatabase($data['database']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['postalAddress'])) { - $this->setPostalAddress($data['postalAddress']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['technicalContactAddresses'])) { - $this->setTechnicalContactAddresses($data['technicalContactAddresses']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns account. - * - * The account to which the space belongs to. - * - * @return \Wallee\Sdk\Model\Account - */ - public function getAccount() { - return $this->account; - } - - /** - * Sets account. - * - * @param \Wallee\Sdk\Model\Account $account - * @return Space - */ - public function setAccount($account) { - $this->account = $account; - - return $this; - } - - /** - * Returns active. - * - * Active means that this account and all accounts in the hierarchy are active. - * - * @return bool - */ - public function getActive() { - return $this->active; - } - - /** - * Sets active. - * - * @param bool $active - * @return Space - */ - protected function setActive($active) { - $this->active = $active; - - return $this; - } - - /** - * Returns activeOrRestrictedActive. - * - * This property is true when all accounts in the hierarchy are active or restricted active. - * - * @return bool - */ - public function getActiveOrRestrictedActive() { - return $this->activeOrRestrictedActive; - } - - /** - * Sets activeOrRestrictedActive. - * - * @param bool $activeOrRestrictedActive - * @return Space - */ - protected function setActiveOrRestrictedActive($activeOrRestrictedActive) { - $this->activeOrRestrictedActive = $activeOrRestrictedActive; - - return $this; - } - - /** - * Returns database. - * - * The database in which the space's data are stored in. - * - * @return \Wallee\Sdk\Model\TenantDatabase - */ - public function getDatabase() { - return $this->database; - } - - /** - * Sets database. - * - * @param \Wallee\Sdk\Model\TenantDatabase $database - * @return Space - */ - public function setDatabase($database) { - $this->database = $database; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return Space - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * The space name is used internally to identify the space in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return Space - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return Space - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns postalAddress. - * - * The address to use in communication with clients for example in email, documents etc. - * - * @return \Wallee\Sdk\Model\SpaceAddress - */ - public function getPostalAddress() { - return $this->postalAddress; - } - - /** - * Sets postalAddress. - * - * @param \Wallee\Sdk\Model\SpaceAddress $postalAddress - * @return Space - */ - public function setPostalAddress($postalAddress) { - $this->postalAddress = $postalAddress; - - return $this; - } - - /** - * Returns requestLimit. - * - * The request limit defines the maximum number of API request accepted within 2 minutes for this space. This limit can only be changed with special privileges. - * - * @return int - */ - public function getRequestLimit() { - return $this->requestLimit; - } - - /** - * Sets requestLimit. - * - * @param int $requestLimit - * @return Space - */ - protected function setRequestLimit($requestLimit) { - $this->requestLimit = $requestLimit; - - return $this; - } - - /** - * Returns restrictedActive. - * - * Restricted active means that at least one account in the hierarchy is only restricted active, but all are either restricted active or active. - * - * @return bool - */ - public function getRestrictedActive() { - return $this->restrictedActive; - } - - /** - * Sets restrictedActive. - * - * @param bool $restrictedActive - * @return Space - */ - protected function setRestrictedActive($restrictedActive) { - $this->restrictedActive = $restrictedActive; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return Space - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns technicalContactAddresses. - * - * The email address provided as contact addresses will be informed about technical issues or errors triggered by the space. - * - * @return string[] - */ - public function getTechnicalContactAddresses() { - return $this->technicalContactAddresses; - } - - /** - * Sets technicalContactAddresses. - * - * @param string[] $technicalContactAddresses - * @return Space - */ - public function setTechnicalContactAddresses($technicalContactAddresses) { - $this->technicalContactAddresses = $technicalContactAddresses; - - return $this; - } - - /** - * Returns timeZone. - * - * The time zone assigned to the space determines the time offset for calculating dates within the space. This is typically used for background processed which needs to be triggered on a specific hour within the day. Changing the space time zone will not change the display of dates. - * - * @return string - */ - public function getTimeZone() { - return $this->timeZone; - } - - /** - * Sets timeZone. - * - * @param string $timeZone - * @return Space - */ - protected function setTimeZone($timeZone) { - $this->timeZone = $timeZone; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return Space - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class Space implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Space'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'account' => '\Wallee\Sdk\Model\Account', + 'active' => 'bool', + 'active_or_restricted_active' => 'bool', + 'database' => '\Wallee\Sdk\Model\TenantDatabase', + 'id' => 'int', + 'name' => 'string', + 'planned_purge_date' => '\DateTime', + 'postal_address' => '\Wallee\Sdk\Model\SpaceAddress', + 'primary_currency' => 'string', + 'request_limit' => 'int', + 'restricted_active' => 'bool', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'technical_contact_addresses' => 'string[]', + 'time_zone' => 'string', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'account' => null, + 'active' => null, + 'active_or_restricted_active' => null, + 'database' => null, + 'id' => 'int64', + 'name' => null, + 'planned_purge_date' => 'date-time', + 'postal_address' => null, + 'primary_currency' => null, + 'request_limit' => 'int64', + 'restricted_active' => null, + 'state' => null, + 'technical_contact_addresses' => null, + 'time_zone' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account' => 'account', + 'active' => 'active', + 'active_or_restricted_active' => 'activeOrRestrictedActive', + 'database' => 'database', + 'id' => 'id', + 'name' => 'name', + 'planned_purge_date' => 'plannedPurgeDate', + 'postal_address' => 'postalAddress', + 'primary_currency' => 'primaryCurrency', + 'request_limit' => 'requestLimit', + 'restricted_active' => 'restrictedActive', + 'state' => 'state', + 'technical_contact_addresses' => 'technicalContactAddresses', + 'time_zone' => 'timeZone', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account' => 'setAccount', + 'active' => 'setActive', + 'active_or_restricted_active' => 'setActiveOrRestrictedActive', + 'database' => 'setDatabase', + 'id' => 'setId', + 'name' => 'setName', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'postal_address' => 'setPostalAddress', + 'primary_currency' => 'setPrimaryCurrency', + 'request_limit' => 'setRequestLimit', + 'restricted_active' => 'setRestrictedActive', + 'state' => 'setState', + 'technical_contact_addresses' => 'setTechnicalContactAddresses', + 'time_zone' => 'setTimeZone', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account' => 'getAccount', + 'active' => 'getActive', + 'active_or_restricted_active' => 'getActiveOrRestrictedActive', + 'database' => 'getDatabase', + 'id' => 'getId', + 'name' => 'getName', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'postal_address' => 'getPostalAddress', + 'primary_currency' => 'getPrimaryCurrency', + 'request_limit' => 'getRequestLimit', + 'restricted_active' => 'getRestrictedActive', + 'state' => 'getState', + 'technical_contact_addresses' => 'getTechnicalContactAddresses', + 'time_zone' => 'getTimeZone', + 'version' => 'getVersion' + ]; + + + + /** + * 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['account'] = isset($data['account']) ? $data['account'] : null; + + $this->container['active'] = isset($data['active']) ? $data['active'] : null; + + $this->container['active_or_restricted_active'] = isset($data['active_or_restricted_active']) ? $data['active_or_restricted_active'] : null; + + $this->container['database'] = isset($data['database']) ? $data['database'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['postal_address'] = isset($data['postal_address']) ? $data['postal_address'] : null; + + $this->container['primary_currency'] = isset($data['primary_currency']) ? $data['primary_currency'] : null; + + $this->container['request_limit'] = isset($data['request_limit']) ? $data['request_limit'] : null; + + $this->container['restricted_active'] = isset($data['restricted_active']) ? $data['restricted_active'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['technical_contact_addresses'] = isset($data['technical_contact_addresses']) ? $data['technical_contact_addresses'] : null; + + $this->container['time_zone'] = isset($data['time_zone']) ? $data['time_zone'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 account + * + * @return \Wallee\Sdk\Model\Account + */ + public function getAccount() + { + return $this->container['account']; + } + + /** + * Sets account + * + * @param \Wallee\Sdk\Model\Account $account The account to which the space belongs to. + * + * @return $this + */ + public function setAccount($account) + { + $this->container['account'] = $account; + + return $this; + } + + + /** + * Gets active + * + * @return bool + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool $active Active means that this account and all accounts in the hierarchy are active. + * + * @return $this + */ + public function setActive($active) + { + $this->container['active'] = $active; + + return $this; + } + + + /** + * Gets active_or_restricted_active + * + * @return bool + */ + public function getActiveOrRestrictedActive() + { + return $this->container['active_or_restricted_active']; + } + + /** + * Sets active_or_restricted_active + * + * @param bool $active_or_restricted_active This property is true when all accounts in the hierarchy are active or restricted active. + * + * @return $this + */ + public function setActiveOrRestrictedActive($active_or_restricted_active) + { + $this->container['active_or_restricted_active'] = $active_or_restricted_active; + + return $this; + } + + + /** + * Gets database + * + * @return \Wallee\Sdk\Model\TenantDatabase + */ + public function getDatabase() + { + return $this->container['database']; + } + + /** + * Sets database + * + * @param \Wallee\Sdk\Model\TenantDatabase $database The database in which the space's data are stored in. + * + * @return $this + */ + public function setDatabase($database) + { + $this->container['database'] = $database; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The space name is used internally to identify the space in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets postal_address + * + * @return \Wallee\Sdk\Model\SpaceAddress + */ + public function getPostalAddress() + { + return $this->container['postal_address']; + } + + /** + * Sets postal_address + * + * @param \Wallee\Sdk\Model\SpaceAddress $postal_address The address to use in communication with clients for example in email, documents etc. + * + * @return $this + */ + public function setPostalAddress($postal_address) + { + $this->container['postal_address'] = $postal_address; + + return $this; + } + + + /** + * Gets primary_currency + * + * @return string + */ + public function getPrimaryCurrency() + { + return $this->container['primary_currency']; + } + + /** + * Sets primary_currency + * + * @param string $primary_currency This is the currency that is used to display aggregated amounts in the space. + * + * @return $this + */ + public function setPrimaryCurrency($primary_currency) + { + $this->container['primary_currency'] = $primary_currency; + + return $this; + } + + + /** + * Gets request_limit + * + * @return int + */ + public function getRequestLimit() + { + return $this->container['request_limit']; + } + + /** + * Sets request_limit + * + * @param int $request_limit The request limit defines the maximum number of API request accepted within 2 minutes for this space. This limit can only be changed with special privileges. + * + * @return $this + */ + public function setRequestLimit($request_limit) + { + $this->container['request_limit'] = $request_limit; + + return $this; + } + + + /** + * Gets restricted_active + * + * @return bool + */ + public function getRestrictedActive() + { + return $this->container['restricted_active']; + } + + /** + * Sets restricted_active + * + * @param bool $restricted_active Restricted active means that at least one account in the hierarchy is only restricted active, but all are either restricted active or active. + * + * @return $this + */ + public function setRestrictedActive($restricted_active) + { + $this->container['restricted_active'] = $restricted_active; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets technical_contact_addresses + * + * @return string[] + */ + public function getTechnicalContactAddresses() + { + return $this->container['technical_contact_addresses']; + } + + /** + * Sets technical_contact_addresses + * + * @param string[] $technical_contact_addresses The email address provided as contact addresses will be informed about technical issues or errors triggered by the space. + * + * @return $this + */ + public function setTechnicalContactAddresses($technical_contact_addresses) + { + $this->container['technical_contact_addresses'] = $technical_contact_addresses; + + return $this; + } + + + /** + * Gets time_zone + * + * @return string + */ + public function getTimeZone() + { + return $this->container['time_zone']; + } + + /** + * Sets time_zone + * + * @param string $time_zone The time zone assigned to the space determines the time offset for calculating dates within the space. This is typically used for background processed which needs to be triggered on a specific hour within the day. Changing the space time zone will not change the display of dates. + * + * @return $this + */ + public function setTimeZone($time_zone) + { + $this->container['time_zone'] = $time_zone; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/SpaceAddress.php b/wallee-sdk/lib/Model/SpaceAddress.php index c92ce20..e2374c8 100644 --- a/wallee-sdk/lib/Model/SpaceAddress.php +++ b/wallee-sdk/lib/Model/SpaceAddress.php @@ -1,10 +1,8 @@ 'string', - 'country' => 'string', - 'dependentLocality' => 'string', - 'emailAddress' => 'string', - 'familyName' => 'string', - 'givenName' => 'string', - 'organizationName' => 'string', - 'postCode' => 'string', - 'postalState' => 'string', - 'salesTaxNumber' => 'string', - 'salutation' => 'string', - 'sortingCode' => 'string', - 'street' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var string - */ - private $city; - - /** - * - * - * @var string - */ - private $country; - - /** - * - * - * @var string - */ - private $dependentLocality; - - /** - * The email address is used within emails and as reply to address. - * - * @var string - */ - private $emailAddress; - - /** - * - * - * @var string - */ - private $familyName; - - /** - * - * - * @var string - */ - private $givenName; - - /** - * - * - * @var string - */ - private $organizationName; - - /** - * - * - * @var string - */ - private $postCode; - - /** - * - * - * @var string - */ - private $postalState; - - /** - * - * - * @var string - */ - private $salesTaxNumber; - - /** - * - * - * @var string - */ - private $salutation; - - /** - * The sorting code identifies the post office at which the post box is located in. - * - * @var string - */ - private $sortingCode; - - /** - * - * - * @var string - */ - private $street; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - } - - - /** - * Returns city. - * - * - * - * @return string - */ - public function getCity() { - return $this->city; - } - - /** - * Sets city. - * - * @param string $city - * @return SpaceAddress - */ - protected function setCity($city) { - $this->city = $city; - - return $this; - } - - /** - * Returns country. - * - * - * - * @return string - */ - public function getCountry() { - return $this->country; - } - - /** - * Sets country. - * - * @param string $country - * @return SpaceAddress - */ - protected function setCountry($country) { - $this->country = $country; - - return $this; - } - - /** - * Returns dependentLocality. - * - * - * - * @return string - */ - public function getDependentLocality() { - return $this->dependentLocality; - } - - /** - * Sets dependentLocality. - * - * @param string $dependentLocality - * @return SpaceAddress - */ - protected function setDependentLocality($dependentLocality) { - $this->dependentLocality = $dependentLocality; - - return $this; - } - - /** - * Returns emailAddress. - * - * The email address is used within emails and as reply to address. - * - * @return string - */ - public function getEmailAddress() { - return $this->emailAddress; - } - - /** - * Sets emailAddress. - * - * @param string $emailAddress - * @return SpaceAddress - */ - protected function setEmailAddress($emailAddress) { - $this->emailAddress = $emailAddress; - - return $this; - } - - /** - * Returns familyName. - * - * - * - * @return string - */ - public function getFamilyName() { - return $this->familyName; - } - - /** - * Sets familyName. - * - * @param string $familyName - * @return SpaceAddress - */ - protected function setFamilyName($familyName) { - $this->familyName = $familyName; - - return $this; - } - - /** - * Returns givenName. - * - * - * - * @return string - */ - public function getGivenName() { - return $this->givenName; - } - - /** - * Sets givenName. - * - * @param string $givenName - * @return SpaceAddress - */ - protected function setGivenName($givenName) { - $this->givenName = $givenName; - - return $this; - } - - /** - * Returns organizationName. - * - * - * - * @return string - */ - public function getOrganizationName() { - return $this->organizationName; - } - - /** - * Sets organizationName. - * - * @param string $organizationName - * @return SpaceAddress - */ - protected function setOrganizationName($organizationName) { - $this->organizationName = $organizationName; - - return $this; - } - - /** - * Returns postCode. - * - * - * - * @return string - */ - public function getPostCode() { - return $this->postCode; - } - - /** - * Sets postCode. - * - * @param string $postCode - * @return SpaceAddress - */ - protected function setPostCode($postCode) { - $this->postCode = $postCode; - - return $this; - } - - /** - * Returns postalState. - * - * - * - * @return string - */ - public function getPostalState() { - return $this->postalState; - } - - /** - * Sets postalState. - * - * @param string $postalState - * @return SpaceAddress - */ - protected function setPostalState($postalState) { - $this->postalState = $postalState; - - return $this; - } - - /** - * Returns salesTaxNumber. - * - * - * - * @return string - */ - public function getSalesTaxNumber() { - return $this->salesTaxNumber; - } - - /** - * Sets salesTaxNumber. - * - * @param string $salesTaxNumber - * @return SpaceAddress - */ - protected function setSalesTaxNumber($salesTaxNumber) { - $this->salesTaxNumber = $salesTaxNumber; - - return $this; - } - - /** - * Returns salutation. - * - * - * - * @return string - */ - public function getSalutation() { - return $this->salutation; - } - - /** - * Sets salutation. - * - * @param string $salutation - * @return SpaceAddress - */ - protected function setSalutation($salutation) { - $this->salutation = $salutation; - - return $this; - } - - /** - * Returns sortingCode. - * - * The sorting code identifies the post office at which the post box is located in. - * - * @return string - */ - public function getSortingCode() { - return $this->sortingCode; - } - - /** - * Sets sortingCode. - * - * @param string $sortingCode - * @return SpaceAddress - */ - protected function setSortingCode($sortingCode) { - $this->sortingCode = $sortingCode; - - return $this; - } - - /** - * Returns street. - * - * - * - * @return string - */ - public function getStreet() { - return $this->street; - } - - /** - * Sets street. - * - * @param string $street - * @return SpaceAddress - */ - protected function setStreet($street) { - $this->street = $street; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SpaceAddress implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SpaceAddress'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'city' => 'string', + 'country' => 'string', + 'dependent_locality' => 'string', + 'email_address' => 'string', + 'family_name' => 'string', + 'given_name' => 'string', + 'organization_name' => 'string', + 'post_code' => 'string', + 'postal_state' => 'string', + 'sales_tax_number' => 'string', + 'salutation' => 'string', + 'sorting_code' => 'string', + 'street' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'city' => null, + 'country' => null, + 'dependent_locality' => null, + 'email_address' => null, + 'family_name' => null, + 'given_name' => null, + 'organization_name' => null, + 'post_code' => null, + 'postal_state' => null, + 'sales_tax_number' => null, + 'salutation' => null, + 'sorting_code' => null, + 'street' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'country' => 'country', + 'dependent_locality' => 'dependentLocality', + 'email_address' => 'emailAddress', + 'family_name' => 'familyName', + 'given_name' => 'givenName', + 'organization_name' => 'organizationName', + 'post_code' => 'postCode', + 'postal_state' => 'postalState', + 'sales_tax_number' => 'salesTaxNumber', + 'salutation' => 'salutation', + 'sorting_code' => 'sortingCode', + 'street' => 'street' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'country' => 'setCountry', + 'dependent_locality' => 'setDependentLocality', + 'email_address' => 'setEmailAddress', + 'family_name' => 'setFamilyName', + 'given_name' => 'setGivenName', + 'organization_name' => 'setOrganizationName', + 'post_code' => 'setPostCode', + 'postal_state' => 'setPostalState', + 'sales_tax_number' => 'setSalesTaxNumber', + 'salutation' => 'setSalutation', + 'sorting_code' => 'setSortingCode', + 'street' => 'setStreet' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'country' => 'getCountry', + 'dependent_locality' => 'getDependentLocality', + 'email_address' => 'getEmailAddress', + 'family_name' => 'getFamilyName', + 'given_name' => 'getGivenName', + 'organization_name' => 'getOrganizationName', + 'post_code' => 'getPostCode', + 'postal_state' => 'getPostalState', + 'sales_tax_number' => 'getSalesTaxNumber', + 'salutation' => 'getSalutation', + 'sorting_code' => 'getSortingCode', + 'street' => 'getStreet' + ]; + + + + /** + * 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['city'] = isset($data['city']) ? $data['city'] : null; + + $this->container['country'] = isset($data['country']) ? $data['country'] : null; + + $this->container['dependent_locality'] = isset($data['dependent_locality']) ? $data['dependent_locality'] : null; + + $this->container['email_address'] = isset($data['email_address']) ? $data['email_address'] : null; + + $this->container['family_name'] = isset($data['family_name']) ? $data['family_name'] : null; + + $this->container['given_name'] = isset($data['given_name']) ? $data['given_name'] : null; + + $this->container['organization_name'] = isset($data['organization_name']) ? $data['organization_name'] : null; + + $this->container['post_code'] = isset($data['post_code']) ? $data['post_code'] : null; + + $this->container['postal_state'] = isset($data['postal_state']) ? $data['postal_state'] : null; + + $this->container['sales_tax_number'] = isset($data['sales_tax_number']) ? $data['sales_tax_number'] : null; + + $this->container['salutation'] = isset($data['salutation']) ? $data['salutation'] : null; + + $this->container['sorting_code'] = isset($data['sorting_code']) ? $data['sorting_code'] : null; + + $this->container['street'] = isset($data['street']) ? $data['street'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 city + * + * @return string + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string $city + * + * @return $this + */ + public function setCity($city) + { + $this->container['city'] = $city; + + return $this; + } + + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country + * + * @return $this + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + + + /** + * Gets dependent_locality + * + * @return string + */ + public function getDependentLocality() + { + return $this->container['dependent_locality']; + } + + /** + * Sets dependent_locality + * + * @param string $dependent_locality + * + * @return $this + */ + public function setDependentLocality($dependent_locality) + { + $this->container['dependent_locality'] = $dependent_locality; + + return $this; + } + + + /** + * Gets email_address + * + * @return string + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string $email_address The email address is used within emails and as reply to address. + * + * @return $this + */ + public function setEmailAddress($email_address) + { + $this->container['email_address'] = $email_address; + + return $this; + } + + + /** + * Gets family_name + * + * @return string + */ + public function getFamilyName() + { + return $this->container['family_name']; + } + + /** + * Sets family_name + * + * @param string $family_name + * + * @return $this + */ + public function setFamilyName($family_name) + { + $this->container['family_name'] = $family_name; + + return $this; + } + + + /** + * Gets given_name + * + * @return string + */ + public function getGivenName() + { + return $this->container['given_name']; + } + + /** + * Sets given_name + * + * @param string $given_name + * + * @return $this + */ + public function setGivenName($given_name) + { + $this->container['given_name'] = $given_name; + + return $this; + } + + + /** + * Gets organization_name + * + * @return string + */ + public function getOrganizationName() + { + return $this->container['organization_name']; + } + + /** + * Sets organization_name + * + * @param string $organization_name + * + * @return $this + */ + public function setOrganizationName($organization_name) + { + $this->container['organization_name'] = $organization_name; + + return $this; + } + + + /** + * Gets post_code + * + * @return string + */ + public function getPostCode() + { + return $this->container['post_code']; + } + + /** + * Sets post_code + * + * @param string $post_code + * + * @return $this + */ + public function setPostCode($post_code) + { + $this->container['post_code'] = $post_code; + + return $this; + } + + + /** + * Gets postal_state + * + * @return string + */ + public function getPostalState() + { + return $this->container['postal_state']; + } + + /** + * Sets postal_state + * + * @param string $postal_state + * + * @return $this + */ + public function setPostalState($postal_state) + { + $this->container['postal_state'] = $postal_state; + + return $this; + } + + + /** + * Gets sales_tax_number + * + * @return string + */ + public function getSalesTaxNumber() + { + return $this->container['sales_tax_number']; + } + + /** + * Sets sales_tax_number + * + * @param string $sales_tax_number + * + * @return $this + */ + public function setSalesTaxNumber($sales_tax_number) + { + $this->container['sales_tax_number'] = $sales_tax_number; + + return $this; + } + + + /** + * Gets salutation + * + * @return string + */ + public function getSalutation() + { + return $this->container['salutation']; + } + + /** + * Sets salutation + * + * @param string $salutation + * + * @return $this + */ + public function setSalutation($salutation) + { + $this->container['salutation'] = $salutation; + + return $this; + } + + + /** + * Gets sorting_code + * + * @return string + */ + public function getSortingCode() + { + return $this->container['sorting_code']; + } + + /** + * Sets sorting_code + * + * @param string $sorting_code The sorting code identifies the post office at which the post box is located in. + * + * @return $this + */ + public function setSortingCode($sorting_code) + { + $this->container['sorting_code'] = $sorting_code; + + return $this; + } + + + /** + * Gets street + * + * @return string + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string $street + * + * @return $this + */ + public function setStreet($street) + { + $this->container['street'] = $street; + + 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/wallee-sdk/lib/Model/SpaceAddressCreate.php b/wallee-sdk/lib/Model/SpaceAddressCreate.php index afe355d..a42944f 100644 --- a/wallee-sdk/lib/Model/SpaceAddressCreate.php +++ b/wallee-sdk/lib/Model/SpaceAddressCreate.php @@ -1,10 +1,8 @@ 'string', - 'country' => 'string', - 'dependentLocality' => 'string', - 'emailAddress' => 'string', - 'familyName' => 'string', - 'givenName' => 'string', - 'organizationName' => 'string', - 'postCode' => 'string', - 'postalState' => 'string', - 'salesTaxNumber' => 'string', - 'salutation' => 'string', - 'sortingCode' => 'string', - 'street' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var string - */ - private $city; - - /** - * - * - * @var string - */ - private $country; - - /** - * - * - * @var string - */ - private $dependentLocality; - - /** - * The email address is used within emails and as reply to address. - * - * @var string - */ - private $emailAddress; - - /** - * - * - * @var string - */ - private $familyName; - - /** - * - * - * @var string - */ - private $givenName; - - /** - * - * - * @var string - */ - private $organizationName; - - /** - * - * - * @var string - */ - private $postCode; - - /** - * - * - * @var string - */ - private $postalState; - - /** - * - * - * @var string - */ - private $salesTaxNumber; - - /** - * - * - * @var string - */ - private $salutation; - - /** - * The sorting code identifies the post office at which the post box is located in. - * - * @var string - */ - private $sortingCode; - - /** - * - * - * @var string - */ - private $street; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['city'])) { - $this->setCity($data['city']); - } - if (isset($data['country'])) { - $this->setCountry($data['country']); - } - if (isset($data['dependentLocality'])) { - $this->setDependentLocality($data['dependentLocality']); - } - if (isset($data['emailAddress'])) { - $this->setEmailAddress($data['emailAddress']); - } - if (isset($data['familyName'])) { - $this->setFamilyName($data['familyName']); - } - if (isset($data['givenName'])) { - $this->setGivenName($data['givenName']); - } - if (isset($data['organizationName'])) { - $this->setOrganizationName($data['organizationName']); - } - if (isset($data['postCode'])) { - $this->setPostCode($data['postCode']); - } - if (isset($data['postalState'])) { - $this->setPostalState($data['postalState']); - } - if (isset($data['salesTaxNumber'])) { - $this->setSalesTaxNumber($data['salesTaxNumber']); - } - if (isset($data['salutation'])) { - $this->setSalutation($data['salutation']); - } - if (isset($data['sortingCode'])) { - $this->setSortingCode($data['sortingCode']); - } - if (isset($data['street'])) { - $this->setStreet($data['street']); - } - } - - - /** - * Returns city. - * - * - * - * @return string - */ - public function getCity() { - return $this->city; - } - - /** - * Sets city. - * - * @param string $city - * @return SpaceAddressCreate - */ - public function setCity($city) { - $this->city = $city; - - return $this; - } - - /** - * Returns country. - * - * - * - * @return string - */ - public function getCountry() { - return $this->country; - } - - /** - * Sets country. - * - * @param string $country - * @return SpaceAddressCreate - */ - public function setCountry($country) { - $this->country = $country; - - return $this; - } - - /** - * Returns dependentLocality. - * - * - * - * @return string - */ - public function getDependentLocality() { - return $this->dependentLocality; - } - - /** - * Sets dependentLocality. - * - * @param string $dependentLocality - * @return SpaceAddressCreate - */ - public function setDependentLocality($dependentLocality) { - $this->dependentLocality = $dependentLocality; - - return $this; - } - - /** - * Returns emailAddress. - * - * The email address is used within emails and as reply to address. - * - * @return string - */ - public function getEmailAddress() { - return $this->emailAddress; - } - - /** - * Sets emailAddress. - * - * @param string $emailAddress - * @return SpaceAddressCreate - */ - public function setEmailAddress($emailAddress) { - $this->emailAddress = $emailAddress; - - return $this; - } - - /** - * Returns familyName. - * - * - * - * @return string - */ - public function getFamilyName() { - return $this->familyName; - } - - /** - * Sets familyName. - * - * @param string $familyName - * @return SpaceAddressCreate - */ - public function setFamilyName($familyName) { - $this->familyName = $familyName; - - return $this; - } - - /** - * Returns givenName. - * - * - * - * @return string - */ - public function getGivenName() { - return $this->givenName; - } - - /** - * Sets givenName. - * - * @param string $givenName - * @return SpaceAddressCreate - */ - public function setGivenName($givenName) { - $this->givenName = $givenName; - - return $this; - } - - /** - * Returns organizationName. - * - * - * - * @return string - */ - public function getOrganizationName() { - return $this->organizationName; - } - - /** - * Sets organizationName. - * - * @param string $organizationName - * @return SpaceAddressCreate - */ - public function setOrganizationName($organizationName) { - $this->organizationName = $organizationName; - - return $this; - } - - /** - * Returns postCode. - * - * - * - * @return string - */ - public function getPostCode() { - return $this->postCode; - } - - /** - * Sets postCode. - * - * @param string $postCode - * @return SpaceAddressCreate - */ - public function setPostCode($postCode) { - $this->postCode = $postCode; - - return $this; - } - - /** - * Returns postalState. - * - * - * - * @return string - */ - public function getPostalState() { - return $this->postalState; - } - - /** - * Sets postalState. - * - * @param string $postalState - * @return SpaceAddressCreate - */ - public function setPostalState($postalState) { - $this->postalState = $postalState; - - return $this; - } - - /** - * Returns salesTaxNumber. - * - * - * - * @return string - */ - public function getSalesTaxNumber() { - return $this->salesTaxNumber; - } - - /** - * Sets salesTaxNumber. - * - * @param string $salesTaxNumber - * @return SpaceAddressCreate - */ - public function setSalesTaxNumber($salesTaxNumber) { - $this->salesTaxNumber = $salesTaxNumber; - - return $this; - } - - /** - * Returns salutation. - * - * - * - * @return string - */ - public function getSalutation() { - return $this->salutation; - } - - /** - * Sets salutation. - * - * @param string $salutation - * @return SpaceAddressCreate - */ - public function setSalutation($salutation) { - $this->salutation = $salutation; - - return $this; - } - - /** - * Returns sortingCode. - * - * The sorting code identifies the post office at which the post box is located in. - * - * @return string - */ - public function getSortingCode() { - return $this->sortingCode; - } - - /** - * Sets sortingCode. - * - * @param string $sortingCode - * @return SpaceAddressCreate - */ - public function setSortingCode($sortingCode) { - $this->sortingCode = $sortingCode; - - return $this; - } - - /** - * Returns street. - * - * - * - * @return string - */ - public function getStreet() { - return $this->street; - } - - /** - * Sets street. - * - * @param string $street - * @return SpaceAddressCreate - */ - public function setStreet($street) { - $this->street = $street; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SpaceAddressCreate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SpaceAddress.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'city' => 'string', + 'country' => 'string', + 'dependent_locality' => 'string', + 'email_address' => 'string', + 'family_name' => 'string', + 'given_name' => 'string', + 'organization_name' => 'string', + 'post_code' => 'string', + 'postal_state' => 'string', + 'sales_tax_number' => 'string', + 'salutation' => 'string', + 'sorting_code' => 'string', + 'street' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'city' => null, + 'country' => null, + 'dependent_locality' => null, + 'email_address' => null, + 'family_name' => null, + 'given_name' => null, + 'organization_name' => null, + 'post_code' => null, + 'postal_state' => null, + 'sales_tax_number' => null, + 'salutation' => null, + 'sorting_code' => null, + 'street' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'country' => 'country', + 'dependent_locality' => 'dependentLocality', + 'email_address' => 'emailAddress', + 'family_name' => 'familyName', + 'given_name' => 'givenName', + 'organization_name' => 'organizationName', + 'post_code' => 'postCode', + 'postal_state' => 'postalState', + 'sales_tax_number' => 'salesTaxNumber', + 'salutation' => 'salutation', + 'sorting_code' => 'sortingCode', + 'street' => 'street' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'country' => 'setCountry', + 'dependent_locality' => 'setDependentLocality', + 'email_address' => 'setEmailAddress', + 'family_name' => 'setFamilyName', + 'given_name' => 'setGivenName', + 'organization_name' => 'setOrganizationName', + 'post_code' => 'setPostCode', + 'postal_state' => 'setPostalState', + 'sales_tax_number' => 'setSalesTaxNumber', + 'salutation' => 'setSalutation', + 'sorting_code' => 'setSortingCode', + 'street' => 'setStreet' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'country' => 'getCountry', + 'dependent_locality' => 'getDependentLocality', + 'email_address' => 'getEmailAddress', + 'family_name' => 'getFamilyName', + 'given_name' => 'getGivenName', + 'organization_name' => 'getOrganizationName', + 'post_code' => 'getPostCode', + 'postal_state' => 'getPostalState', + 'sales_tax_number' => 'getSalesTaxNumber', + 'salutation' => 'getSalutation', + 'sorting_code' => 'getSortingCode', + 'street' => 'getStreet' + ]; + + + + /** + * 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['city'] = isset($data['city']) ? $data['city'] : null; + + $this->container['country'] = isset($data['country']) ? $data['country'] : null; + + $this->container['dependent_locality'] = isset($data['dependent_locality']) ? $data['dependent_locality'] : null; + + $this->container['email_address'] = isset($data['email_address']) ? $data['email_address'] : null; + + $this->container['family_name'] = isset($data['family_name']) ? $data['family_name'] : null; + + $this->container['given_name'] = isset($data['given_name']) ? $data['given_name'] : null; + + $this->container['organization_name'] = isset($data['organization_name']) ? $data['organization_name'] : null; + + $this->container['post_code'] = isset($data['post_code']) ? $data['post_code'] : null; + + $this->container['postal_state'] = isset($data['postal_state']) ? $data['postal_state'] : null; + + $this->container['sales_tax_number'] = isset($data['sales_tax_number']) ? $data['sales_tax_number'] : null; + + $this->container['salutation'] = isset($data['salutation']) ? $data['salutation'] : null; + + $this->container['sorting_code'] = isset($data['sorting_code']) ? $data['sorting_code'] : null; + + $this->container['street'] = isset($data['street']) ? $data['street'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 city + * + * @return string + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string $city + * + * @return $this + */ + public function setCity($city) + { + $this->container['city'] = $city; + + return $this; + } + + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country + * + * @return $this + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + + + /** + * Gets dependent_locality + * + * @return string + */ + public function getDependentLocality() + { + return $this->container['dependent_locality']; + } + + /** + * Sets dependent_locality + * + * @param string $dependent_locality + * + * @return $this + */ + public function setDependentLocality($dependent_locality) + { + $this->container['dependent_locality'] = $dependent_locality; + + return $this; + } + + + /** + * Gets email_address + * + * @return string + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string $email_address The email address is used within emails and as reply to address. + * + * @return $this + */ + public function setEmailAddress($email_address) + { + $this->container['email_address'] = $email_address; + + return $this; + } + + + /** + * Gets family_name + * + * @return string + */ + public function getFamilyName() + { + return $this->container['family_name']; + } + + /** + * Sets family_name + * + * @param string $family_name + * + * @return $this + */ + public function setFamilyName($family_name) + { + $this->container['family_name'] = $family_name; + + return $this; + } + + + /** + * Gets given_name + * + * @return string + */ + public function getGivenName() + { + return $this->container['given_name']; + } + + /** + * Sets given_name + * + * @param string $given_name + * + * @return $this + */ + public function setGivenName($given_name) + { + $this->container['given_name'] = $given_name; + + return $this; + } + + + /** + * Gets organization_name + * + * @return string + */ + public function getOrganizationName() + { + return $this->container['organization_name']; + } + + /** + * Sets organization_name + * + * @param string $organization_name + * + * @return $this + */ + public function setOrganizationName($organization_name) + { + $this->container['organization_name'] = $organization_name; + + return $this; + } + + + /** + * Gets post_code + * + * @return string + */ + public function getPostCode() + { + return $this->container['post_code']; + } + + /** + * Sets post_code + * + * @param string $post_code + * + * @return $this + */ + public function setPostCode($post_code) + { + $this->container['post_code'] = $post_code; + + return $this; + } + + + /** + * Gets postal_state + * + * @return string + */ + public function getPostalState() + { + return $this->container['postal_state']; + } + + /** + * Sets postal_state + * + * @param string $postal_state + * + * @return $this + */ + public function setPostalState($postal_state) + { + $this->container['postal_state'] = $postal_state; + + return $this; + } + + + /** + * Gets sales_tax_number + * + * @return string + */ + public function getSalesTaxNumber() + { + return $this->container['sales_tax_number']; + } + + /** + * Sets sales_tax_number + * + * @param string $sales_tax_number + * + * @return $this + */ + public function setSalesTaxNumber($sales_tax_number) + { + $this->container['sales_tax_number'] = $sales_tax_number; + + return $this; + } + + + /** + * Gets salutation + * + * @return string + */ + public function getSalutation() + { + return $this->container['salutation']; + } + + /** + * Sets salutation + * + * @param string $salutation + * + * @return $this + */ + public function setSalutation($salutation) + { + $this->container['salutation'] = $salutation; + + return $this; + } + + + /** + * Gets sorting_code + * + * @return string + */ + public function getSortingCode() + { + return $this->container['sorting_code']; + } + + /** + * Sets sorting_code + * + * @param string $sorting_code The sorting code identifies the post office at which the post box is located in. + * + * @return $this + */ + public function setSortingCode($sorting_code) + { + $this->container['sorting_code'] = $sorting_code; + + return $this; + } + + + /** + * Gets street + * + * @return string + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string $street + * + * @return $this + */ + public function setStreet($street) + { + $this->container['street'] = $street; + + 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/wallee-sdk/lib/Model/SpaceAddressSetter.php b/wallee-sdk/lib/Model/SpaceAddressSetter.php deleted file mode 100644 index 9fe1b6f..0000000 --- a/wallee-sdk/lib/Model/SpaceAddressSetter.php +++ /dev/null @@ -1,426 +0,0 @@ -setCity($data['city']); - } - if (isset($data['country']) && $data['country'] != null) { - $this->setCountry($data['country']); - } - if (isset($data['dependentLocality']) && $data['dependentLocality'] != null) { - $this->setDependentLocality($data['dependentLocality']); - } - if (isset($data['emailAddress']) && $data['emailAddress'] != null) { - $this->setEmailAddress($data['emailAddress']); - } - if (isset($data['familyName']) && $data['familyName'] != null) { - $this->setFamilyName($data['familyName']); - } - if (isset($data['givenName']) && $data['givenName'] != null) { - $this->setGivenName($data['givenName']); - } - if (isset($data['organizationName']) && $data['organizationName'] != null) { - $this->setOrganizationName($data['organizationName']); - } - if (isset($data['postCode']) && $data['postCode'] != null) { - $this->setPostCode($data['postCode']); - } - if (isset($data['postalState']) && $data['postalState'] != null) { - $this->setPostalState($data['postalState']); - } - if (isset($data['salesTaxNumber']) && $data['salesTaxNumber'] != null) { - $this->setSalesTaxNumber($data['salesTaxNumber']); - } - if (isset($data['salutation']) && $data['salutation'] != null) { - $this->setSalutation($data['salutation']); - } - if (isset($data['sortingCode']) && $data['sortingCode'] != null) { - $this->setSortingCode($data['sortingCode']); - } - if (isset($data['street']) && $data['street'] != null) { - $this->setStreet($data['street']); - } - } - - - /** - * Returns city. - * - * - * - * @return string - */ - public function getCity() { - return parent::getCity(); - } - - /** - * Sets city. - * - * @param string $city - * @return SpaceAddressSetter - */ - public function setCity($city) { - return parent::setCity($city); - } - - /** - * Returns country. - * - * - * - * @return string - */ - public function getCountry() { - return parent::getCountry(); - } - - /** - * Sets country. - * - * @param string $country - * @return SpaceAddressSetter - */ - public function setCountry($country) { - return parent::setCountry($country); - } - - /** - * Returns dependentLocality. - * - * - * - * @return string - */ - public function getDependentLocality() { - return parent::getDependentLocality(); - } - - /** - * Sets dependentLocality. - * - * @param string $dependentLocality - * @return SpaceAddressSetter - */ - public function setDependentLocality($dependentLocality) { - return parent::setDependentLocality($dependentLocality); - } - - /** - * Returns emailAddress. - * - * The email address is used within emails and as reply to address. - * - * @return string - */ - public function getEmailAddress() { - return parent::getEmailAddress(); - } - - /** - * Sets emailAddress. - * - * @param string $emailAddress - * @return SpaceAddressSetter - */ - public function setEmailAddress($emailAddress) { - return parent::setEmailAddress($emailAddress); - } - - /** - * Returns familyName. - * - * - * - * @return string - */ - public function getFamilyName() { - return parent::getFamilyName(); - } - - /** - * Sets familyName. - * - * @param string $familyName - * @return SpaceAddressSetter - */ - public function setFamilyName($familyName) { - return parent::setFamilyName($familyName); - } - - /** - * Returns givenName. - * - * - * - * @return string - */ - public function getGivenName() { - return parent::getGivenName(); - } - - /** - * Sets givenName. - * - * @param string $givenName - * @return SpaceAddressSetter - */ - public function setGivenName($givenName) { - return parent::setGivenName($givenName); - } - - /** - * Returns organizationName. - * - * - * - * @return string - */ - public function getOrganizationName() { - return parent::getOrganizationName(); - } - - /** - * Sets organizationName. - * - * @param string $organizationName - * @return SpaceAddressSetter - */ - public function setOrganizationName($organizationName) { - return parent::setOrganizationName($organizationName); - } - - /** - * Returns postCode. - * - * - * - * @return string - */ - public function getPostCode() { - return parent::getPostCode(); - } - - /** - * Sets postCode. - * - * @param string $postCode - * @return SpaceAddressSetter - */ - public function setPostCode($postCode) { - return parent::setPostCode($postCode); - } - - /** - * Returns postalState. - * - * - * - * @return string - */ - public function getPostalState() { - return parent::getPostalState(); - } - - /** - * Sets postalState. - * - * @param string $postalState - * @return SpaceAddressSetter - */ - public function setPostalState($postalState) { - return parent::setPostalState($postalState); - } - - /** - * Returns salesTaxNumber. - * - * - * - * @return string - */ - public function getSalesTaxNumber() { - return parent::getSalesTaxNumber(); - } - - /** - * Sets salesTaxNumber. - * - * @param string $salesTaxNumber - * @return SpaceAddressSetter - */ - public function setSalesTaxNumber($salesTaxNumber) { - return parent::setSalesTaxNumber($salesTaxNumber); - } - - /** - * Returns salutation. - * - * - * - * @return string - */ - public function getSalutation() { - return parent::getSalutation(); - } - - /** - * Sets salutation. - * - * @param string $salutation - * @return SpaceAddressSetter - */ - public function setSalutation($salutation) { - return parent::setSalutation($salutation); - } - - /** - * Returns sortingCode. - * - * The sorting code identifies the post office at which the post box is located in. - * - * @return string - */ - public function getSortingCode() { - return parent::getSortingCode(); - } - - /** - * Sets sortingCode. - * - * @param string $sortingCode - * @return SpaceAddressSetter - */ - public function setSortingCode($sortingCode) { - return parent::setSortingCode($sortingCode); - } - - /** - * Returns street. - * - * - * - * @return string - */ - public function getStreet() { - return parent::getStreet(); - } - - /** - * Sets street. - * - * @param string $street - * @return SpaceAddressSetter - */ - public function setStreet($street) { - return parent::setStreet($street); - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - -} - diff --git a/wallee-sdk/lib/Model/SpaceCreate.php b/wallee-sdk/lib/Model/SpaceCreate.php index 75e7e74..bb3cd9e 100644 --- a/wallee-sdk/lib/Model/SpaceCreate.php +++ b/wallee-sdk/lib/Model/SpaceCreate.php @@ -1,10 +1,8 @@ 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * The account to which the space belongs to. - * - * @var int - */ - private $account; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['account'])) { - $this->setAccount($data['account']); - } - } - - - /** - * Returns account. - * - * The account to which the space belongs to. - * - * @return int - */ - public function getAccount() { - return $this->account; - } - - /** - * Sets account. - * - * @param int $account - * @return SpaceCreate - */ - public function setAccount($account) { - $this->account = $account; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - if ($this->getAccount() === null) { - throw new ValidationException("'account' can't be null", 'account', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class SpaceCreate extends AbstractSpaceUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Space.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'account' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'account' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account' => 'account' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account' => 'setAccount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account' => 'getAccount' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['account'] = isset($data['account']) ? $data['account'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['account'] === null) { + $invalidProperties[] = "'account' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 account + * + * @return int + */ + public function getAccount() + { + return $this->container['account']; + } + + /** + * Sets account + * + * @param int $account The account to which the space belongs to. + * + * @return $this + */ + public function setAccount($account) + { + $this->container['account'] = $account; + + 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/wallee-sdk/lib/Model/SpaceReference.php b/wallee-sdk/lib/Model/SpaceReference.php index 3314a65..d0f8d5b 100644 --- a/wallee-sdk/lib/Model/SpaceReference.php +++ b/wallee-sdk/lib/Model/SpaceReference.php @@ -1,10 +1,8 @@ '\DateTime', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'plannedPurgeDate' => '\DateTime', - 'spaceId' => 'int', - 'state' => '\Wallee\Sdk\Model\SpaceReferenceState', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \DateTime - */ - private $createdOn; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var int - */ - private $spaceId; - - /** - * - * - * @var \Wallee\Sdk\Model\SpaceReferenceState - */ - private $state; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns createdOn. - * - * - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return SpaceReference - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SpaceReference - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return SpaceReference - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return SpaceReference - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns spaceId. - * - * - * - * @return int - */ - public function getSpaceId() { - return $this->spaceId; - } - - /** - * Sets spaceId. - * - * @param int $spaceId - * @return SpaceReference - */ - protected function setSpaceId($spaceId) { - $this->spaceId = $spaceId; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\SpaceReferenceState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\SpaceReferenceState $state - * @return SpaceReference - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SpaceReference - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SpaceReference implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SpaceReference'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'created_on' => '\DateTime', + 'id' => 'int', + 'linked_space_id' => 'int', + 'planned_purge_date' => '\DateTime', + 'space_id' => 'int', + 'state' => '\Wallee\Sdk\Model\SpaceReferenceState', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'created_on' => 'date-time', + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'planned_purge_date' => 'date-time', + 'space_id' => 'int64', + 'state' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'created_on' => 'createdOn', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'planned_purge_date' => 'plannedPurgeDate', + 'space_id' => 'spaceId', + 'state' => 'state', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'created_on' => 'setCreatedOn', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'space_id' => 'setSpaceId', + 'state' => 'setState', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'created_on' => 'getCreatedOn', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'space_id' => 'getSpaceId', + 'state' => 'getState', + 'version' => 'getVersion' + ]; + + + + /** + * 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['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['space_id'] = isset($data['space_id']) ? $data['space_id'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets space_id + * + * @return int + */ + public function getSpaceId() + { + return $this->container['space_id']; + } + + /** + * Sets space_id + * + * @param int $space_id + * + * @return $this + */ + public function setSpaceId($space_id) + { + $this->container['space_id'] = $space_id; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\SpaceReferenceState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\SpaceReferenceState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/SpaceReferenceState.php b/wallee-sdk/lib/Model/SpaceReferenceState.php index 6f0a1c9..0c982db 100644 --- a/wallee-sdk/lib/Model/SpaceReferenceState.php +++ b/wallee-sdk/lib/Model/SpaceReferenceState.php @@ -1,10 +1,8 @@ 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SpaceUpdate - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SpaceUpdate - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - if ($this->getId() === null) { - throw new ValidationException("'id' can't be null", 'id', $this); - } - if ($this->getVersion() === null) { - throw new ValidationException("'version' can't be null", 'version', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class SpaceUpdate extends AbstractSpaceUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Space.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/SpaceView.php b/wallee-sdk/lib/Model/SpaceView.php index 8165b23..58c81c1 100644 --- a/wallee-sdk/lib/Model/SpaceView.php +++ b/wallee-sdk/lib/Model/SpaceView.php @@ -1,10 +1,8 @@ 'int', - 'linkedSpaceId' => 'int', - 'name' => 'string', - 'plannedPurgeDate' => '\DateTime', - 'space' => '\Wallee\Sdk\Model\Space', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The space view name is used internally to identify the space view in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * The space to which the view belongs to. - * - * @var \Wallee\Sdk\Model\Space - */ - private $space; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['space'])) { - $this->setSpace($data['space']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SpaceView - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return SpaceView - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * The space view name is used internally to identify the space view in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return SpaceView - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return SpaceView - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns space. - * - * The space to which the view belongs to. - * - * @return \Wallee\Sdk\Model\Space - */ - public function getSpace() { - return $this->space; - } - - /** - * Sets space. - * - * @param \Wallee\Sdk\Model\Space $space - * @return SpaceView - */ - public function setSpace($space) { - $this->space = $space; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return SpaceView - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SpaceView - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SpaceView implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SpaceView'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'linked_space_id' => 'int', + 'name' => 'string', + 'planned_purge_date' => '\DateTime', + 'space' => '\Wallee\Sdk\Model\Space', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'name' => null, + 'planned_purge_date' => 'date-time', + 'space' => null, + 'state' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'planned_purge_date' => 'plannedPurgeDate', + 'space' => 'space', + 'state' => 'state', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'space' => 'setSpace', + 'state' => 'setState', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'space' => 'getSpace', + 'state' => 'getState', + 'version' => 'getVersion' + ]; + + + + /** + * 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['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['space'] = isset($data['space']) ? $data['space'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The space view name is used internally to identify the space view in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets space + * + * @return \Wallee\Sdk\Model\Space + */ + public function getSpace() + { + return $this->container['space']; + } + + /** + * Sets space + * + * @param \Wallee\Sdk\Model\Space $space The space to which the view belongs to. + * + * @return $this + */ + public function setSpace($space) + { + $this->container['space'] = $space; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/StaticValue.php b/wallee-sdk/lib/Model/StaticValue.php index afba9d0..33c4f3f 100644 --- a/wallee-sdk/lib/Model/StaticValue.php +++ b/wallee-sdk/lib/Model/StaticValue.php @@ -1,10 +1,8 @@ 'map[string,string]', - 'features' => 'int[]', - 'id' => 'int', - 'name' => 'map[string,string]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * - * - * @var int[] - */ - private $features; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $name; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['features'])) { - $this->setFeatures($data['features']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - } - - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return StaticValue - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns features. - * - * - * - * @return int[] - */ - public function getFeatures() { - return $this->features; - } - - /** - * Sets features. - * - * @param int[] $features - * @return StaticValue - */ - public function setFeatures($features) { - $this->features = $features; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return StaticValue - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return StaticValue - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class StaticValue implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'StaticValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'description' => 'map[string,string]', + 'features' => 'int[]', + 'id' => 'int', + 'name' => 'map[string,string]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'features' => 'int64', + 'id' => 'int64', + 'name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'features' => 'features', + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'features' => 'setFeatures', + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'features' => 'getFeatures', + 'id' => 'getId', + 'name' => 'getName' + ]; + + + + /** + * 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['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['features'] = isset($data['features']) ? $data['features'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets features + * + * @return int[] + */ + public function getFeatures() + { + return $this->container['features']; + } + + /** + * Sets features + * + * @param int[] $features + * + * @return $this + */ + public function setFeatures($features) + { + $this->container['features'] = $features; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + 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/wallee-sdk/lib/Model/Subscriber.php b/wallee-sdk/lib/Model/Subscriber.php index d45e521..7d84e23 100644 --- a/wallee-sdk/lib/Model/Subscriber.php +++ b/wallee-sdk/lib/Model/Subscriber.php @@ -1,10 +1,8 @@ 'int[]', - 'billingAddress' => '\Wallee\Sdk\Model\Address', - 'description' => 'string', - 'disallowedPaymentMethodConfigurations' => 'int[]', - 'emailAddress' => 'string', - 'externalId' => 'string', - 'id' => 'int', - 'language' => 'string', - 'linkedSpaceId' => 'int', - 'metaData' => 'map[string,string]', - 'plannedPurgeDate' => '\DateTime', - 'reference' => 'string', - 'shippingAddress' => '\Wallee\Sdk\Model\Address', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * Those payment methods which are allowed additionally will be available even when the product does not allow those methods. - * - * @var int[] - */ - private $additionalAllowedPaymentMethodConfigurations; - - /** - * - * - * @var \Wallee\Sdk\Model\Address - */ - private $billingAddress; - - /** - * The subscriber description can be used to add a description to the subscriber. This is used in the back office to identify the subscriber. - * - * @var string - */ - private $description; - - /** - * Those payment methods which are disallowed will not be available to the subscriber even if the product allows those methods. - * - * @var int[] - */ - private $disallowedPaymentMethodConfigurations; - - /** - * The email address is used to communicate with the subscriber. There can be only one subscriber per space with the same email address. - * - * @var string - */ - private $emailAddress; - - /** - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @var string - */ - private $externalId; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The subscriber language determines the language which is used to communicate with the subscriber in emails and documents (e.g. invoices). - * - * @var string - */ - private $language; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * Meta data allow to store additional data along the object. - * - * @var map[string,string] - */ - private $metaData; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * The subscriber reference identifies the subscriber in administrative interfaces (e.g. customer id). - * - * @var string - */ - private $reference; - - /** - * - * - * @var \Wallee\Sdk\Model\Address - */ - private $shippingAddress; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['additionalAllowedPaymentMethodConfigurations'])) { - $this->setAdditionalAllowedPaymentMethodConfigurations($data['additionalAllowedPaymentMethodConfigurations']); - } - if (isset($data['billingAddress'])) { - $this->setBillingAddress($data['billingAddress']); - } - if (isset($data['disallowedPaymentMethodConfigurations'])) { - $this->setDisallowedPaymentMethodConfigurations($data['disallowedPaymentMethodConfigurations']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['metaData'])) { - $this->setMetaData($data['metaData']); - } - if (isset($data['shippingAddress'])) { - $this->setShippingAddress($data['shippingAddress']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns additionalAllowedPaymentMethodConfigurations. - * - * Those payment methods which are allowed additionally will be available even when the product does not allow those methods. - * - * @return int[] - */ - public function getAdditionalAllowedPaymentMethodConfigurations() { - return $this->additionalAllowedPaymentMethodConfigurations; - } - - /** - * Sets additionalAllowedPaymentMethodConfigurations. - * - * @param int[] $additionalAllowedPaymentMethodConfigurations - * @return Subscriber - */ - public function setAdditionalAllowedPaymentMethodConfigurations($additionalAllowedPaymentMethodConfigurations) { - $this->additionalAllowedPaymentMethodConfigurations = $additionalAllowedPaymentMethodConfigurations; - - return $this; - } - - /** - * Returns billingAddress. - * - * - * - * @return \Wallee\Sdk\Model\Address - */ - public function getBillingAddress() { - return $this->billingAddress; - } - - /** - * Sets billingAddress. - * - * @param \Wallee\Sdk\Model\Address $billingAddress - * @return Subscriber - */ - public function setBillingAddress($billingAddress) { - $this->billingAddress = $billingAddress; - - return $this; - } - - /** - * Returns description. - * - * The subscriber description can be used to add a description to the subscriber. This is used in the back office to identify the subscriber. - * - * @return string - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param string $description - * @return Subscriber - */ - protected function setDescription($description) { - $this->description = $description; - - return $this; - } - - /** - * Returns disallowedPaymentMethodConfigurations. - * - * Those payment methods which are disallowed will not be available to the subscriber even if the product allows those methods. - * - * @return int[] - */ - public function getDisallowedPaymentMethodConfigurations() { - return $this->disallowedPaymentMethodConfigurations; - } - - /** - * Sets disallowedPaymentMethodConfigurations. - * - * @param int[] $disallowedPaymentMethodConfigurations - * @return Subscriber - */ - public function setDisallowedPaymentMethodConfigurations($disallowedPaymentMethodConfigurations) { - $this->disallowedPaymentMethodConfigurations = $disallowedPaymentMethodConfigurations; - - return $this; - } - - /** - * Returns emailAddress. - * - * The email address is used to communicate with the subscriber. There can be only one subscriber per space with the same email address. - * - * @return string - */ - public function getEmailAddress() { - return $this->emailAddress; - } - - /** - * Sets emailAddress. - * - * @param string $emailAddress - * @return Subscriber - */ - protected function setEmailAddress($emailAddress) { - $this->emailAddress = $emailAddress; - - return $this; - } - - /** - * Returns externalId. - * - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @return string - */ - public function getExternalId() { - return $this->externalId; - } - - /** - * Sets externalId. - * - * @param string $externalId - * @return Subscriber - */ - protected function setExternalId($externalId) { - $this->externalId = $externalId; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return Subscriber - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns language. - * - * The subscriber language determines the language which is used to communicate with the subscriber in emails and documents (e.g. invoices). - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return Subscriber - */ - protected function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return Subscriber - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns metaData. - * - * Meta data allow to store additional data along the object. - * - * @return map[string,string] - */ - public function getMetaData() { - return $this->metaData; - } - - /** - * Sets metaData. - * - * @param map[string,string] $metaData - * @return Subscriber - */ - public function setMetaData($metaData) { - if (is_array($metaData) && empty($metaData)) { - $this->metaData = new \stdClass; - } else { - $this->metaData = $metaData; - } - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return Subscriber - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns reference. - * - * The subscriber reference identifies the subscriber in administrative interfaces (e.g. customer id). - * - * @return string - */ - public function getReference() { - return $this->reference; - } - - /** - * Sets reference. - * - * @param string $reference - * @return Subscriber - */ - protected function setReference($reference) { - $this->reference = $reference; - - return $this; - } - - /** - * Returns shippingAddress. - * - * - * - * @return \Wallee\Sdk\Model\Address - */ - public function getShippingAddress() { - return $this->shippingAddress; - } - - /** - * Sets shippingAddress. - * - * @param \Wallee\Sdk\Model\Address $shippingAddress - * @return Subscriber - */ - public function setShippingAddress($shippingAddress) { - $this->shippingAddress = $shippingAddress; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return Subscriber - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return Subscriber - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class Subscriber implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Subscriber'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'additional_allowed_payment_method_configurations' => 'int[]', + 'billing_address' => '\Wallee\Sdk\Model\Address', + 'description' => 'string', + 'disallowed_payment_method_configurations' => 'int[]', + 'email_address' => 'string', + 'external_id' => 'string', + 'id' => 'int', + 'language' => 'string', + 'linked_space_id' => 'int', + 'meta_data' => 'map[string,string]', + 'planned_purge_date' => '\DateTime', + 'reference' => 'string', + 'shipping_address' => '\Wallee\Sdk\Model\Address', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'additional_allowed_payment_method_configurations' => 'int64', + 'billing_address' => null, + 'description' => null, + 'disallowed_payment_method_configurations' => 'int64', + 'email_address' => null, + 'external_id' => null, + 'id' => 'int64', + 'language' => null, + 'linked_space_id' => 'int64', + 'meta_data' => null, + 'planned_purge_date' => 'date-time', + 'reference' => null, + 'shipping_address' => null, + 'state' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'additional_allowed_payment_method_configurations' => 'additionalAllowedPaymentMethodConfigurations', + 'billing_address' => 'billingAddress', + 'description' => 'description', + 'disallowed_payment_method_configurations' => 'disallowedPaymentMethodConfigurations', + 'email_address' => 'emailAddress', + 'external_id' => 'externalId', + 'id' => 'id', + 'language' => 'language', + 'linked_space_id' => 'linkedSpaceId', + 'meta_data' => 'metaData', + 'planned_purge_date' => 'plannedPurgeDate', + 'reference' => 'reference', + 'shipping_address' => 'shippingAddress', + 'state' => 'state', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additional_allowed_payment_method_configurations' => 'setAdditionalAllowedPaymentMethodConfigurations', + 'billing_address' => 'setBillingAddress', + 'description' => 'setDescription', + 'disallowed_payment_method_configurations' => 'setDisallowedPaymentMethodConfigurations', + 'email_address' => 'setEmailAddress', + 'external_id' => 'setExternalId', + 'id' => 'setId', + 'language' => 'setLanguage', + 'linked_space_id' => 'setLinkedSpaceId', + 'meta_data' => 'setMetaData', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'reference' => 'setReference', + 'shipping_address' => 'setShippingAddress', + 'state' => 'setState', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additional_allowed_payment_method_configurations' => 'getAdditionalAllowedPaymentMethodConfigurations', + 'billing_address' => 'getBillingAddress', + 'description' => 'getDescription', + 'disallowed_payment_method_configurations' => 'getDisallowedPaymentMethodConfigurations', + 'email_address' => 'getEmailAddress', + 'external_id' => 'getExternalId', + 'id' => 'getId', + 'language' => 'getLanguage', + 'linked_space_id' => 'getLinkedSpaceId', + 'meta_data' => 'getMetaData', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'reference' => 'getReference', + 'shipping_address' => 'getShippingAddress', + 'state' => 'getState', + 'version' => 'getVersion' + ]; + + + + /** + * 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['additional_allowed_payment_method_configurations'] = isset($data['additional_allowed_payment_method_configurations']) ? $data['additional_allowed_payment_method_configurations'] : null; + + $this->container['billing_address'] = isset($data['billing_address']) ? $data['billing_address'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['disallowed_payment_method_configurations'] = isset($data['disallowed_payment_method_configurations']) ? $data['disallowed_payment_method_configurations'] : null; + + $this->container['email_address'] = isset($data['email_address']) ? $data['email_address'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['meta_data'] = isset($data['meta_data']) ? $data['meta_data'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['reference'] = isset($data['reference']) ? $data['reference'] : null; + + $this->container['shipping_address'] = isset($data['shipping_address']) ? $data['shipping_address'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 additional_allowed_payment_method_configurations + * + * @return int[] + */ + public function getAdditionalAllowedPaymentMethodConfigurations() + { + return $this->container['additional_allowed_payment_method_configurations']; + } + + /** + * Sets additional_allowed_payment_method_configurations + * + * @param int[] $additional_allowed_payment_method_configurations Those payment methods which are allowed additionally will be available even when the product does not allow those methods. + * + * @return $this + */ + public function setAdditionalAllowedPaymentMethodConfigurations($additional_allowed_payment_method_configurations) + { + $this->container['additional_allowed_payment_method_configurations'] = $additional_allowed_payment_method_configurations; + + return $this; + } + + + /** + * Gets billing_address + * + * @return \Wallee\Sdk\Model\Address + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Wallee\Sdk\Model\Address $billing_address + * + * @return $this + */ + public function setBillingAddress($billing_address) + { + $this->container['billing_address'] = $billing_address; + + return $this; + } + + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description The subscriber description can be used to add a description to the subscriber. This is used in the back office to identify the subscriber. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets disallowed_payment_method_configurations + * + * @return int[] + */ + public function getDisallowedPaymentMethodConfigurations() + { + return $this->container['disallowed_payment_method_configurations']; + } + + /** + * Sets disallowed_payment_method_configurations + * + * @param int[] $disallowed_payment_method_configurations Those payment methods which are disallowed will not be available to the subscriber even if the product allows those methods. + * + * @return $this + */ + public function setDisallowedPaymentMethodConfigurations($disallowed_payment_method_configurations) + { + $this->container['disallowed_payment_method_configurations'] = $disallowed_payment_method_configurations; + + return $this; + } + + + /** + * Gets email_address + * + * @return string + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string $email_address The email address is used to communicate with the subscriber. There can be only one subscriber per space with the same email address. + * + * @return $this + */ + public function setEmailAddress($email_address) + { + $this->container['email_address'] = $email_address; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language The subscriber language determines the language which is used to communicate with the subscriber in emails and documents (e.g. invoices). + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets meta_data + * + * @return map[string,string] + */ + public function getMetaData() + { + return $this->container['meta_data']; + } + + /** + * Sets meta_data + * + * @param map[string,string] $meta_data Meta data allow to store additional data along the object. + * + * @return $this + */ + public function setMetaData($meta_data) + { + $this->container['meta_data'] = $meta_data; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference The subscriber reference identifies the subscriber in administrative interfaces (e.g. customer id). + * + * @return $this + */ + public function setReference($reference) + { + $this->container['reference'] = $reference; + + return $this; + } + + + /** + * Gets shipping_address + * + * @return \Wallee\Sdk\Model\Address + */ + public function getShippingAddress() + { + return $this->container['shipping_address']; + } + + /** + * Sets shipping_address + * + * @param \Wallee\Sdk\Model\Address $shipping_address + * + * @return $this + */ + public function setShippingAddress($shipping_address) + { + $this->container['shipping_address'] = $shipping_address; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/SubscriberActive.php b/wallee-sdk/lib/Model/SubscriberActive.php index 0b90b64..3f22f66 100644 --- a/wallee-sdk/lib/Model/SubscriberActive.php +++ b/wallee-sdk/lib/Model/SubscriberActive.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\CreationEntityState' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['state'])) { - $this->setState($data['state']); - } - } - - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return SubscriberActive - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class SubscriberActive extends SubscriberUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Subscriber.Active'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'state' => '\Wallee\Sdk\Model\CreationEntityState' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'state' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'state' => 'state' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'state' => 'setState' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'state' => 'getState' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + 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/wallee-sdk/lib/Model/SubscriberCreate.php b/wallee-sdk/lib/Model/SubscriberCreate.php index 3707f7f..a8168a2 100644 --- a/wallee-sdk/lib/Model/SubscriberCreate.php +++ b/wallee-sdk/lib/Model/SubscriberCreate.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\CreationEntityState', - 'externalId' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @var string - */ - private $externalId; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['externalId'])) { - $this->setExternalId($data['externalId']); - } - } - - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return SubscriberCreate - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns externalId. - * - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @return string - */ - public function getExternalId() { - return $this->externalId; - } - - /** - * Sets externalId. - * - * @param string $externalId - * @return SubscriberCreate - */ - public function setExternalId($externalId) { - $this->externalId = $externalId; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - if ($this->getExternalId() === null) { - throw new ValidationException("'externalId' can't be null", 'externalId', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class SubscriberCreate extends AbstractSubscriberUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Subscriber.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'external_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'state' => null, + 'external_id' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'state' => 'state', + 'external_id' => 'externalId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'state' => 'setState', + 'external_id' => 'setExternalId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'state' => 'getState', + 'external_id' => 'getExternalId' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['external_id'] === null) { + $invalidProperties[] = "'external_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + 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/wallee-sdk/lib/Model/SubscriberUpdate.php b/wallee-sdk/lib/Model/SubscriberUpdate.php index 5a6574c..8b105cc 100644 --- a/wallee-sdk/lib/Model/SubscriberUpdate.php +++ b/wallee-sdk/lib/Model/SubscriberUpdate.php @@ -1,10 +1,8 @@ 'int', - 'version' => 'int', - 'additionalAllowedPaymentMethodConfigurations' => 'int[]', - 'billingAddress' => '\Wallee\Sdk\Model\AddressCreate', - 'description' => 'string', - 'disallowedPaymentMethodConfigurations' => 'int[]', - 'emailAddress' => 'string', - 'language' => 'string', - 'metaData' => 'map[string,string]', - 'reference' => 'string', - 'shippingAddress' => '\Wallee\Sdk\Model\AddressCreate' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - /** - * Those payment methods which are allowed additionally will be available even when the product does not allow those methods. - * - * @var int[] - */ - private $additionalAllowedPaymentMethodConfigurations; - - /** - * - * - * @var \Wallee\Sdk\Model\AddressCreate - */ - private $billingAddress; - - /** - * The subscriber description can be used to add a description to the subscriber. This is used in the back office to identify the subscriber. - * - * @var string - */ - private $description; - - /** - * Those payment methods which are disallowed will not be available to the subscriber even if the product allows those methods. - * - * @var int[] - */ - private $disallowedPaymentMethodConfigurations; - - /** - * The email address is used to communicate with the subscriber. There can be only one subscriber per space with the same email address. - * - * @var string - */ - private $emailAddress; - - /** - * The subscriber language determines the language which is used to communicate with the subscriber in emails and documents (e.g. invoices). - * - * @var string - */ - private $language; - - /** - * Meta data allow to store additional data along the object. - * - * @var map[string,string] - */ - private $metaData; - - /** - * The subscriber reference identifies the subscriber in administrative interfaces (e.g. customer id). - * - * @var string - */ - private $reference; - - /** - * - * - * @var \Wallee\Sdk\Model\AddressCreate - */ - private $shippingAddress; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - if (isset($data['additionalAllowedPaymentMethodConfigurations'])) { - $this->setAdditionalAllowedPaymentMethodConfigurations($data['additionalAllowedPaymentMethodConfigurations']); - } - if (isset($data['billingAddress'])) { - $this->setBillingAddress($data['billingAddress']); - } - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['disallowedPaymentMethodConfigurations'])) { - $this->setDisallowedPaymentMethodConfigurations($data['disallowedPaymentMethodConfigurations']); - } - if (isset($data['emailAddress'])) { - $this->setEmailAddress($data['emailAddress']); - } - if (isset($data['language'])) { - $this->setLanguage($data['language']); - } - if (isset($data['metaData'])) { - $this->setMetaData($data['metaData']); - } - if (isset($data['reference'])) { - $this->setReference($data['reference']); - } - if (isset($data['shippingAddress'])) { - $this->setShippingAddress($data['shippingAddress']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriberUpdate - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriberUpdate - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Returns additionalAllowedPaymentMethodConfigurations. - * - * Those payment methods which are allowed additionally will be available even when the product does not allow those methods. - * - * @return int[] - */ - public function getAdditionalAllowedPaymentMethodConfigurations() { - return $this->additionalAllowedPaymentMethodConfigurations; - } - - /** - * Sets additionalAllowedPaymentMethodConfigurations. - * - * @param int[] $additionalAllowedPaymentMethodConfigurations - * @return SubscriberUpdate - */ - public function setAdditionalAllowedPaymentMethodConfigurations($additionalAllowedPaymentMethodConfigurations) { - $this->additionalAllowedPaymentMethodConfigurations = $additionalAllowedPaymentMethodConfigurations; - - return $this; - } - - /** - * Returns billingAddress. - * - * - * - * @return \Wallee\Sdk\Model\AddressCreate - */ - public function getBillingAddress() { - return $this->billingAddress; - } - - /** - * Sets billingAddress. - * - * @param \Wallee\Sdk\Model\AddressCreate $billingAddress - * @return SubscriberUpdate - */ - public function setBillingAddress($billingAddress) { - $this->billingAddress = $billingAddress; - - return $this; - } - - /** - * Returns description. - * - * The subscriber description can be used to add a description to the subscriber. This is used in the back office to identify the subscriber. - * - * @return string - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param string $description - * @return SubscriberUpdate - */ - public function setDescription($description) { - $this->description = $description; - - return $this; - } - - /** - * Returns disallowedPaymentMethodConfigurations. - * - * Those payment methods which are disallowed will not be available to the subscriber even if the product allows those methods. - * - * @return int[] - */ - public function getDisallowedPaymentMethodConfigurations() { - return $this->disallowedPaymentMethodConfigurations; - } - - /** - * Sets disallowedPaymentMethodConfigurations. - * - * @param int[] $disallowedPaymentMethodConfigurations - * @return SubscriberUpdate - */ - public function setDisallowedPaymentMethodConfigurations($disallowedPaymentMethodConfigurations) { - $this->disallowedPaymentMethodConfigurations = $disallowedPaymentMethodConfigurations; - - return $this; - } - - /** - * Returns emailAddress. - * - * The email address is used to communicate with the subscriber. There can be only one subscriber per space with the same email address. - * - * @return string - */ - public function getEmailAddress() { - return $this->emailAddress; - } - - /** - * Sets emailAddress. - * - * @param string $emailAddress - * @return SubscriberUpdate - */ - public function setEmailAddress($emailAddress) { - $this->emailAddress = $emailAddress; - - return $this; - } - - /** - * Returns language. - * - * The subscriber language determines the language which is used to communicate with the subscriber in emails and documents (e.g. invoices). - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return SubscriberUpdate - */ - public function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns metaData. - * - * Meta data allow to store additional data along the object. - * - * @return map[string,string] - */ - public function getMetaData() { - return $this->metaData; - } - - /** - * Sets metaData. - * - * @param map[string,string] $metaData - * @return SubscriberUpdate - */ - public function setMetaData($metaData) { - if (is_array($metaData) && empty($metaData)) { - $this->metaData = new \stdClass; - } else { - $this->metaData = $metaData; - } - - return $this; - } - - /** - * Returns reference. - * - * The subscriber reference identifies the subscriber in administrative interfaces (e.g. customer id). - * - * @return string - */ - public function getReference() { - return $this->reference; - } - - /** - * Sets reference. - * - * @param string $reference - * @return SubscriberUpdate - */ - public function setReference($reference) { - $this->reference = $reference; - - return $this; - } - - /** - * Returns shippingAddress. - * - * - * - * @return \Wallee\Sdk\Model\AddressCreate - */ - public function getShippingAddress() { - return $this->shippingAddress; - } - - /** - * Sets shippingAddress. - * - * @param \Wallee\Sdk\Model\AddressCreate $shippingAddress - * @return SubscriberUpdate - */ - public function setShippingAddress($shippingAddress) { - $this->shippingAddress = $shippingAddress; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getId() === null) { - throw new ValidationException("'id' can't be null", 'id', $this); - } - if ($this->getVersion() === null) { - throw new ValidationException("'version' can't be null", 'version', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriberUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Subscriber.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'version' => 'int', + 'additional_allowed_payment_method_configurations' => 'int[]', + 'billing_address' => '\Wallee\Sdk\Model\AddressCreate', + 'description' => 'string', + 'disallowed_payment_method_configurations' => 'int[]', + 'email_address' => 'string', + 'language' => 'string', + 'meta_data' => 'map[string,string]', + 'reference' => 'string', + 'shipping_address' => '\Wallee\Sdk\Model\AddressCreate' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64', + 'additional_allowed_payment_method_configurations' => 'int64', + 'billing_address' => null, + 'description' => null, + 'disallowed_payment_method_configurations' => 'int64', + 'email_address' => null, + 'language' => null, + 'meta_data' => null, + 'reference' => null, + 'shipping_address' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version', + 'additional_allowed_payment_method_configurations' => 'additionalAllowedPaymentMethodConfigurations', + 'billing_address' => 'billingAddress', + 'description' => 'description', + 'disallowed_payment_method_configurations' => 'disallowedPaymentMethodConfigurations', + 'email_address' => 'emailAddress', + 'language' => 'language', + 'meta_data' => 'metaData', + 'reference' => 'reference', + 'shipping_address' => 'shippingAddress' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion', + 'additional_allowed_payment_method_configurations' => 'setAdditionalAllowedPaymentMethodConfigurations', + 'billing_address' => 'setBillingAddress', + 'description' => 'setDescription', + 'disallowed_payment_method_configurations' => 'setDisallowedPaymentMethodConfigurations', + 'email_address' => 'setEmailAddress', + 'language' => 'setLanguage', + 'meta_data' => 'setMetaData', + 'reference' => 'setReference', + 'shipping_address' => 'setShippingAddress' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion', + 'additional_allowed_payment_method_configurations' => 'getAdditionalAllowedPaymentMethodConfigurations', + 'billing_address' => 'getBillingAddress', + 'description' => 'getDescription', + 'disallowed_payment_method_configurations' => 'getDisallowedPaymentMethodConfigurations', + 'email_address' => 'getEmailAddress', + 'language' => 'getLanguage', + 'meta_data' => 'getMetaData', + 'reference' => 'getReference', + 'shipping_address' => 'getShippingAddress' + ]; + + + + /** + * 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['version'] = isset($data['version']) ? $data['version'] : null; + + $this->container['additional_allowed_payment_method_configurations'] = isset($data['additional_allowed_payment_method_configurations']) ? $data['additional_allowed_payment_method_configurations'] : null; + + $this->container['billing_address'] = isset($data['billing_address']) ? $data['billing_address'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['disallowed_payment_method_configurations'] = isset($data['disallowed_payment_method_configurations']) ? $data['disallowed_payment_method_configurations'] : null; + + $this->container['email_address'] = isset($data['email_address']) ? $data['email_address'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['meta_data'] = isset($data['meta_data']) ? $data['meta_data'] : null; + + $this->container['reference'] = isset($data['reference']) ? $data['reference'] : null; + + $this->container['shipping_address'] = isset($data['shipping_address']) ? $data['shipping_address'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + + /** + * Gets additional_allowed_payment_method_configurations + * + * @return int[] + */ + public function getAdditionalAllowedPaymentMethodConfigurations() + { + return $this->container['additional_allowed_payment_method_configurations']; + } + + /** + * Sets additional_allowed_payment_method_configurations + * + * @param int[] $additional_allowed_payment_method_configurations Those payment methods which are allowed additionally will be available even when the product does not allow those methods. + * + * @return $this + */ + public function setAdditionalAllowedPaymentMethodConfigurations($additional_allowed_payment_method_configurations) + { + $this->container['additional_allowed_payment_method_configurations'] = $additional_allowed_payment_method_configurations; + + return $this; + } + + + /** + * Gets billing_address + * + * @return \Wallee\Sdk\Model\AddressCreate + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Wallee\Sdk\Model\AddressCreate $billing_address + * + * @return $this + */ + public function setBillingAddress($billing_address) + { + $this->container['billing_address'] = $billing_address; + + return $this; + } + + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description The subscriber description can be used to add a description to the subscriber. This is used in the back office to identify the subscriber. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets disallowed_payment_method_configurations + * + * @return int[] + */ + public function getDisallowedPaymentMethodConfigurations() + { + return $this->container['disallowed_payment_method_configurations']; + } + + /** + * Sets disallowed_payment_method_configurations + * + * @param int[] $disallowed_payment_method_configurations Those payment methods which are disallowed will not be available to the subscriber even if the product allows those methods. + * + * @return $this + */ + public function setDisallowedPaymentMethodConfigurations($disallowed_payment_method_configurations) + { + $this->container['disallowed_payment_method_configurations'] = $disallowed_payment_method_configurations; + + return $this; + } + + + /** + * Gets email_address + * + * @return string + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string $email_address The email address is used to communicate with the subscriber. There can be only one subscriber per space with the same email address. + * + * @return $this + */ + public function setEmailAddress($email_address) + { + $this->container['email_address'] = $email_address; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language The subscriber language determines the language which is used to communicate with the subscriber in emails and documents (e.g. invoices). + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets meta_data + * + * @return map[string,string] + */ + public function getMetaData() + { + return $this->container['meta_data']; + } + + /** + * Sets meta_data + * + * @param map[string,string] $meta_data Meta data allow to store additional data along the object. + * + * @return $this + */ + public function setMetaData($meta_data) + { + $this->container['meta_data'] = $meta_data; + + return $this; + } + + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference The subscriber reference identifies the subscriber in administrative interfaces (e.g. customer id). + * + * @return $this + */ + public function setReference($reference) + { + $this->container['reference'] = $reference; + + return $this; + } + + + /** + * Gets shipping_address + * + * @return \Wallee\Sdk\Model\AddressCreate + */ + public function getShippingAddress() + { + return $this->container['shipping_address']; + } + + /** + * Sets shipping_address + * + * @param \Wallee\Sdk\Model\AddressCreate $shipping_address + * + * @return $this + */ + public function setShippingAddress($shipping_address) + { + $this->container['shipping_address'] = $shipping_address; + + 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/wallee-sdk/lib/Model/Subscription.php b/wallee-sdk/lib/Model/Subscription.php index fc084bc..22db6a2 100644 --- a/wallee-sdk/lib/Model/Subscription.php +++ b/wallee-sdk/lib/Model/Subscription.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\SubscriptionAffiliate', - 'createdOn' => '\DateTime', - 'description' => 'string', - 'id' => 'int', - 'initializedOn' => '\DateTime', - 'language' => 'string', - 'linkedSpaceId' => 'int', - 'plannedPurgeDate' => '\DateTime', - 'plannedTerminationDate' => '\DateTime', - 'reference' => 'string', - 'state' => '\Wallee\Sdk\Model\SubscriptionState', - 'subscriber' => '\Wallee\Sdk\Model\Subscriber', - 'terminatedOn' => '\DateTime', - 'terminatingOn' => '\DateTime', - 'token' => '\Wallee\Sdk\Model\Token', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionAffiliate - */ - private $affiliate; - - /** - * - * - * @var \DateTime - */ - private $createdOn; - - /** - * - * - * @var string - */ - private $description; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var \DateTime - */ - private $initializedOn; - - /** - * - * - * @var string - */ - private $language; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var \DateTime - */ - private $plannedTerminationDate; - - /** - * - * - * @var string - */ - private $reference; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionState - */ - private $state; - - /** - * - * - * @var \Wallee\Sdk\Model\Subscriber - */ - private $subscriber; - - /** - * - * - * @var \DateTime - */ - private $terminatedOn; - - /** - * - * - * @var \DateTime - */ - private $terminatingOn; - - /** - * - * - * @var \Wallee\Sdk\Model\Token - */ - private $token; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['affiliate'])) { - $this->setAffiliate($data['affiliate']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['subscriber'])) { - $this->setSubscriber($data['subscriber']); - } - if (isset($data['token'])) { - $this->setToken($data['token']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns affiliate. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionAffiliate - */ - public function getAffiliate() { - return $this->affiliate; - } - - /** - * Sets affiliate. - * - * @param \Wallee\Sdk\Model\SubscriptionAffiliate $affiliate - * @return Subscription - */ - public function setAffiliate($affiliate) { - $this->affiliate = $affiliate; - - return $this; - } - - /** - * Returns createdOn. - * - * - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return Subscription - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns description. - * - * - * - * @return string - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param string $description - * @return Subscription - */ - protected function setDescription($description) { - $this->description = $description; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return Subscription - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns initializedOn. - * - * - * - * @return \DateTime - */ - public function getInitializedOn() { - return $this->initializedOn; - } - - /** - * Sets initializedOn. - * - * @param \DateTime $initializedOn - * @return Subscription - */ - protected function setInitializedOn($initializedOn) { - $this->initializedOn = $initializedOn; - - return $this; - } - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return Subscription - */ - protected function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return Subscription - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return Subscription - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns plannedTerminationDate. - * - * - * - * @return \DateTime - */ - public function getPlannedTerminationDate() { - return $this->plannedTerminationDate; - } - - /** - * Sets plannedTerminationDate. - * - * @param \DateTime $plannedTerminationDate - * @return Subscription - */ - protected function setPlannedTerminationDate($plannedTerminationDate) { - $this->plannedTerminationDate = $plannedTerminationDate; - - return $this; - } - - /** - * Returns reference. - * - * - * - * @return string - */ - public function getReference() { - return $this->reference; - } - - /** - * Sets reference. - * - * @param string $reference - * @return Subscription - */ - protected function setReference($reference) { - $this->reference = $reference; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\SubscriptionState $state - * @return Subscription - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns subscriber. - * - * - * - * @return \Wallee\Sdk\Model\Subscriber - */ - public function getSubscriber() { - return $this->subscriber; - } - - /** - * Sets subscriber. - * - * @param \Wallee\Sdk\Model\Subscriber $subscriber - * @return Subscription - */ - public function setSubscriber($subscriber) { - $this->subscriber = $subscriber; - - return $this; - } - - /** - * Returns terminatedOn. - * - * - * - * @return \DateTime - */ - public function getTerminatedOn() { - return $this->terminatedOn; - } - - /** - * Sets terminatedOn. - * - * @param \DateTime $terminatedOn - * @return Subscription - */ - protected function setTerminatedOn($terminatedOn) { - $this->terminatedOn = $terminatedOn; - - return $this; - } - - /** - * Returns terminatingOn. - * - * - * - * @return \DateTime - */ - public function getTerminatingOn() { - return $this->terminatingOn; - } - - /** - * Sets terminatingOn. - * - * @param \DateTime $terminatingOn - * @return Subscription - */ - protected function setTerminatingOn($terminatingOn) { - $this->terminatingOn = $terminatingOn; - - return $this; - } - - /** - * Returns token. - * - * - * - * @return \Wallee\Sdk\Model\Token - */ - public function getToken() { - return $this->token; - } - - /** - * Sets token. - * - * @param \Wallee\Sdk\Model\Token $token - * @return Subscription - */ - public function setToken($token) { - $this->token = $token; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return Subscription - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class Subscription implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Subscription'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'activated_on' => '\DateTime', + 'affiliate' => '\Wallee\Sdk\Model\SubscriptionAffiliate', + 'created_on' => '\DateTime', + 'description' => 'string', + 'id' => 'int', + 'initialized_on' => '\DateTime', + 'language' => 'string', + 'linked_space_id' => 'int', + 'planned_purge_date' => '\DateTime', + 'planned_termination_date' => '\DateTime', + 'reference' => 'string', + 'state' => '\Wallee\Sdk\Model\SubscriptionState', + 'subscriber' => '\Wallee\Sdk\Model\Subscriber', + 'terminated_on' => '\DateTime', + 'terminating_on' => '\DateTime', + 'token' => '\Wallee\Sdk\Model\Token', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'activated_on' => 'date-time', + 'affiliate' => null, + 'created_on' => 'date-time', + 'description' => null, + 'id' => 'int64', + 'initialized_on' => 'date-time', + 'language' => null, + 'linked_space_id' => 'int64', + 'planned_purge_date' => 'date-time', + 'planned_termination_date' => 'date-time', + 'reference' => null, + 'state' => null, + 'subscriber' => null, + 'terminated_on' => 'date-time', + 'terminating_on' => 'date-time', + 'token' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'activated_on' => 'activatedOn', + 'affiliate' => 'affiliate', + 'created_on' => 'createdOn', + 'description' => 'description', + 'id' => 'id', + 'initialized_on' => 'initializedOn', + 'language' => 'language', + 'linked_space_id' => 'linkedSpaceId', + 'planned_purge_date' => 'plannedPurgeDate', + 'planned_termination_date' => 'plannedTerminationDate', + 'reference' => 'reference', + 'state' => 'state', + 'subscriber' => 'subscriber', + 'terminated_on' => 'terminatedOn', + 'terminating_on' => 'terminatingOn', + 'token' => 'token', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'activated_on' => 'setActivatedOn', + 'affiliate' => 'setAffiliate', + 'created_on' => 'setCreatedOn', + 'description' => 'setDescription', + 'id' => 'setId', + 'initialized_on' => 'setInitializedOn', + 'language' => 'setLanguage', + 'linked_space_id' => 'setLinkedSpaceId', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'planned_termination_date' => 'setPlannedTerminationDate', + 'reference' => 'setReference', + 'state' => 'setState', + 'subscriber' => 'setSubscriber', + 'terminated_on' => 'setTerminatedOn', + 'terminating_on' => 'setTerminatingOn', + 'token' => 'setToken', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'activated_on' => 'getActivatedOn', + 'affiliate' => 'getAffiliate', + 'created_on' => 'getCreatedOn', + 'description' => 'getDescription', + 'id' => 'getId', + 'initialized_on' => 'getInitializedOn', + 'language' => 'getLanguage', + 'linked_space_id' => 'getLinkedSpaceId', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'planned_termination_date' => 'getPlannedTerminationDate', + 'reference' => 'getReference', + 'state' => 'getState', + 'subscriber' => 'getSubscriber', + 'terminated_on' => 'getTerminatedOn', + 'terminating_on' => 'getTerminatingOn', + 'token' => 'getToken', + 'version' => 'getVersion' + ]; + + + + /** + * 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['activated_on'] = isset($data['activated_on']) ? $data['activated_on'] : null; + + $this->container['affiliate'] = isset($data['affiliate']) ? $data['affiliate'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['initialized_on'] = isset($data['initialized_on']) ? $data['initialized_on'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['planned_termination_date'] = isset($data['planned_termination_date']) ? $data['planned_termination_date'] : null; + + $this->container['reference'] = isset($data['reference']) ? $data['reference'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['subscriber'] = isset($data['subscriber']) ? $data['subscriber'] : null; + + $this->container['terminated_on'] = isset($data['terminated_on']) ? $data['terminated_on'] : null; + + $this->container['terminating_on'] = isset($data['terminating_on']) ? $data['terminating_on'] : null; + + $this->container['token'] = isset($data['token']) ? $data['token'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 activated_on + * + * @return \DateTime + */ + public function getActivatedOn() + { + return $this->container['activated_on']; + } + + /** + * Sets activated_on + * + * @param \DateTime $activated_on + * + * @return $this + */ + public function setActivatedOn($activated_on) + { + $this->container['activated_on'] = $activated_on; + + return $this; + } + + + /** + * Gets affiliate + * + * @return \Wallee\Sdk\Model\SubscriptionAffiliate + */ + public function getAffiliate() + { + return $this->container['affiliate']; + } + + /** + * Sets affiliate + * + * @param \Wallee\Sdk\Model\SubscriptionAffiliate $affiliate + * + * @return $this + */ + public function setAffiliate($affiliate) + { + $this->container['affiliate'] = $affiliate; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets initialized_on + * + * @return \DateTime + */ + public function getInitializedOn() + { + return $this->container['initialized_on']; + } + + /** + * Sets initialized_on + * + * @param \DateTime $initialized_on + * + * @return $this + */ + public function setInitializedOn($initialized_on) + { + $this->container['initialized_on'] = $initialized_on; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets planned_termination_date + * + * @return \DateTime + */ + public function getPlannedTerminationDate() + { + return $this->container['planned_termination_date']; + } + + /** + * Sets planned_termination_date + * + * @param \DateTime $planned_termination_date + * + * @return $this + */ + public function setPlannedTerminationDate($planned_termination_date) + { + $this->container['planned_termination_date'] = $planned_termination_date; + + return $this; + } + + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference + * + * @return $this + */ + public function setReference($reference) + { + $this->container['reference'] = $reference; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\SubscriptionState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\SubscriptionState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets subscriber + * + * @return \Wallee\Sdk\Model\Subscriber + */ + public function getSubscriber() + { + return $this->container['subscriber']; + } + + /** + * Sets subscriber + * + * @param \Wallee\Sdk\Model\Subscriber $subscriber + * + * @return $this + */ + public function setSubscriber($subscriber) + { + $this->container['subscriber'] = $subscriber; + + return $this; + } + + + /** + * Gets terminated_on + * + * @return \DateTime + */ + public function getTerminatedOn() + { + return $this->container['terminated_on']; + } + + /** + * Sets terminated_on + * + * @param \DateTime $terminated_on + * + * @return $this + */ + public function setTerminatedOn($terminated_on) + { + $this->container['terminated_on'] = $terminated_on; + + return $this; + } + + + /** + * Gets terminating_on + * + * @return \DateTime + */ + public function getTerminatingOn() + { + return $this->container['terminating_on']; + } + + /** + * Sets terminating_on + * + * @param \DateTime $terminating_on + * + * @return $this + */ + public function setTerminatingOn($terminating_on) + { + $this->container['terminating_on'] = $terminating_on; + + return $this; + } + + + /** + * Gets token + * + * @return \Wallee\Sdk\Model\Token + */ + public function getToken() + { + return $this->container['token']; + } + + /** + * Sets token + * + * @param \Wallee\Sdk\Model\Token $token + * + * @return $this + */ + public function setToken($token) + { + $this->container['token'] = $token; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/SubscriptionAffiliate.php b/wallee-sdk/lib/Model/SubscriptionAffiliate.php index 43d6745..c46390a 100644 --- a/wallee-sdk/lib/Model/SubscriptionAffiliate.php +++ b/wallee-sdk/lib/Model/SubscriptionAffiliate.php @@ -1,10 +1,8 @@ 'string', - 'id' => 'int', - 'language' => 'string', - 'linkedSpaceId' => 'int', - 'metaData' => 'map[string,string]', - 'name' => 'string', - 'plannedPurgeDate' => '\DateTime', - 'reference' => 'string', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @var string - */ - private $externalId; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var string - */ - private $language; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * Meta data allow to store additional data along the object. - * - * @var map[string,string] - */ - private $metaData; - - /** - * - * - * @var string - */ - private $name; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var string - */ - private $reference; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['metaData'])) { - $this->setMetaData($data['metaData']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns externalId. - * - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @return string - */ - public function getExternalId() { - return $this->externalId; - } - - /** - * Sets externalId. - * - * @param string $externalId - * @return SubscriptionAffiliate - */ - protected function setExternalId($externalId) { - $this->externalId = $externalId; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionAffiliate - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return SubscriptionAffiliate - */ - protected function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return SubscriptionAffiliate - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns metaData. - * - * Meta data allow to store additional data along the object. - * - * @return map[string,string] - */ - public function getMetaData() { - return $this->metaData; - } - - /** - * Sets metaData. - * - * @param map[string,string] $metaData - * @return SubscriptionAffiliate - */ - public function setMetaData($metaData) { - if (is_array($metaData) && empty($metaData)) { - $this->metaData = new \stdClass; - } else { - $this->metaData = $metaData; - } - - return $this; - } - - /** - * Returns name. - * - * - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return SubscriptionAffiliate - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return SubscriptionAffiliate - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns reference. - * - * - * - * @return string - */ - public function getReference() { - return $this->reference; - } - - /** - * Sets reference. - * - * @param string $reference - * @return SubscriptionAffiliate - */ - protected function setReference($reference) { - $this->reference = $reference; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return SubscriptionAffiliate - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriptionAffiliate - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionAffiliate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionAffiliate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'external_id' => 'string', + 'id' => 'int', + 'language' => 'string', + 'linked_space_id' => 'int', + 'meta_data' => 'map[string,string]', + 'name' => 'string', + 'planned_purge_date' => '\DateTime', + 'reference' => 'string', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'external_id' => null, + 'id' => 'int64', + 'language' => null, + 'linked_space_id' => 'int64', + 'meta_data' => null, + 'name' => null, + 'planned_purge_date' => 'date-time', + 'reference' => null, + 'state' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'external_id' => 'externalId', + 'id' => 'id', + 'language' => 'language', + 'linked_space_id' => 'linkedSpaceId', + 'meta_data' => 'metaData', + 'name' => 'name', + 'planned_purge_date' => 'plannedPurgeDate', + 'reference' => 'reference', + 'state' => 'state', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'external_id' => 'setExternalId', + 'id' => 'setId', + 'language' => 'setLanguage', + 'linked_space_id' => 'setLinkedSpaceId', + 'meta_data' => 'setMetaData', + 'name' => 'setName', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'reference' => 'setReference', + 'state' => 'setState', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'external_id' => 'getExternalId', + 'id' => 'getId', + 'language' => 'getLanguage', + 'linked_space_id' => 'getLinkedSpaceId', + 'meta_data' => 'getMetaData', + 'name' => 'getName', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'reference' => 'getReference', + 'state' => 'getState', + 'version' => 'getVersion' + ]; + + + + /** + * 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['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['meta_data'] = isset($data['meta_data']) ? $data['meta_data'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['reference'] = isset($data['reference']) ? $data['reference'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets meta_data + * + * @return map[string,string] + */ + public function getMetaData() + { + return $this->container['meta_data']; + } + + /** + * Sets meta_data + * + * @param map[string,string] $meta_data Meta data allow to store additional data along the object. + * + * @return $this + */ + public function setMetaData($meta_data) + { + $this->container['meta_data'] = $meta_data; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference + * + * @return $this + */ + public function setReference($reference) + { + $this->container['reference'] = $reference; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/SubscriptionAffiliateCreate.php b/wallee-sdk/lib/Model/SubscriptionAffiliateCreate.php index a3e0089..61b87bc 100644 --- a/wallee-sdk/lib/Model/SubscriptionAffiliateCreate.php +++ b/wallee-sdk/lib/Model/SubscriptionAffiliateCreate.php @@ -1,10 +1,8 @@ 'string', - 'reference' => 'string', - ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @var string - */ - private $externalId; - - /** - * - * - * @var string - */ - private $reference; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['externalId'])) { - $this->setExternalId($data['externalId']); - } - if (isset($data['reference'])) { - $this->setReference($data['reference']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - } - - - /** - * Returns externalId. - * - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @return string - */ - public function getExternalId() { - return $this->externalId; - } - - /** - * Sets externalId. - * - * @param string $externalId - * @return SubscriptionAffiliateCreate - */ - public function setExternalId($externalId) { - $this->externalId = $externalId; - - return $this; - } - - /** - * Returns reference. - * - * - * - * @return string - */ - public function getReference() { - return $this->reference; - } - - /** - * Sets reference. - * - * @param string $reference - * @return SubscriptionAffiliateCreate - */ - public function setReference($reference) { - $this->reference = $reference; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return parent::getState(); - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return SubscriptionAffiliateCreate - */ - public function setState($state) { - return parent::setState($state); - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - if ($this->getExternalId() === null) { - throw new ValidationException("'externalId' can't be null", 'externalId', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class SubscriptionAffiliateCreate extends AbstractSubscriptionAffiliateUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionAffiliate.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'external_id' => 'string', + 'reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'external_id' => null, + 'reference' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'external_id' => 'externalId', + 'reference' => 'reference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'external_id' => 'setExternalId', + 'reference' => 'setReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'external_id' => 'getExternalId', + 'reference' => 'getReference' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['reference'] = isset($data['reference']) ? $data['reference'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['external_id'] === null) { + $invalidProperties[] = "'external_id' can't be null"; + } + if ($this->container['reference'] === null) { + $invalidProperties[] = "'reference' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference + * + * @return $this + */ + public function setReference($reference) + { + $this->container['reference'] = $reference; + + 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/wallee-sdk/lib/Model/SubscriptionAffiliateDeleted.php b/wallee-sdk/lib/Model/SubscriptionAffiliateDeleted.php index 41fc87c..9607bf3 100644 --- a/wallee-sdk/lib/Model/SubscriptionAffiliateDeleted.php +++ b/wallee-sdk/lib/Model/SubscriptionAffiliateDeleted.php @@ -1,10 +1,8 @@ validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class SubscriptionAffiliateDeleted extends SubscriptionAffiliate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionAffiliate.Deleted'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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; + } + + + /** + * 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/wallee-sdk/lib/Model/SubscriptionAffiliateDeleting.php b/wallee-sdk/lib/Model/SubscriptionAffiliateDeleting.php index 185e933..33eee52 100644 --- a/wallee-sdk/lib/Model/SubscriptionAffiliateDeleting.php +++ b/wallee-sdk/lib/Model/SubscriptionAffiliateDeleting.php @@ -1,10 +1,8 @@ validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class SubscriptionAffiliateDeleting extends SubscriptionAffiliateDeleted +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionAffiliate.Deleting'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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; + } + + + /** + * 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/wallee-sdk/lib/Model/SubscriptionAffiliateInactive.php b/wallee-sdk/lib/Model/SubscriptionAffiliateInactive.php index 08eafb8..374e099 100644 --- a/wallee-sdk/lib/Model/SubscriptionAffiliateInactive.php +++ b/wallee-sdk/lib/Model/SubscriptionAffiliateInactive.php @@ -1,10 +1,8 @@ validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class SubscriptionAffiliateInactive extends SubscriptionAffiliateUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionAffiliate.Inactive'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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; + } + + + /** + * 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/wallee-sdk/lib/Model/SubscriptionAffiliateUpdate.php b/wallee-sdk/lib/Model/SubscriptionAffiliateUpdate.php index 5dd6ebc..b5c8d9b 100644 --- a/wallee-sdk/lib/Model/SubscriptionAffiliateUpdate.php +++ b/wallee-sdk/lib/Model/SubscriptionAffiliateUpdate.php @@ -1,10 +1,8 @@ 'int', - 'version' => 'int', - 'language' => 'string', - 'metaData' => 'map[string,string]', - 'name' => 'string', - 'state' => '\Wallee\Sdk\Model\CreationEntityState' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - /** - * - * - * @var string - */ - private $language; - - /** - * Meta data allow to store additional data along the object. - * - * @var map[string,string] - */ - private $metaData; - - /** - * - * - * @var string - */ - private $name; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - if (isset($data['language'])) { - $this->setLanguage($data['language']); - } - if (isset($data['metaData'])) { - $this->setMetaData($data['metaData']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionAffiliateUpdate - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriptionAffiliateUpdate - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return SubscriptionAffiliateUpdate - */ - public function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns metaData. - * - * Meta data allow to store additional data along the object. - * - * @return map[string,string] - */ - public function getMetaData() { - return $this->metaData; - } - - /** - * Sets metaData. - * - * @param map[string,string] $metaData - * @return SubscriptionAffiliateUpdate - */ - public function setMetaData($metaData) { - if (is_array($metaData) && empty($metaData)) { - $this->metaData = new \stdClass; - } else { - $this->metaData = $metaData; - } - - return $this; - } - - /** - * Returns name. - * - * - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return SubscriptionAffiliateUpdate - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return SubscriptionAffiliateUpdate - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getId() === null) { - throw new ValidationException("'id' can't be null", 'id', $this); - } - if ($this->getVersion() === null) { - throw new ValidationException("'version' can't be null", 'version', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionAffiliateUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionAffiliate.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'version' => 'int', + 'language' => 'string', + 'meta_data' => 'map[string,string]', + 'name' => 'string', + 'state' => '\Wallee\Sdk\Model\CreationEntityState' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64', + 'language' => null, + 'meta_data' => null, + 'name' => null, + 'state' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version', + 'language' => 'language', + 'meta_data' => 'metaData', + 'name' => 'name', + 'state' => 'state' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion', + 'language' => 'setLanguage', + 'meta_data' => 'setMetaData', + 'name' => 'setName', + 'state' => 'setState' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion', + 'language' => 'getLanguage', + 'meta_data' => 'getMetaData', + 'name' => 'getName', + 'state' => 'getState' + ]; + + + + /** + * 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['version'] = isset($data['version']) ? $data['version'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['meta_data'] = isset($data['meta_data']) ? $data['meta_data'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets meta_data + * + * @return map[string,string] + */ + public function getMetaData() + { + return $this->container['meta_data']; + } + + /** + * Sets meta_data + * + * @param map[string,string] $meta_data Meta data allow to store additional data along the object. + * + * @return $this + */ + public function setMetaData($meta_data) + { + $this->container['meta_data'] = $meta_data; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + 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/wallee-sdk/lib/Model/SubscriptionChangeRequest.php b/wallee-sdk/lib/Model/SubscriptionChangeRequest.php index b91c455..04199b6 100644 --- a/wallee-sdk/lib/Model/SubscriptionChangeRequest.php +++ b/wallee-sdk/lib/Model/SubscriptionChangeRequest.php @@ -1,10 +1,8 @@ 'string', - 'product' => 'int', - 'respectTerminationPeriod' => 'bool', - 'selectedComponents' => '\Wallee\Sdk\Model\SubscriptionProductComponentReference[]', - 'subscription' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var string - */ - private $currency; - - /** - * The subscription has to be linked with a product. - * - * @var int - */ - private $product; - - /** - * The subscription version may be retired. The respect termination period controls whether the termination period configured on the product version should be respected or if the operation should take effect immediately. - * - * @var bool - */ - private $respectTerminationPeriod; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionProductComponentReference[] - */ - private $selectedComponents; - - /** - * - * - * @var int - */ - private $subscription; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['currency'])) { - $this->setCurrency($data['currency']); - } - if (isset($data['product'])) { - $this->setProduct($data['product']); - } - if (isset($data['respectTerminationPeriod'])) { - $this->setRespectTerminationPeriod($data['respectTerminationPeriod']); - } - if (isset($data['selectedComponents'])) { - $this->setSelectedComponents($data['selectedComponents']); - } - if (isset($data['subscription'])) { - $this->setSubscription($data['subscription']); - } - } - - - /** - * Returns currency. - * - * - * - * @return string - */ - public function getCurrency() { - return $this->currency; - } - - /** - * Sets currency. - * - * @param string $currency - * @return SubscriptionChangeRequest - */ - public function setCurrency($currency) { - $this->currency = $currency; - - return $this; - } - - /** - * Returns product. - * - * The subscription has to be linked with a product. - * - * @return int - */ - public function getProduct() { - return $this->product; - } - - /** - * Sets product. - * - * @param int $product - * @return SubscriptionChangeRequest - */ - public function setProduct($product) { - $this->product = $product; - - return $this; - } - - /** - * Returns respectTerminationPeriod. - * - * The subscription version may be retired. The respect termination period controls whether the termination period configured on the product version should be respected or if the operation should take effect immediately. - * - * @return bool - */ - public function getRespectTerminationPeriod() { - return $this->respectTerminationPeriod; - } - - /** - * Sets respectTerminationPeriod. - * - * @param bool $respectTerminationPeriod - * @return SubscriptionChangeRequest - */ - public function setRespectTerminationPeriod($respectTerminationPeriod) { - $this->respectTerminationPeriod = $respectTerminationPeriod; - - return $this; - } - - /** - * Returns selectedComponents. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionProductComponentReference[] - */ - public function getSelectedComponents() { - return $this->selectedComponents; - } - - /** - * Sets selectedComponents. - * - * @param \Wallee\Sdk\Model\SubscriptionProductComponentReference[] $selectedComponents - * @return SubscriptionChangeRequest - */ - public function setSelectedComponents($selectedComponents) { - $this->selectedComponents = $selectedComponents; - - return $this; - } - - /** - * Returns subscription. - * - * - * - * @return int - */ - public function getSubscription() { - return $this->subscription; - } - - /** - * Sets subscription. - * - * @param int $subscription - * @return SubscriptionChangeRequest - */ - public function setSubscription($subscription) { - $this->subscription = $subscription; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getCurrency() === null) { - throw new ValidationException("'currency' can't be null", 'currency', $this); - } - if ($this->getProduct() === null) { - throw new ValidationException("'product' can't be null", 'product', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionChangeRequest implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionChangeRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'component_configurations' => '\Wallee\Sdk\Model\SubscriptionComponentReferenceConfiguration[]', + 'currency' => 'string', + 'product' => 'int', + 'respect_termination_period' => 'bool', + 'selected_components' => '\Wallee\Sdk\Model\SubscriptionProductComponentReference[]', + 'subscription' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'component_configurations' => null, + 'currency' => null, + 'product' => 'int64', + 'respect_termination_period' => null, + 'selected_components' => null, + 'subscription' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'component_configurations' => 'componentConfigurations', + 'currency' => 'currency', + 'product' => 'product', + 'respect_termination_period' => 'respectTerminationPeriod', + 'selected_components' => 'selectedComponents', + 'subscription' => 'subscription' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'component_configurations' => 'setComponentConfigurations', + 'currency' => 'setCurrency', + 'product' => 'setProduct', + 'respect_termination_period' => 'setRespectTerminationPeriod', + 'selected_components' => 'setSelectedComponents', + 'subscription' => 'setSubscription' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'component_configurations' => 'getComponentConfigurations', + 'currency' => 'getCurrency', + 'product' => 'getProduct', + 'respect_termination_period' => 'getRespectTerminationPeriod', + 'selected_components' => 'getSelectedComponents', + 'subscription' => 'getSubscription' + ]; + + + + /** + * 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['component_configurations'] = isset($data['component_configurations']) ? $data['component_configurations'] : null; + + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + + $this->container['product'] = isset($data['product']) ? $data['product'] : null; + + $this->container['respect_termination_period'] = isset($data['respect_termination_period']) ? $data['respect_termination_period'] : null; + + $this->container['selected_components'] = isset($data['selected_components']) ? $data['selected_components'] : null; + + $this->container['subscription'] = isset($data['subscription']) ? $data['subscription'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['product'] === null) { + $invalidProperties[] = "'product' can't be null"; + } + if ($this->container['subscription'] === null) { + $invalidProperties[] = "'subscription' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 component_configurations + * + * @return \Wallee\Sdk\Model\SubscriptionComponentReferenceConfiguration[] + */ + public function getComponentConfigurations() + { + return $this->container['component_configurations']; + } + + /** + * Sets component_configurations + * + * @param \Wallee\Sdk\Model\SubscriptionComponentReferenceConfiguration[] $component_configurations + * + * @return $this + */ + public function setComponentConfigurations($component_configurations) + { + $this->container['component_configurations'] = $component_configurations; + + return $this; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + + /** + * Gets product + * + * @return int + */ + public function getProduct() + { + return $this->container['product']; + } + + /** + * Sets product + * + * @param int $product The subscription has to be linked with a product. + * + * @return $this + */ + public function setProduct($product) + { + $this->container['product'] = $product; + + return $this; + } + + + /** + * Gets respect_termination_period + * + * @return bool + */ + public function getRespectTerminationPeriod() + { + return $this->container['respect_termination_period']; + } + + /** + * Sets respect_termination_period + * + * @param bool $respect_termination_period The subscription version may be retired. The respect termination period controls whether the termination period configured on the product version should be respected or if the operation should take effect immediately. + * + * @return $this + */ + public function setRespectTerminationPeriod($respect_termination_period) + { + $this->container['respect_termination_period'] = $respect_termination_period; + + return $this; + } + + + /** + * Gets selected_components + * + * @return \Wallee\Sdk\Model\SubscriptionProductComponentReference[] + */ + public function getSelectedComponents() + { + return $this->container['selected_components']; + } + + /** + * Sets selected_components + * + * @param \Wallee\Sdk\Model\SubscriptionProductComponentReference[] $selected_components + * + * @return $this + */ + public function setSelectedComponents($selected_components) + { + $this->container['selected_components'] = $selected_components; + + return $this; + } + + + /** + * Gets subscription + * + * @return int + */ + public function getSubscription() + { + return $this->container['subscription']; + } + + /** + * Sets subscription + * + * @param int $subscription + * + * @return $this + */ + public function setSubscription($subscription) + { + $this->container['subscription'] = $subscription; + + 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/wallee-sdk/lib/Model/SubscriptionCharge.php b/wallee-sdk/lib/Model/SubscriptionCharge.php index df15728..f668829 100644 --- a/wallee-sdk/lib/Model/SubscriptionCharge.php +++ b/wallee-sdk/lib/Model/SubscriptionCharge.php @@ -1,10 +1,8 @@ '\DateTime', - 'discardedBy' => 'int', - 'discardedOn' => '\DateTime', - 'externalId' => 'string', - 'failedOn' => '\DateTime', - 'failedUrl' => 'string', - 'id' => 'int', - 'language' => 'string', - 'ledgerEntries' => '\Wallee\Sdk\Model\SubscriptionLedgerEntry[]', - 'linkedSpaceId' => 'int', - 'plannedExecutionDate' => '\DateTime', - 'plannedPurgeDate' => '\DateTime', - 'processingType' => '\Wallee\Sdk\Model\SubscriptionChargeProcessingType', - 'reference' => 'string', - 'state' => '\Wallee\Sdk\Model\SubscriptionChargeState', - 'subscription' => '\Wallee\Sdk\Model\Subscription', - 'succeedOn' => '\DateTime', - 'successUrl' => 'string', - 'transaction' => '\Wallee\Sdk\Model\Transaction', - 'type' => '\Wallee\Sdk\Model\SubscriptionChargeType', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \DateTime - */ - private $createdOn; - - /** - * - * - * @var int - */ - private $discardedBy; - - /** - * - * - * @var \DateTime - */ - private $discardedOn; - - /** - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @var string - */ - private $externalId; - - /** - * - * - * @var \DateTime - */ - private $failedOn; - - /** - * The user will be redirected to failed URL when the transaction could not be authorized or completed. In case no failed URL is specified a default failed page will be displayed. - * - * @var string - */ - private $failedUrl; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var string - */ - private $language; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionLedgerEntry[] - */ - private $ledgerEntries; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * - * - * @var \DateTime - */ - private $plannedExecutionDate; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionChargeProcessingType - */ - private $processingType; - - /** - * - * - * @var string - */ - private $reference; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionChargeState - */ - private $state; - - /** - * The field subscription indicates the subscription to which the charge belongs to. - * - * @var \Wallee\Sdk\Model\Subscription - */ - private $subscription; - - /** - * - * - * @var \DateTime - */ - private $succeedOn; - - /** - * The user will be redirected to success URL when the transaction could be authorized or completed. In case no success URL is specified a default success page will be displayed. - * - * @var string - */ - private $successUrl; - - /** - * - * - * @var \Wallee\Sdk\Model\Transaction - */ - private $transaction; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionChargeType - */ - private $type; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['ledgerEntries'])) { - $this->setLedgerEntries($data['ledgerEntries']); - } - if (isset($data['processingType'])) { - $this->setProcessingType($data['processingType']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['subscription'])) { - $this->setSubscription($data['subscription']); - } - if (isset($data['transaction'])) { - $this->setTransaction($data['transaction']); - } - if (isset($data['type'])) { - $this->setType($data['type']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns createdOn. - * - * - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return SubscriptionCharge - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns discardedBy. - * - * - * - * @return int - */ - public function getDiscardedBy() { - return $this->discardedBy; - } - - /** - * Sets discardedBy. - * - * @param int $discardedBy - * @return SubscriptionCharge - */ - protected function setDiscardedBy($discardedBy) { - $this->discardedBy = $discardedBy; - - return $this; - } - - /** - * Returns discardedOn. - * - * - * - * @return \DateTime - */ - public function getDiscardedOn() { - return $this->discardedOn; - } - - /** - * Sets discardedOn. - * - * @param \DateTime $discardedOn - * @return SubscriptionCharge - */ - protected function setDiscardedOn($discardedOn) { - $this->discardedOn = $discardedOn; - - return $this; - } - - /** - * Returns externalId. - * - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @return string - */ - public function getExternalId() { - return $this->externalId; - } - - /** - * Sets externalId. - * - * @param string $externalId - * @return SubscriptionCharge - */ - protected function setExternalId($externalId) { - $this->externalId = $externalId; - - return $this; - } - - /** - * Returns failedOn. - * - * - * - * @return \DateTime - */ - public function getFailedOn() { - return $this->failedOn; - } - - /** - * Sets failedOn. - * - * @param \DateTime $failedOn - * @return SubscriptionCharge - */ - protected function setFailedOn($failedOn) { - $this->failedOn = $failedOn; - - return $this; - } - - /** - * Returns failedUrl. - * - * The user will be redirected to failed URL when the transaction could not be authorized or completed. In case no failed URL is specified a default failed page will be displayed. - * - * @return string - */ - public function getFailedUrl() { - return $this->failedUrl; - } - - /** - * Sets failedUrl. - * - * @param string $failedUrl - * @return SubscriptionCharge - */ - protected function setFailedUrl($failedUrl) { - $this->failedUrl = $failedUrl; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionCharge - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return SubscriptionCharge - */ - protected function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns ledgerEntries. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionLedgerEntry[] - */ - public function getLedgerEntries() { - return $this->ledgerEntries; - } - - /** - * Sets ledgerEntries. - * - * @param \Wallee\Sdk\Model\SubscriptionLedgerEntry[] $ledgerEntries - * @return SubscriptionCharge - */ - public function setLedgerEntries($ledgerEntries) { - $this->ledgerEntries = $ledgerEntries; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return SubscriptionCharge - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns plannedExecutionDate. - * - * - * - * @return \DateTime - */ - public function getPlannedExecutionDate() { - return $this->plannedExecutionDate; - } - - /** - * Sets plannedExecutionDate. - * - * @param \DateTime $plannedExecutionDate - * @return SubscriptionCharge - */ - protected function setPlannedExecutionDate($plannedExecutionDate) { - $this->plannedExecutionDate = $plannedExecutionDate; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return SubscriptionCharge - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns processingType. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionChargeProcessingType - */ - public function getProcessingType() { - return $this->processingType; - } - - /** - * Sets processingType. - * - * @param \Wallee\Sdk\Model\SubscriptionChargeProcessingType $processingType - * @return SubscriptionCharge - */ - public function setProcessingType($processingType) { - $this->processingType = $processingType; - - return $this; - } - - /** - * Returns reference. - * - * - * - * @return string - */ - public function getReference() { - return $this->reference; - } - - /** - * Sets reference. - * - * @param string $reference - * @return SubscriptionCharge - */ - protected function setReference($reference) { - $this->reference = $reference; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionChargeState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\SubscriptionChargeState $state - * @return SubscriptionCharge - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns subscription. - * - * The field subscription indicates the subscription to which the charge belongs to. - * - * @return \Wallee\Sdk\Model\Subscription - */ - public function getSubscription() { - return $this->subscription; - } - - /** - * Sets subscription. - * - * @param \Wallee\Sdk\Model\Subscription $subscription - * @return SubscriptionCharge - */ - public function setSubscription($subscription) { - $this->subscription = $subscription; - - return $this; - } - - /** - * Returns succeedOn. - * - * - * - * @return \DateTime - */ - public function getSucceedOn() { - return $this->succeedOn; - } - - /** - * Sets succeedOn. - * - * @param \DateTime $succeedOn - * @return SubscriptionCharge - */ - protected function setSucceedOn($succeedOn) { - $this->succeedOn = $succeedOn; - - return $this; - } - - /** - * Returns successUrl. - * - * The user will be redirected to success URL when the transaction could be authorized or completed. In case no success URL is specified a default success page will be displayed. - * - * @return string - */ - public function getSuccessUrl() { - return $this->successUrl; - } - - /** - * Sets successUrl. - * - * @param string $successUrl - * @return SubscriptionCharge - */ - protected function setSuccessUrl($successUrl) { - $this->successUrl = $successUrl; - - return $this; - } - - /** - * Returns transaction. - * - * - * - * @return \Wallee\Sdk\Model\Transaction - */ - public function getTransaction() { - return $this->transaction; - } - - /** - * Sets transaction. - * - * @param \Wallee\Sdk\Model\Transaction $transaction - * @return SubscriptionCharge - */ - public function setTransaction($transaction) { - $this->transaction = $transaction; - - return $this; - } - - /** - * Returns type. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionChargeType - */ - public function getType() { - return $this->type; - } - - /** - * Sets type. - * - * @param \Wallee\Sdk\Model\SubscriptionChargeType $type - * @return SubscriptionCharge - */ - public function setType($type) { - $this->type = $type; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriptionCharge - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionCharge implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionCharge'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'created_on' => '\DateTime', + 'discarded_by' => 'int', + 'discarded_on' => '\DateTime', + 'external_id' => 'string', + 'failed_on' => '\DateTime', + 'failed_url' => 'string', + 'id' => 'int', + 'language' => 'string', + 'ledger_entries' => '\Wallee\Sdk\Model\SubscriptionLedgerEntry[]', + 'linked_space_id' => 'int', + 'planned_execution_date' => '\DateTime', + 'planned_purge_date' => '\DateTime', + 'processing_type' => '\Wallee\Sdk\Model\SubscriptionChargeProcessingType', + 'reference' => 'string', + 'state' => '\Wallee\Sdk\Model\SubscriptionChargeState', + 'subscription' => '\Wallee\Sdk\Model\Subscription', + 'succeed_on' => '\DateTime', + 'success_url' => 'string', + 'transaction' => '\Wallee\Sdk\Model\Transaction', + 'type' => '\Wallee\Sdk\Model\SubscriptionChargeType', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'created_on' => 'date-time', + 'discarded_by' => 'int64', + 'discarded_on' => 'date-time', + 'external_id' => null, + 'failed_on' => 'date-time', + 'failed_url' => null, + 'id' => 'int64', + 'language' => null, + 'ledger_entries' => null, + 'linked_space_id' => 'int64', + 'planned_execution_date' => 'date-time', + 'planned_purge_date' => 'date-time', + 'processing_type' => null, + 'reference' => null, + 'state' => null, + 'subscription' => null, + 'succeed_on' => 'date-time', + 'success_url' => null, + 'transaction' => null, + 'type' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'created_on' => 'createdOn', + 'discarded_by' => 'discardedBy', + 'discarded_on' => 'discardedOn', + 'external_id' => 'externalId', + 'failed_on' => 'failedOn', + 'failed_url' => 'failedUrl', + 'id' => 'id', + 'language' => 'language', + 'ledger_entries' => 'ledgerEntries', + 'linked_space_id' => 'linkedSpaceId', + 'planned_execution_date' => 'plannedExecutionDate', + 'planned_purge_date' => 'plannedPurgeDate', + 'processing_type' => 'processingType', + 'reference' => 'reference', + 'state' => 'state', + 'subscription' => 'subscription', + 'succeed_on' => 'succeedOn', + 'success_url' => 'successUrl', + 'transaction' => 'transaction', + 'type' => 'type', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'created_on' => 'setCreatedOn', + 'discarded_by' => 'setDiscardedBy', + 'discarded_on' => 'setDiscardedOn', + 'external_id' => 'setExternalId', + 'failed_on' => 'setFailedOn', + 'failed_url' => 'setFailedUrl', + 'id' => 'setId', + 'language' => 'setLanguage', + 'ledger_entries' => 'setLedgerEntries', + 'linked_space_id' => 'setLinkedSpaceId', + 'planned_execution_date' => 'setPlannedExecutionDate', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'processing_type' => 'setProcessingType', + 'reference' => 'setReference', + 'state' => 'setState', + 'subscription' => 'setSubscription', + 'succeed_on' => 'setSucceedOn', + 'success_url' => 'setSuccessUrl', + 'transaction' => 'setTransaction', + 'type' => 'setType', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'created_on' => 'getCreatedOn', + 'discarded_by' => 'getDiscardedBy', + 'discarded_on' => 'getDiscardedOn', + 'external_id' => 'getExternalId', + 'failed_on' => 'getFailedOn', + 'failed_url' => 'getFailedUrl', + 'id' => 'getId', + 'language' => 'getLanguage', + 'ledger_entries' => 'getLedgerEntries', + 'linked_space_id' => 'getLinkedSpaceId', + 'planned_execution_date' => 'getPlannedExecutionDate', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'processing_type' => 'getProcessingType', + 'reference' => 'getReference', + 'state' => 'getState', + 'subscription' => 'getSubscription', + 'succeed_on' => 'getSucceedOn', + 'success_url' => 'getSuccessUrl', + 'transaction' => 'getTransaction', + 'type' => 'getType', + 'version' => 'getVersion' + ]; + + + + /** + * 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['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['discarded_by'] = isset($data['discarded_by']) ? $data['discarded_by'] : null; + + $this->container['discarded_on'] = isset($data['discarded_on']) ? $data['discarded_on'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['failed_on'] = isset($data['failed_on']) ? $data['failed_on'] : null; + + $this->container['failed_url'] = isset($data['failed_url']) ? $data['failed_url'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['ledger_entries'] = isset($data['ledger_entries']) ? $data['ledger_entries'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['planned_execution_date'] = isset($data['planned_execution_date']) ? $data['planned_execution_date'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['processing_type'] = isset($data['processing_type']) ? $data['processing_type'] : null; + + $this->container['reference'] = isset($data['reference']) ? $data['reference'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['subscription'] = isset($data['subscription']) ? $data['subscription'] : null; + + $this->container['succeed_on'] = isset($data['succeed_on']) ? $data['succeed_on'] : null; + + $this->container['success_url'] = isset($data['success_url']) ? $data['success_url'] : null; + + $this->container['transaction'] = isset($data['transaction']) ? $data['transaction'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets discarded_by + * + * @return int + */ + public function getDiscardedBy() + { + return $this->container['discarded_by']; + } + + /** + * Sets discarded_by + * + * @param int $discarded_by + * + * @return $this + */ + public function setDiscardedBy($discarded_by) + { + $this->container['discarded_by'] = $discarded_by; + + return $this; + } + + + /** + * Gets discarded_on + * + * @return \DateTime + */ + public function getDiscardedOn() + { + return $this->container['discarded_on']; + } + + /** + * Sets discarded_on + * + * @param \DateTime $discarded_on + * + * @return $this + */ + public function setDiscardedOn($discarded_on) + { + $this->container['discarded_on'] = $discarded_on; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets failed_on + * + * @return \DateTime + */ + public function getFailedOn() + { + return $this->container['failed_on']; + } + + /** + * Sets failed_on + * + * @param \DateTime $failed_on + * + * @return $this + */ + public function setFailedOn($failed_on) + { + $this->container['failed_on'] = $failed_on; + + return $this; + } + + + /** + * Gets failed_url + * + * @return string + */ + public function getFailedUrl() + { + return $this->container['failed_url']; + } + + /** + * Sets failed_url + * + * @param string $failed_url The user will be redirected to failed URL when the transaction could not be authorized or completed. In case no failed URL is specified a default failed page will be displayed. + * + * @return $this + */ + public function setFailedUrl($failed_url) + { + $this->container['failed_url'] = $failed_url; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets ledger_entries + * + * @return \Wallee\Sdk\Model\SubscriptionLedgerEntry[] + */ + public function getLedgerEntries() + { + return $this->container['ledger_entries']; + } + + /** + * Sets ledger_entries + * + * @param \Wallee\Sdk\Model\SubscriptionLedgerEntry[] $ledger_entries + * + * @return $this + */ + public function setLedgerEntries($ledger_entries) + { + $this->container['ledger_entries'] = $ledger_entries; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets planned_execution_date + * + * @return \DateTime + */ + public function getPlannedExecutionDate() + { + return $this->container['planned_execution_date']; + } + + /** + * Sets planned_execution_date + * + * @param \DateTime $planned_execution_date + * + * @return $this + */ + public function setPlannedExecutionDate($planned_execution_date) + { + $this->container['planned_execution_date'] = $planned_execution_date; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets processing_type + * + * @return \Wallee\Sdk\Model\SubscriptionChargeProcessingType + */ + public function getProcessingType() + { + return $this->container['processing_type']; + } + + /** + * Sets processing_type + * + * @param \Wallee\Sdk\Model\SubscriptionChargeProcessingType $processing_type + * + * @return $this + */ + public function setProcessingType($processing_type) + { + $this->container['processing_type'] = $processing_type; + + return $this; + } + + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference + * + * @return $this + */ + public function setReference($reference) + { + $this->container['reference'] = $reference; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\SubscriptionChargeState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\SubscriptionChargeState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets subscription + * + * @return \Wallee\Sdk\Model\Subscription + */ + public function getSubscription() + { + return $this->container['subscription']; + } + + /** + * Sets subscription + * + * @param \Wallee\Sdk\Model\Subscription $subscription The field subscription indicates the subscription to which the charge belongs to. + * + * @return $this + */ + public function setSubscription($subscription) + { + $this->container['subscription'] = $subscription; + + return $this; + } + + + /** + * Gets succeed_on + * + * @return \DateTime + */ + public function getSucceedOn() + { + return $this->container['succeed_on']; + } + + /** + * Sets succeed_on + * + * @param \DateTime $succeed_on + * + * @return $this + */ + public function setSucceedOn($succeed_on) + { + $this->container['succeed_on'] = $succeed_on; + + return $this; + } + + + /** + * Gets success_url + * + * @return string + */ + public function getSuccessUrl() + { + return $this->container['success_url']; + } + + /** + * Sets success_url + * + * @param string $success_url The user will be redirected to success URL when the transaction could be authorized or completed. In case no success URL is specified a default success page will be displayed. + * + * @return $this + */ + public function setSuccessUrl($success_url) + { + $this->container['success_url'] = $success_url; + + return $this; + } + + + /** + * Gets transaction + * + * @return \Wallee\Sdk\Model\Transaction + */ + public function getTransaction() + { + return $this->container['transaction']; + } + + /** + * Sets transaction + * + * @param \Wallee\Sdk\Model\Transaction $transaction + * + * @return $this + */ + public function setTransaction($transaction) + { + $this->container['transaction'] = $transaction; + + return $this; + } + + + /** + * Gets type + * + * @return \Wallee\Sdk\Model\SubscriptionChargeType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Wallee\Sdk\Model\SubscriptionChargeType $type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/SubscriptionChargeCreate.php b/wallee-sdk/lib/Model/SubscriptionChargeCreate.php index 81738ac..722566f 100644 --- a/wallee-sdk/lib/Model/SubscriptionChargeCreate.php +++ b/wallee-sdk/lib/Model/SubscriptionChargeCreate.php @@ -1,10 +1,8 @@ 'string', - 'failedUrl' => 'string', - 'plannedExecutionDate' => '\DateTime', - 'processingType' => '\Wallee\Sdk\Model\SubscriptionChargeProcessingType', - 'reference' => 'string', - 'subscription' => 'int', - 'successUrl' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @var string - */ - private $externalId; - - /** - * The user will be redirected to failed URL when the transaction could not be authorized or completed. In case no failed URL is specified a default failed page will be displayed. - * - * @var string - */ - private $failedUrl; - - /** - * - * - * @var \DateTime - */ - private $plannedExecutionDate; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionChargeProcessingType - */ - private $processingType; - - /** - * - * - * @var string - */ - private $reference; - - /** - * The field subscription indicates the subscription to which the charge belongs to. - * - * @var int - */ - private $subscription; - - /** - * The user will be redirected to success URL when the transaction could be authorized or completed. In case no success URL is specified a default success page will be displayed. - * - * @var string - */ - private $successUrl; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['externalId'])) { - $this->setExternalId($data['externalId']); - } - if (isset($data['failedUrl'])) { - $this->setFailedUrl($data['failedUrl']); - } - if (isset($data['plannedExecutionDate'])) { - $this->setPlannedExecutionDate($data['plannedExecutionDate']); - } - if (isset($data['processingType'])) { - $this->setProcessingType($data['processingType']); - } - if (isset($data['reference'])) { - $this->setReference($data['reference']); - } - if (isset($data['subscription'])) { - $this->setSubscription($data['subscription']); - } - if (isset($data['successUrl'])) { - $this->setSuccessUrl($data['successUrl']); - } - } - - - /** - * Returns externalId. - * - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @return string - */ - public function getExternalId() { - return $this->externalId; - } - - /** - * Sets externalId. - * - * @param string $externalId - * @return SubscriptionChargeCreate - */ - public function setExternalId($externalId) { - $this->externalId = $externalId; - - return $this; - } - - /** - * Returns failedUrl. - * - * The user will be redirected to failed URL when the transaction could not be authorized or completed. In case no failed URL is specified a default failed page will be displayed. - * - * @return string - */ - public function getFailedUrl() { - return $this->failedUrl; - } - - /** - * Sets failedUrl. - * - * @param string $failedUrl - * @return SubscriptionChargeCreate - */ - public function setFailedUrl($failedUrl) { - $this->failedUrl = $failedUrl; - - return $this; - } - - /** - * Returns plannedExecutionDate. - * - * - * - * @return \DateTime - */ - public function getPlannedExecutionDate() { - return $this->plannedExecutionDate; - } - - /** - * Sets plannedExecutionDate. - * - * @param \DateTime $plannedExecutionDate - * @return SubscriptionChargeCreate - */ - public function setPlannedExecutionDate($plannedExecutionDate) { - $this->plannedExecutionDate = $plannedExecutionDate; - - return $this; - } - - /** - * Returns processingType. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionChargeProcessingType - */ - public function getProcessingType() { - return $this->processingType; - } - - /** - * Sets processingType. - * - * @param \Wallee\Sdk\Model\SubscriptionChargeProcessingType $processingType - * @return SubscriptionChargeCreate - */ - public function setProcessingType($processingType) { - $this->processingType = $processingType; - - return $this; - } - - /** - * Returns reference. - * - * - * - * @return string - */ - public function getReference() { - return $this->reference; - } - - /** - * Sets reference. - * - * @param string $reference - * @return SubscriptionChargeCreate - */ - public function setReference($reference) { - $this->reference = $reference; - - return $this; - } - - /** - * Returns subscription. - * - * The field subscription indicates the subscription to which the charge belongs to. - * - * @return int - */ - public function getSubscription() { - return $this->subscription; - } - - /** - * Sets subscription. - * - * @param int $subscription - * @return SubscriptionChargeCreate - */ - public function setSubscription($subscription) { - $this->subscription = $subscription; - - return $this; - } - - /** - * Returns successUrl. - * - * The user will be redirected to success URL when the transaction could be authorized or completed. In case no success URL is specified a default success page will be displayed. - * - * @return string - */ - public function getSuccessUrl() { - return $this->successUrl; - } - - /** - * Sets successUrl. - * - * @param string $successUrl - * @return SubscriptionChargeCreate - */ - public function setSuccessUrl($successUrl) { - $this->successUrl = $successUrl; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getExternalId() === null) { - throw new ValidationException("'externalId' can't be null", 'externalId', $this); - } - if ($this->getProcessingType() === null) { - throw new ValidationException("'processingType' can't be null", 'processingType', $this); - } - if ($this->getSubscription() === null) { - throw new ValidationException("'subscription' can't be null", 'subscription', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionChargeCreate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionCharge.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'external_id' => 'string', + 'failed_url' => 'string', + 'planned_execution_date' => '\DateTime', + 'processing_type' => '\Wallee\Sdk\Model\SubscriptionChargeProcessingType', + 'reference' => 'string', + 'subscription' => 'int', + 'success_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'external_id' => null, + 'failed_url' => null, + 'planned_execution_date' => 'date-time', + 'processing_type' => null, + 'reference' => null, + 'subscription' => 'int64', + 'success_url' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'external_id' => 'externalId', + 'failed_url' => 'failedUrl', + 'planned_execution_date' => 'plannedExecutionDate', + 'processing_type' => 'processingType', + 'reference' => 'reference', + 'subscription' => 'subscription', + 'success_url' => 'successUrl' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'external_id' => 'setExternalId', + 'failed_url' => 'setFailedUrl', + 'planned_execution_date' => 'setPlannedExecutionDate', + 'processing_type' => 'setProcessingType', + 'reference' => 'setReference', + 'subscription' => 'setSubscription', + 'success_url' => 'setSuccessUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'external_id' => 'getExternalId', + 'failed_url' => 'getFailedUrl', + 'planned_execution_date' => 'getPlannedExecutionDate', + 'processing_type' => 'getProcessingType', + 'reference' => 'getReference', + 'subscription' => 'getSubscription', + 'success_url' => 'getSuccessUrl' + ]; + + + + /** + * 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['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['failed_url'] = isset($data['failed_url']) ? $data['failed_url'] : null; + + $this->container['planned_execution_date'] = isset($data['planned_execution_date']) ? $data['planned_execution_date'] : null; + + $this->container['processing_type'] = isset($data['processing_type']) ? $data['processing_type'] : null; + + $this->container['reference'] = isset($data['reference']) ? $data['reference'] : null; + + $this->container['subscription'] = isset($data['subscription']) ? $data['subscription'] : null; + + $this->container['success_url'] = isset($data['success_url']) ? $data['success_url'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['external_id'] === null) { + $invalidProperties[] = "'external_id' can't be null"; + } + if ($this->container['processing_type'] === null) { + $invalidProperties[] = "'processing_type' can't be null"; + } + if ($this->container['subscription'] === null) { + $invalidProperties[] = "'subscription' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets failed_url + * + * @return string + */ + public function getFailedUrl() + { + return $this->container['failed_url']; + } + + /** + * Sets failed_url + * + * @param string $failed_url The user will be redirected to failed URL when the transaction could not be authorized or completed. In case no failed URL is specified a default failed page will be displayed. + * + * @return $this + */ + public function setFailedUrl($failed_url) + { + $this->container['failed_url'] = $failed_url; + + return $this; + } + + + /** + * Gets planned_execution_date + * + * @return \DateTime + */ + public function getPlannedExecutionDate() + { + return $this->container['planned_execution_date']; + } + + /** + * Sets planned_execution_date + * + * @param \DateTime $planned_execution_date + * + * @return $this + */ + public function setPlannedExecutionDate($planned_execution_date) + { + $this->container['planned_execution_date'] = $planned_execution_date; + + return $this; + } + + + /** + * Gets processing_type + * + * @return \Wallee\Sdk\Model\SubscriptionChargeProcessingType + */ + public function getProcessingType() + { + return $this->container['processing_type']; + } + + /** + * Sets processing_type + * + * @param \Wallee\Sdk\Model\SubscriptionChargeProcessingType $processing_type + * + * @return $this + */ + public function setProcessingType($processing_type) + { + $this->container['processing_type'] = $processing_type; + + return $this; + } + + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference + * + * @return $this + */ + public function setReference($reference) + { + $this->container['reference'] = $reference; + + return $this; + } + + + /** + * Gets subscription + * + * @return int + */ + public function getSubscription() + { + return $this->container['subscription']; + } + + /** + * Sets subscription + * + * @param int $subscription The field subscription indicates the subscription to which the charge belongs to. + * + * @return $this + */ + public function setSubscription($subscription) + { + $this->container['subscription'] = $subscription; + + return $this; + } + + + /** + * Gets success_url + * + * @return string + */ + public function getSuccessUrl() + { + return $this->container['success_url']; + } + + /** + * Sets success_url + * + * @param string $success_url The user will be redirected to success URL when the transaction could be authorized or completed. In case no success URL is specified a default success page will be displayed. + * + * @return $this + */ + public function setSuccessUrl($success_url) + { + $this->container['success_url'] = $success_url; + + 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/wallee-sdk/lib/Model/SubscriptionChargeProcessingType.php b/wallee-sdk/lib/Model/SubscriptionChargeProcessingType.php index d05193a..58b4406 100644 --- a/wallee-sdk/lib/Model/SubscriptionChargeProcessingType.php +++ b/wallee-sdk/lib/Model/SubscriptionChargeProcessingType.php @@ -1,10 +1,8 @@ 'int', + 'quantity' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'component' => 'int64', + 'quantity' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'component' => 'component', + 'quantity' => 'quantity' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'component' => 'setComponent', + 'quantity' => 'setQuantity' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'component' => 'getComponent', + 'quantity' => 'getQuantity' + ]; + + + + /** + * 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['component'] = isset($data['component']) ? $data['component'] : 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 = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 component + * + * @return int + */ + public function getComponent() + { + return $this->container['component']; + } + + /** + * Sets component + * + * @param int $component + * + * @return $this + */ + public function setComponent($component) + { + $this->container['component'] = $component; + + return $this; + } + + + /** + * Gets quantity + * + * @return float + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param float $quantity + * + * @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/wallee-sdk/lib/Model/SubscriptionComponentReferenceConfiguration.php b/wallee-sdk/lib/Model/SubscriptionComponentReferenceConfiguration.php new file mode 100644 index 0000000..46c50cf --- /dev/null +++ b/wallee-sdk/lib/Model/SubscriptionComponentReferenceConfiguration.php @@ -0,0 +1,330 @@ + 'int', + 'quantity' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'product_component_reference_id' => 'int64', + 'quantity' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'product_component_reference_id' => 'productComponentReferenceId', + 'quantity' => 'quantity' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'product_component_reference_id' => 'setProductComponentReferenceId', + 'quantity' => 'setQuantity' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'product_component_reference_id' => 'getProductComponentReferenceId', + 'quantity' => 'getQuantity' + ]; + + + + /** + * 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['product_component_reference_id'] = isset($data['product_component_reference_id']) ? $data['product_component_reference_id'] : 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 = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 product_component_reference_id + * + * @return int + */ + public function getProductComponentReferenceId() + { + return $this->container['product_component_reference_id']; + } + + /** + * Sets product_component_reference_id + * + * @param int $product_component_reference_id + * + * @return $this + */ + public function setProductComponentReferenceId($product_component_reference_id) + { + $this->container['product_component_reference_id'] = $product_component_reference_id; + + return $this; + } + + + /** + * Gets quantity + * + * @return float + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param float $quantity + * + * @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/wallee-sdk/lib/Model/SubscriptionCreateRequest.php b/wallee-sdk/lib/Model/SubscriptionCreateRequest.php index ceb4c49..1f04a49 100644 --- a/wallee-sdk/lib/Model/SubscriptionCreateRequest.php +++ b/wallee-sdk/lib/Model/SubscriptionCreateRequest.php @@ -1,10 +1,8 @@ 'string', - 'product' => 'int', - 'selectedComponents' => '\Wallee\Sdk\Model\SubscriptionProductComponentReference[]', - 'subscription' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var string - */ - private $currency; - - /** - * The subscription has to be linked with a product. - * - * @var int - */ - private $product; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionProductComponentReference[] - */ - private $selectedComponents; - - /** - * - * - * @var int - */ - private $subscription; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['currency'])) { - $this->setCurrency($data['currency']); - } - if (isset($data['product'])) { - $this->setProduct($data['product']); - } - if (isset($data['selectedComponents'])) { - $this->setSelectedComponents($data['selectedComponents']); - } - if (isset($data['subscription'])) { - $this->setSubscription($data['subscription']); - } - } - - - /** - * Returns currency. - * - * - * - * @return string - */ - public function getCurrency() { - return $this->currency; - } - - /** - * Sets currency. - * - * @param string $currency - * @return SubscriptionCreateRequest - */ - public function setCurrency($currency) { - $this->currency = $currency; - - return $this; - } - - /** - * Returns product. - * - * The subscription has to be linked with a product. - * - * @return int - */ - public function getProduct() { - return $this->product; - } - - /** - * Sets product. - * - * @param int $product - * @return SubscriptionCreateRequest - */ - public function setProduct($product) { - $this->product = $product; - - return $this; - } - - /** - * Returns selectedComponents. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionProductComponentReference[] - */ - public function getSelectedComponents() { - return $this->selectedComponents; - } - - /** - * Sets selectedComponents. - * - * @param \Wallee\Sdk\Model\SubscriptionProductComponentReference[] $selectedComponents - * @return SubscriptionCreateRequest - */ - public function setSelectedComponents($selectedComponents) { - $this->selectedComponents = $selectedComponents; - - return $this; - } - - /** - * Returns subscription. - * - * - * - * @return int - */ - public function getSubscription() { - return $this->subscription; - } - - /** - * Sets subscription. - * - * @param int $subscription - * @return SubscriptionCreateRequest - */ - public function setSubscription($subscription) { - $this->subscription = $subscription; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getCurrency() === null) { - throw new ValidationException("'currency' can't be null", 'currency', $this); - } - if ($this->getProduct() === null) { - throw new ValidationException("'product' can't be null", 'product', $this); - } - if ($this->getSubscription() === null) { - throw new ValidationException("'subscription' can't be null", 'subscription', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionCreateRequest implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionCreateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'component_configurations' => '\Wallee\Sdk\Model\SubscriptionComponentReferenceConfiguration[]', + 'currency' => 'string', + 'product' => 'int', + 'selected_components' => '\Wallee\Sdk\Model\SubscriptionProductComponentReference[]', + 'subscription' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'component_configurations' => null, + 'currency' => null, + 'product' => 'int64', + 'selected_components' => null, + 'subscription' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'component_configurations' => 'componentConfigurations', + 'currency' => 'currency', + 'product' => 'product', + 'selected_components' => 'selectedComponents', + 'subscription' => 'subscription' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'component_configurations' => 'setComponentConfigurations', + 'currency' => 'setCurrency', + 'product' => 'setProduct', + 'selected_components' => 'setSelectedComponents', + 'subscription' => 'setSubscription' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'component_configurations' => 'getComponentConfigurations', + 'currency' => 'getCurrency', + 'product' => 'getProduct', + 'selected_components' => 'getSelectedComponents', + 'subscription' => 'getSubscription' + ]; + + + + /** + * 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['component_configurations'] = isset($data['component_configurations']) ? $data['component_configurations'] : null; + + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + + $this->container['product'] = isset($data['product']) ? $data['product'] : null; + + $this->container['selected_components'] = isset($data['selected_components']) ? $data['selected_components'] : null; + + $this->container['subscription'] = isset($data['subscription']) ? $data['subscription'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['product'] === null) { + $invalidProperties[] = "'product' can't be null"; + } + if ($this->container['subscription'] === null) { + $invalidProperties[] = "'subscription' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 component_configurations + * + * @return \Wallee\Sdk\Model\SubscriptionComponentReferenceConfiguration[] + */ + public function getComponentConfigurations() + { + return $this->container['component_configurations']; + } + + /** + * Sets component_configurations + * + * @param \Wallee\Sdk\Model\SubscriptionComponentReferenceConfiguration[] $component_configurations + * + * @return $this + */ + public function setComponentConfigurations($component_configurations) + { + $this->container['component_configurations'] = $component_configurations; + + return $this; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + + /** + * Gets product + * + * @return int + */ + public function getProduct() + { + return $this->container['product']; + } + + /** + * Sets product + * + * @param int $product The subscription has to be linked with a product. + * + * @return $this + */ + public function setProduct($product) + { + $this->container['product'] = $product; + + return $this; + } + + + /** + * Gets selected_components + * + * @return \Wallee\Sdk\Model\SubscriptionProductComponentReference[] + */ + public function getSelectedComponents() + { + return $this->container['selected_components']; + } + + /** + * Sets selected_components + * + * @param \Wallee\Sdk\Model\SubscriptionProductComponentReference[] $selected_components + * + * @return $this + */ + public function setSelectedComponents($selected_components) + { + $this->container['selected_components'] = $selected_components; + + return $this; + } + + + /** + * Gets subscription + * + * @return int + */ + public function getSubscription() + { + return $this->container['subscription']; + } + + /** + * Sets subscription + * + * @param int $subscription + * + * @return $this + */ + public function setSubscription($subscription) + { + $this->container['subscription'] = $subscription; + + 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/wallee-sdk/lib/Model/SubscriptionLedgerEntry.php b/wallee-sdk/lib/Model/SubscriptionLedgerEntry.php index e1c3fec..77f3f6c 100644 --- a/wallee-sdk/lib/Model/SubscriptionLedgerEntry.php +++ b/wallee-sdk/lib/Model/SubscriptionLedgerEntry.php @@ -1,10 +1,8 @@ 'float', - 'amountExcludingTax' => 'float', - 'amountIncludingTax' => 'float', - 'createdBy' => 'int', - 'createdOn' => '\DateTime', - 'externalId' => 'string', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'plannedPurgeDate' => '\DateTime', - 'quantity' => 'float', - 'state' => '\Wallee\Sdk\Model\SubscriptionLedgerEntryState', - 'subscriptionVersion' => 'int', - 'taxAmount' => 'float', - 'taxes' => '\Wallee\Sdk\Model\Tax[]', - 'title' => 'string', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var float - */ - private $aggregatedTaxRate; - - /** - * - * - * @var float - */ - private $amountExcludingTax; - - /** - * - * - * @var float - */ - private $amountIncludingTax; - - /** - * - * - * @var int - */ - private $createdBy; - - /** - * The created on date indicates the date on which the entity was stored into the database. - * - * @var \DateTime - */ - private $createdOn; - - /** - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @var string - */ - private $externalId; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var float - */ - private $quantity; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionLedgerEntryState - */ - private $state; - - /** - * - * - * @var int - */ - private $subscriptionVersion; - - /** - * - * - * @var float - */ - private $taxAmount; - - /** - * - * - * @var \Wallee\Sdk\Model\Tax[] - */ - private $taxes; - - /** - * - * - * @var string - */ - private $title; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['taxes'])) { - $this->setTaxes($data['taxes']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns aggregatedTaxRate. - * - * - * - * @return float - */ - public function getAggregatedTaxRate() { - return $this->aggregatedTaxRate; - } - - /** - * Sets aggregatedTaxRate. - * - * @param float $aggregatedTaxRate - * @return SubscriptionLedgerEntry - */ - protected function setAggregatedTaxRate($aggregatedTaxRate) { - $this->aggregatedTaxRate = $aggregatedTaxRate; - - return $this; - } - - /** - * Returns amountExcludingTax. - * - * - * - * @return float - */ - public function getAmountExcludingTax() { - return $this->amountExcludingTax; - } - - /** - * Sets amountExcludingTax. - * - * @param float $amountExcludingTax - * @return SubscriptionLedgerEntry - */ - protected function setAmountExcludingTax($amountExcludingTax) { - $this->amountExcludingTax = $amountExcludingTax; - - return $this; - } - - /** - * Returns amountIncludingTax. - * - * - * - * @return float - */ - public function getAmountIncludingTax() { - return $this->amountIncludingTax; - } - - /** - * Sets amountIncludingTax. - * - * @param float $amountIncludingTax - * @return SubscriptionLedgerEntry - */ - protected function setAmountIncludingTax($amountIncludingTax) { - $this->amountIncludingTax = $amountIncludingTax; - - return $this; - } - - /** - * Returns createdBy. - * - * - * - * @return int - */ - public function getCreatedBy() { - return $this->createdBy; - } - - /** - * Sets createdBy. - * - * @param int $createdBy - * @return SubscriptionLedgerEntry - */ - protected function setCreatedBy($createdBy) { - $this->createdBy = $createdBy; - - return $this; - } - - /** - * Returns createdOn. - * - * The created on date indicates the date on which the entity was stored into the database. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return SubscriptionLedgerEntry - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns externalId. - * - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @return string - */ - public function getExternalId() { - return $this->externalId; - } - - /** - * Sets externalId. - * - * @param string $externalId - * @return SubscriptionLedgerEntry - */ - protected function setExternalId($externalId) { - $this->externalId = $externalId; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionLedgerEntry - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return SubscriptionLedgerEntry - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return SubscriptionLedgerEntry - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns quantity. - * - * - * - * @return float - */ - public function getQuantity() { - return $this->quantity; - } - - /** - * Sets quantity. - * - * @param float $quantity - * @return SubscriptionLedgerEntry - */ - protected function setQuantity($quantity) { - $this->quantity = $quantity; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionLedgerEntryState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\SubscriptionLedgerEntryState $state - * @return SubscriptionLedgerEntry - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns subscriptionVersion. - * - * - * - * @return int - */ - public function getSubscriptionVersion() { - return $this->subscriptionVersion; - } - - /** - * Sets subscriptionVersion. - * - * @param int $subscriptionVersion - * @return SubscriptionLedgerEntry - */ - protected function setSubscriptionVersion($subscriptionVersion) { - $this->subscriptionVersion = $subscriptionVersion; - - return $this; - } - - /** - * Returns taxAmount. - * - * - * - * @return float - */ - public function getTaxAmount() { - return $this->taxAmount; - } - - /** - * Sets taxAmount. - * - * @param float $taxAmount - * @return SubscriptionLedgerEntry - */ - protected function setTaxAmount($taxAmount) { - $this->taxAmount = $taxAmount; - - return $this; - } - - /** - * Returns taxes. - * - * - * - * @return \Wallee\Sdk\Model\Tax[] - */ - public function getTaxes() { - return $this->taxes; - } - - /** - * Sets taxes. - * - * @param \Wallee\Sdk\Model\Tax[] $taxes - * @return SubscriptionLedgerEntry - */ - public function setTaxes($taxes) { - $this->taxes = $taxes; - - return $this; - } - - /** - * Returns title. - * - * - * - * @return string - */ - public function getTitle() { - return $this->title; - } - - /** - * Sets title. - * - * @param string $title - * @return SubscriptionLedgerEntry - */ - protected function setTitle($title) { - $this->title = $title; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriptionLedgerEntry - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionLedgerEntry implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionLedgerEntry'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'aggregated_tax_rate' => 'float', + 'amount_excluding_tax' => 'float', + 'amount_including_tax' => 'float', + 'created_by' => 'int', + 'created_on' => '\DateTime', + 'external_id' => 'string', + 'id' => 'int', + 'linked_space_id' => 'int', + 'planned_purge_date' => '\DateTime', + 'quantity' => 'float', + 'state' => '\Wallee\Sdk\Model\SubscriptionLedgerEntryState', + 'subscription_version' => 'int', + 'tax_amount' => 'float', + 'taxes' => '\Wallee\Sdk\Model\Tax[]', + 'title' => 'string', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'aggregated_tax_rate' => null, + 'amount_excluding_tax' => null, + 'amount_including_tax' => null, + 'created_by' => 'int64', + 'created_on' => 'date-time', + 'external_id' => null, + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'planned_purge_date' => 'date-time', + 'quantity' => null, + 'state' => null, + 'subscription_version' => 'int64', + 'tax_amount' => null, + 'taxes' => null, + 'title' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'aggregated_tax_rate' => 'aggregatedTaxRate', + 'amount_excluding_tax' => 'amountExcludingTax', + 'amount_including_tax' => 'amountIncludingTax', + 'created_by' => 'createdBy', + 'created_on' => 'createdOn', + 'external_id' => 'externalId', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'planned_purge_date' => 'plannedPurgeDate', + 'quantity' => 'quantity', + 'state' => 'state', + 'subscription_version' => 'subscriptionVersion', + 'tax_amount' => 'taxAmount', + 'taxes' => 'taxes', + 'title' => 'title', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'aggregated_tax_rate' => 'setAggregatedTaxRate', + 'amount_excluding_tax' => 'setAmountExcludingTax', + 'amount_including_tax' => 'setAmountIncludingTax', + 'created_by' => 'setCreatedBy', + 'created_on' => 'setCreatedOn', + 'external_id' => 'setExternalId', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'quantity' => 'setQuantity', + 'state' => 'setState', + 'subscription_version' => 'setSubscriptionVersion', + 'tax_amount' => 'setTaxAmount', + 'taxes' => 'setTaxes', + 'title' => 'setTitle', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'aggregated_tax_rate' => 'getAggregatedTaxRate', + 'amount_excluding_tax' => 'getAmountExcludingTax', + 'amount_including_tax' => 'getAmountIncludingTax', + 'created_by' => 'getCreatedBy', + 'created_on' => 'getCreatedOn', + 'external_id' => 'getExternalId', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'quantity' => 'getQuantity', + 'state' => 'getState', + 'subscription_version' => 'getSubscriptionVersion', + 'tax_amount' => 'getTaxAmount', + 'taxes' => 'getTaxes', + 'title' => 'getTitle', + 'version' => 'getVersion' + ]; + + + + /** + * 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['aggregated_tax_rate'] = isset($data['aggregated_tax_rate']) ? $data['aggregated_tax_rate'] : null; + + $this->container['amount_excluding_tax'] = isset($data['amount_excluding_tax']) ? $data['amount_excluding_tax'] : null; + + $this->container['amount_including_tax'] = isset($data['amount_including_tax']) ? $data['amount_including_tax'] : null; + + $this->container['created_by'] = isset($data['created_by']) ? $data['created_by'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['subscription_version'] = isset($data['subscription_version']) ? $data['subscription_version'] : null; + + $this->container['tax_amount'] = isset($data['tax_amount']) ? $data['tax_amount'] : null; + + $this->container['taxes'] = isset($data['taxes']) ? $data['taxes'] : null; + + $this->container['title'] = isset($data['title']) ? $data['title'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 aggregated_tax_rate + * + * @return float + */ + public function getAggregatedTaxRate() + { + return $this->container['aggregated_tax_rate']; + } + + /** + * Sets aggregated_tax_rate + * + * @param float $aggregated_tax_rate + * + * @return $this + */ + public function setAggregatedTaxRate($aggregated_tax_rate) + { + $this->container['aggregated_tax_rate'] = $aggregated_tax_rate; + + return $this; + } + + + /** + * Gets amount_excluding_tax + * + * @return float + */ + public function getAmountExcludingTax() + { + return $this->container['amount_excluding_tax']; + } + + /** + * Sets amount_excluding_tax + * + * @param float $amount_excluding_tax + * + * @return $this + */ + public function setAmountExcludingTax($amount_excluding_tax) + { + $this->container['amount_excluding_tax'] = $amount_excluding_tax; + + return $this; + } + + + /** + * Gets amount_including_tax + * + * @return float + */ + public function getAmountIncludingTax() + { + return $this->container['amount_including_tax']; + } + + /** + * Sets amount_including_tax + * + * @param float $amount_including_tax + * + * @return $this + */ + public function setAmountIncludingTax($amount_including_tax) + { + $this->container['amount_including_tax'] = $amount_including_tax; + + return $this; + } + + + /** + * Gets created_by + * + * @return int + */ + public function getCreatedBy() + { + return $this->container['created_by']; + } + + /** + * Sets created_by + * + * @param int $created_by + * + * @return $this + */ + public function setCreatedBy($created_by) + { + $this->container['created_by'] = $created_by; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets quantity + * + * @return float + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param float $quantity + * + * @return $this + */ + public function setQuantity($quantity) + { + $this->container['quantity'] = $quantity; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\SubscriptionLedgerEntryState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\SubscriptionLedgerEntryState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets subscription_version + * + * @return int + */ + public function getSubscriptionVersion() + { + return $this->container['subscription_version']; + } + + /** + * Sets subscription_version + * + * @param int $subscription_version + * + * @return $this + */ + public function setSubscriptionVersion($subscription_version) + { + $this->container['subscription_version'] = $subscription_version; + + return $this; + } + + + /** + * Gets tax_amount + * + * @return float + */ + public function getTaxAmount() + { + return $this->container['tax_amount']; + } + + /** + * Sets tax_amount + * + * @param float $tax_amount + * + * @return $this + */ + public function setTaxAmount($tax_amount) + { + $this->container['tax_amount'] = $tax_amount; + + return $this; + } + + + /** + * Gets taxes + * + * @return \Wallee\Sdk\Model\Tax[] + */ + public function getTaxes() + { + return $this->container['taxes']; + } + + /** + * Sets taxes + * + * @param \Wallee\Sdk\Model\Tax[] $taxes + * + * @return $this + */ + public function setTaxes($taxes) + { + $this->container['taxes'] = $taxes; + + return $this; + } + + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title + * + * @return $this + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/SubscriptionLedgerEntryCreate.php b/wallee-sdk/lib/Model/SubscriptionLedgerEntryCreate.php index 883d923..5fa314a 100644 --- a/wallee-sdk/lib/Model/SubscriptionLedgerEntryCreate.php +++ b/wallee-sdk/lib/Model/SubscriptionLedgerEntryCreate.php @@ -1,10 +1,8 @@ 'float', - 'externalId' => 'string', - 'quantity' => 'float', - 'subscriptionVersion' => 'int', - 'taxes' => '\Wallee\Sdk\Model\TaxCreate[]', - 'title' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var float - */ - private $amountIncludingTax; - - /** - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @var string - */ - private $externalId; - - /** - * - * - * @var float - */ - private $quantity; - - /** - * - * - * @var int - */ - private $subscriptionVersion; - - /** - * - * - * @var \Wallee\Sdk\Model\TaxCreate[] - */ - private $taxes; - - /** - * - * - * @var string - */ - private $title; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['amountIncludingTax'])) { - $this->setAmountIncludingTax($data['amountIncludingTax']); - } - if (isset($data['externalId'])) { - $this->setExternalId($data['externalId']); - } - if (isset($data['quantity'])) { - $this->setQuantity($data['quantity']); - } - if (isset($data['subscriptionVersion'])) { - $this->setSubscriptionVersion($data['subscriptionVersion']); - } - if (isset($data['taxes'])) { - $this->setTaxes($data['taxes']); - } - if (isset($data['title'])) { - $this->setTitle($data['title']); - } - } - - - /** - * Returns amountIncludingTax. - * - * - * - * @return float - */ - public function getAmountIncludingTax() { - return $this->amountIncludingTax; - } - - /** - * Sets amountIncludingTax. - * - * @param float $amountIncludingTax - * @return SubscriptionLedgerEntryCreate - */ - public function setAmountIncludingTax($amountIncludingTax) { - $this->amountIncludingTax = $amountIncludingTax; - - return $this; - } - - /** - * Returns externalId. - * - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @return string - */ - public function getExternalId() { - return $this->externalId; - } - - /** - * Sets externalId. - * - * @param string $externalId - * @return SubscriptionLedgerEntryCreate - */ - public function setExternalId($externalId) { - $this->externalId = $externalId; - - return $this; - } - - /** - * Returns quantity. - * - * - * - * @return float - */ - public function getQuantity() { - return $this->quantity; - } - - /** - * Sets quantity. - * - * @param float $quantity - * @return SubscriptionLedgerEntryCreate - */ - public function setQuantity($quantity) { - $this->quantity = $quantity; - - return $this; - } - - /** - * Returns subscriptionVersion. - * - * - * - * @return int - */ - public function getSubscriptionVersion() { - return $this->subscriptionVersion; - } - - /** - * Sets subscriptionVersion. - * - * @param int $subscriptionVersion - * @return SubscriptionLedgerEntryCreate - */ - public function setSubscriptionVersion($subscriptionVersion) { - $this->subscriptionVersion = $subscriptionVersion; - - return $this; - } - - /** - * Returns taxes. - * - * - * - * @return \Wallee\Sdk\Model\TaxCreate[] - */ - public function getTaxes() { - return $this->taxes; - } - - /** - * Sets taxes. - * - * @param \Wallee\Sdk\Model\TaxCreate[] $taxes - * @return SubscriptionLedgerEntryCreate - */ - public function setTaxes($taxes) { - $this->taxes = $taxes; - - return $this; - } - - /** - * Returns title. - * - * - * - * @return string - */ - public function getTitle() { - return $this->title; - } - - /** - * Sets title. - * - * @param string $title - * @return SubscriptionLedgerEntryCreate - */ - public function setTitle($title) { - $this->title = $title; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getAmountIncludingTax() === null) { - throw new ValidationException("'amountIncludingTax' can't be null", 'amountIncludingTax', $this); - } - if ($this->getExternalId() === null) { - throw new ValidationException("'externalId' can't be null", 'externalId', $this); - } - if ($this->getQuantity() === null) { - throw new ValidationException("'quantity' can't be null", 'quantity', $this); - } - if ($this->getSubscriptionVersion() === null) { - throw new ValidationException("'subscriptionVersion' can't be null", 'subscriptionVersion', $this); - } - if ($this->getTitle() === null) { - throw new ValidationException("'title' can't be null", 'title', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionLedgerEntryCreate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionLedgerEntry.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'amount_including_tax' => 'float', + 'external_id' => 'string', + 'quantity' => 'float', + 'subscription_version' => 'int', + 'taxes' => '\Wallee\Sdk\Model\TaxCreate[]', + 'title' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'amount_including_tax' => null, + 'external_id' => null, + 'quantity' => null, + 'subscription_version' => 'int64', + 'taxes' => null, + 'title' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount_including_tax' => 'amountIncludingTax', + 'external_id' => 'externalId', + 'quantity' => 'quantity', + 'subscription_version' => 'subscriptionVersion', + 'taxes' => 'taxes', + 'title' => 'title' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount_including_tax' => 'setAmountIncludingTax', + 'external_id' => 'setExternalId', + 'quantity' => 'setQuantity', + 'subscription_version' => 'setSubscriptionVersion', + 'taxes' => 'setTaxes', + 'title' => 'setTitle' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount_including_tax' => 'getAmountIncludingTax', + 'external_id' => 'getExternalId', + 'quantity' => 'getQuantity', + 'subscription_version' => 'getSubscriptionVersion', + 'taxes' => 'getTaxes', + 'title' => 'getTitle' + ]; + + + + /** + * 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['amount_including_tax'] = isset($data['amount_including_tax']) ? $data['amount_including_tax'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; + + $this->container['subscription_version'] = isset($data['subscription_version']) ? $data['subscription_version'] : null; + + $this->container['taxes'] = isset($data['taxes']) ? $data['taxes'] : null; + + $this->container['title'] = isset($data['title']) ? $data['title'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount_including_tax'] === null) { + $invalidProperties[] = "'amount_including_tax' can't be null"; + } + if ($this->container['external_id'] === null) { + $invalidProperties[] = "'external_id' can't be null"; + } + if ($this->container['quantity'] === null) { + $invalidProperties[] = "'quantity' can't be null"; + } + if ($this->container['subscription_version'] === null) { + $invalidProperties[] = "'subscription_version' can't be null"; + } + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 amount_including_tax + * + * @return float + */ + public function getAmountIncludingTax() + { + return $this->container['amount_including_tax']; + } + + /** + * Sets amount_including_tax + * + * @param float $amount_including_tax + * + * @return $this + */ + public function setAmountIncludingTax($amount_including_tax) + { + $this->container['amount_including_tax'] = $amount_including_tax; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets quantity + * + * @return float + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param float $quantity + * + * @return $this + */ + public function setQuantity($quantity) + { + $this->container['quantity'] = $quantity; + + return $this; + } + + + /** + * Gets subscription_version + * + * @return int + */ + public function getSubscriptionVersion() + { + return $this->container['subscription_version']; + } + + /** + * Sets subscription_version + * + * @param int $subscription_version + * + * @return $this + */ + public function setSubscriptionVersion($subscription_version) + { + $this->container['subscription_version'] = $subscription_version; + + return $this; + } + + + /** + * Gets taxes + * + * @return \Wallee\Sdk\Model\TaxCreate[] + */ + public function getTaxes() + { + return $this->container['taxes']; + } + + /** + * Sets taxes + * + * @param \Wallee\Sdk\Model\TaxCreate[] $taxes + * + * @return $this + */ + public function setTaxes($taxes) + { + $this->container['taxes'] = $taxes; + + return $this; + } + + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title + * + * @return $this + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + 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/wallee-sdk/lib/Model/SubscriptionLedgerEntryState.php b/wallee-sdk/lib/Model/SubscriptionLedgerEntryState.php index 7d58040..1403730 100644 --- a/wallee-sdk/lib/Model/SubscriptionLedgerEntryState.php +++ b/wallee-sdk/lib/Model/SubscriptionLedgerEntryState.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\DatabaseTranslatedString', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedString', - 'plannedPurgeDate' => '\DateTime', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'type' => '\Wallee\Sdk\Model\SubscriptionMetricType', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedString - */ - private $description; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedString - */ - private $name; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionMetricType - */ - private $type; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['type'])) { - $this->setType($data['type']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns description. - * - * - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedString - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedString $description - * @return SubscriptionMetric - */ - public function setDescription($description) { - $this->description = $description; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionMetric - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return SubscriptionMetric - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedString - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedString $name - * @return SubscriptionMetric - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return SubscriptionMetric - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return SubscriptionMetric - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns type. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionMetricType - */ - public function getType() { - return $this->type; - } - - /** - * Sets type. - * - * @param \Wallee\Sdk\Model\SubscriptionMetricType $type - * @return SubscriptionMetric - */ - public function setType($type) { - $this->type = $type; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriptionMetric - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionMetric implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionMetric'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'description' => '\Wallee\Sdk\Model\DatabaseTranslatedString', + 'id' => 'int', + 'linked_space_id' => 'int', + 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedString', + 'planned_purge_date' => '\DateTime', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'type' => '\Wallee\Sdk\Model\SubscriptionMetricType', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'name' => null, + 'planned_purge_date' => 'date-time', + 'state' => null, + 'type' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'planned_purge_date' => 'plannedPurgeDate', + 'state' => 'state', + 'type' => 'type', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'state' => 'setState', + 'type' => 'setType', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'state' => 'getState', + 'type' => 'getType', + 'version' => 'getVersion' + ]; + + + + /** + * 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['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 description + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedString + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedString $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedString + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedString $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets type + * + * @return \Wallee\Sdk\Model\SubscriptionMetricType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Wallee\Sdk\Model\SubscriptionMetricType $type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/SubscriptionMetricActive.php b/wallee-sdk/lib/Model/SubscriptionMetricActive.php index ee95c0c..2a39b54 100644 --- a/wallee-sdk/lib/Model/SubscriptionMetricActive.php +++ b/wallee-sdk/lib/Model/SubscriptionMetricActive.php @@ -1,10 +1,8 @@ validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class SubscriptionMetricActive extends SubscriptionMetricUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionMetric.Active'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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; + } + + + /** + * 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/wallee-sdk/lib/Model/SubscriptionMetricCreate.php b/wallee-sdk/lib/Model/SubscriptionMetricCreate.php index 4dedc65..b4b4229 100644 --- a/wallee-sdk/lib/Model/SubscriptionMetricCreate.php +++ b/wallee-sdk/lib/Model/SubscriptionMetricCreate.php @@ -1,10 +1,8 @@ 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * - * - * @var int - */ - private $type; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['type'])) { - $this->setType($data['type']); - } - } - - - /** - * Returns description. - * - * - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - public function getDescription() { - return parent::getDescription(); - } - - /** - * Sets description. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $description - * @return SubscriptionMetricCreate - */ - public function setDescription($description) { - return parent::setDescription($description); - } - - /** - * Returns name. - * - * - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - public function getName() { - return parent::getName(); - } - - /** - * Sets name. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $name - * @return SubscriptionMetricCreate - */ - public function setName($name) { - return parent::setName($name); - } - - /** - * Returns type. - * - * - * - * @return int - */ - public function getType() { - return $this->type; - } - - /** - * Sets type. - * - * @param int $type - * @return SubscriptionMetricCreate - */ - public function setType($type) { - $this->type = $type; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - if ($this->getName() === null) { - throw new ValidationException("'name' can't be null", 'name', $this); - } - if ($this->getType() === null) { - throw new ValidationException("'type' can't be null", 'type', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class SubscriptionMetricCreate extends AbstractSubscriptionMetricUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionMetric.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'type' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'type' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets type + * + * @return int + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param int $type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + 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/wallee-sdk/lib/Model/SubscriptionMetricType.php b/wallee-sdk/lib/Model/SubscriptionMetricType.php index 241fe79..2e4ffc1 100644 --- a/wallee-sdk/lib/Model/SubscriptionMetricType.php +++ b/wallee-sdk/lib/Model/SubscriptionMetricType.php @@ -1,10 +1,8 @@ 'map[string,string]', - 'feature' => '\Wallee\Sdk\Model\Feature', - 'id' => 'int', - 'name' => 'map[string,string]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * - * - * @var \Wallee\Sdk\Model\Feature - */ - private $feature; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $name; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['feature'])) { - $this->setFeature($data['feature']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - } - - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return SubscriptionMetricType - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns feature. - * - * - * - * @return \Wallee\Sdk\Model\Feature - */ - public function getFeature() { - return $this->feature; - } - - /** - * Sets feature. - * - * @param \Wallee\Sdk\Model\Feature $feature - * @return SubscriptionMetricType - */ - public function setFeature($feature) { - $this->feature = $feature; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionMetricType - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return SubscriptionMetricType - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionMetricType implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionMetricType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'description' => 'map[string,string]', + 'feature' => '\Wallee\Sdk\Model\Feature', + 'id' => 'int', + 'name' => 'map[string,string]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'feature' => null, + 'id' => 'int64', + 'name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'feature' => 'feature', + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'feature' => 'setFeature', + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'feature' => 'getFeature', + 'id' => 'getId', + 'name' => 'getName' + ]; + + + + /** + * 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['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['feature'] = isset($data['feature']) ? $data['feature'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets feature + * + * @return \Wallee\Sdk\Model\Feature + */ + public function getFeature() + { + return $this->container['feature']; + } + + /** + * Sets feature + * + * @param \Wallee\Sdk\Model\Feature $feature + * + * @return $this + */ + public function setFeature($feature) + { + $this->container['feature'] = $feature; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + 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/wallee-sdk/lib/Model/SubscriptionMetricUpdate.php b/wallee-sdk/lib/Model/SubscriptionMetricUpdate.php index 4c2ee4f..7786a17 100644 --- a/wallee-sdk/lib/Model/SubscriptionMetricUpdate.php +++ b/wallee-sdk/lib/Model/SubscriptionMetricUpdate.php @@ -1,10 +1,8 @@ 'int', - 'version' => 'int', - 'description' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', - 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - /** - * - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - private $description; - - /** - * - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - private $name; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionMetricUpdate - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriptionMetricUpdate - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Returns description. - * - * - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $description - * @return SubscriptionMetricUpdate - */ - public function setDescription($description) { - $this->description = $description; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $name - * @return SubscriptionMetricUpdate - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getId() === null) { - throw new ValidationException("'id' can't be null", 'id', $this); - } - if ($this->getVersion() === null) { - throw new ValidationException("'version' can't be null", 'version', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionMetricUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionMetric.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'version' => 'int', + 'description' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', + 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64', + 'description' => null, + 'name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version', + 'description' => 'description', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion', + 'description' => 'setDescription', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion', + 'description' => 'getDescription', + 'name' => 'getName' + ]; + + + + /** + * 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['version'] = isset($data['version']) ? $data['version'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + + /** + * Gets description + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets name + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + 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/wallee-sdk/lib/Model/SubscriptionMetricUsageReport.php b/wallee-sdk/lib/Model/SubscriptionMetricUsageReport.php index 108c262..80fa7bc 100644 --- a/wallee-sdk/lib/Model/SubscriptionMetricUsageReport.php +++ b/wallee-sdk/lib/Model/SubscriptionMetricUsageReport.php @@ -1,10 +1,8 @@ 'float', - 'createdByUserId' => 'int', - 'createdOn' => '\DateTime', - 'description' => 'string', - 'externalId' => 'string', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'metric' => 'int', - 'plannedPurgeDate' => '\DateTime', - 'subscription' => 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The consumed units describe the amount of resources consumed. Those consumed units will be billed in the next billing cycle. - * - * @var float - */ - private $consumedUnits; - - /** - * - * - * @var int - */ - private $createdByUserId; - - /** - * - * - * @var \DateTime - */ - private $createdOn; - - /** - * The metric usage report description describe the reported usage. This description may be shown to the end user. - * - * @var string - */ - private $description; - - /** - * The external id identifies the metric usage uniquely. - * - * @var string - */ - private $externalId; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The metric usage report is linked to the metric for which the usage should be recorded. - * - * @var int - */ - private $metric; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * The subscription to which the usage is added to. - * - * @var int - */ - private $subscription; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns consumedUnits. - * - * The consumed units describe the amount of resources consumed. Those consumed units will be billed in the next billing cycle. - * - * @return float - */ - public function getConsumedUnits() { - return $this->consumedUnits; - } - - /** - * Sets consumedUnits. - * - * @param float $consumedUnits - * @return SubscriptionMetricUsageReport - */ - protected function setConsumedUnits($consumedUnits) { - $this->consumedUnits = $consumedUnits; - - return $this; - } - - /** - * Returns createdByUserId. - * - * - * - * @return int - */ - public function getCreatedByUserId() { - return $this->createdByUserId; - } - - /** - * Sets createdByUserId. - * - * @param int $createdByUserId - * @return SubscriptionMetricUsageReport - */ - protected function setCreatedByUserId($createdByUserId) { - $this->createdByUserId = $createdByUserId; - - return $this; - } - - /** - * Returns createdOn. - * - * - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return SubscriptionMetricUsageReport - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns description. - * - * The metric usage report description describe the reported usage. This description may be shown to the end user. - * - * @return string - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param string $description - * @return SubscriptionMetricUsageReport - */ - protected function setDescription($description) { - $this->description = $description; - - return $this; - } - - /** - * Returns externalId. - * - * The external id identifies the metric usage uniquely. - * - * @return string - */ - public function getExternalId() { - return $this->externalId; - } - - /** - * Sets externalId. - * - * @param string $externalId - * @return SubscriptionMetricUsageReport - */ - protected function setExternalId($externalId) { - $this->externalId = $externalId; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionMetricUsageReport - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return SubscriptionMetricUsageReport - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns metric. - * - * The metric usage report is linked to the metric for which the usage should be recorded. - * - * @return int - */ - public function getMetric() { - return $this->metric; - } - - /** - * Sets metric. - * - * @param int $metric - * @return SubscriptionMetricUsageReport - */ - protected function setMetric($metric) { - $this->metric = $metric; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return SubscriptionMetricUsageReport - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns subscription. - * - * The subscription to which the usage is added to. - * - * @return int - */ - public function getSubscription() { - return $this->subscription; - } - - /** - * Sets subscription. - * - * @param int $subscription - * @return SubscriptionMetricUsageReport - */ - protected function setSubscription($subscription) { - $this->subscription = $subscription; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriptionMetricUsageReport - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionMetricUsageReport implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionMetricUsageReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'consumed_units' => 'float', + 'created_by_user_id' => 'int', + 'created_on' => '\DateTime', + 'description' => 'string', + 'external_id' => 'string', + 'id' => 'int', + 'linked_space_id' => 'int', + 'metric' => 'int', + 'planned_purge_date' => '\DateTime', + 'subscription' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'consumed_units' => null, + 'created_by_user_id' => 'int64', + 'created_on' => 'date-time', + 'description' => null, + 'external_id' => null, + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'metric' => 'int64', + 'planned_purge_date' => 'date-time', + 'subscription' => 'int64', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'consumed_units' => 'consumedUnits', + 'created_by_user_id' => 'createdByUserId', + 'created_on' => 'createdOn', + 'description' => 'description', + 'external_id' => 'externalId', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'metric' => 'metric', + 'planned_purge_date' => 'plannedPurgeDate', + 'subscription' => 'subscription', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'consumed_units' => 'setConsumedUnits', + 'created_by_user_id' => 'setCreatedByUserId', + 'created_on' => 'setCreatedOn', + 'description' => 'setDescription', + 'external_id' => 'setExternalId', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'metric' => 'setMetric', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'subscription' => 'setSubscription', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'consumed_units' => 'getConsumedUnits', + 'created_by_user_id' => 'getCreatedByUserId', + 'created_on' => 'getCreatedOn', + 'description' => 'getDescription', + 'external_id' => 'getExternalId', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'metric' => 'getMetric', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'subscription' => 'getSubscription', + 'version' => 'getVersion' + ]; + + + + /** + * 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['consumed_units'] = isset($data['consumed_units']) ? $data['consumed_units'] : null; + + $this->container['created_by_user_id'] = isset($data['created_by_user_id']) ? $data['created_by_user_id'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['metric'] = isset($data['metric']) ? $data['metric'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['subscription'] = isset($data['subscription']) ? $data['subscription'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 consumed_units + * + * @return float + */ + public function getConsumedUnits() + { + return $this->container['consumed_units']; + } + + /** + * Sets consumed_units + * + * @param float $consumed_units The consumed units describe the amount of resources consumed. Those consumed units will be billed in the next billing cycle. + * + * @return $this + */ + public function setConsumedUnits($consumed_units) + { + $this->container['consumed_units'] = $consumed_units; + + return $this; + } + + + /** + * Gets created_by_user_id + * + * @return int + */ + public function getCreatedByUserId() + { + return $this->container['created_by_user_id']; + } + + /** + * Sets created_by_user_id + * + * @param int $created_by_user_id + * + * @return $this + */ + public function setCreatedByUserId($created_by_user_id) + { + $this->container['created_by_user_id'] = $created_by_user_id; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description The metric usage report description describe the reported usage. This description may be shown to the end user. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id identifies the metric usage uniquely. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets metric + * + * @return int + */ + public function getMetric() + { + return $this->container['metric']; + } + + /** + * Sets metric + * + * @param int $metric The metric usage report is linked to the metric for which the usage should be recorded. + * + * @return $this + */ + public function setMetric($metric) + { + $this->container['metric'] = $metric; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets subscription + * + * @return int + */ + public function getSubscription() + { + return $this->container['subscription']; + } + + /** + * Sets subscription + * + * @param int $subscription The subscription to which the usage is added to. + * + * @return $this + */ + public function setSubscription($subscription) + { + $this->container['subscription'] = $subscription; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/SubscriptionMetricUsageReportCreate.php b/wallee-sdk/lib/Model/SubscriptionMetricUsageReportCreate.php index d07e2a5..1177837 100644 --- a/wallee-sdk/lib/Model/SubscriptionMetricUsageReportCreate.php +++ b/wallee-sdk/lib/Model/SubscriptionMetricUsageReportCreate.php @@ -1,10 +1,8 @@ 'float', - 'description' => 'string', - 'externalId' => 'string', - 'metric' => 'int', - 'subscription' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The consumed units describe the amount of resources consumed. Those consumed units will be billed in the next billing cycle. - * - * @var float - */ - private $consumedUnits; - - /** - * The metric usage report description describe the reported usage. This description may be shown to the end user. - * - * @var string - */ - private $description; - - /** - * The external id identifies the metric usage uniquely. - * - * @var string - */ - private $externalId; - - /** - * The metric usage report is linked to the metric for which the usage should be recorded. - * - * @var int - */ - private $metric; - - /** - * The subscription to which the usage is added to. - * - * @var int - */ - private $subscription; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['consumedUnits'])) { - $this->setConsumedUnits($data['consumedUnits']); - } - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['externalId'])) { - $this->setExternalId($data['externalId']); - } - if (isset($data['metric'])) { - $this->setMetric($data['metric']); - } - if (isset($data['subscription'])) { - $this->setSubscription($data['subscription']); - } - } - - - /** - * Returns consumedUnits. - * - * The consumed units describe the amount of resources consumed. Those consumed units will be billed in the next billing cycle. - * - * @return float - */ - public function getConsumedUnits() { - return $this->consumedUnits; - } - - /** - * Sets consumedUnits. - * - * @param float $consumedUnits - * @return SubscriptionMetricUsageReportCreate - */ - public function setConsumedUnits($consumedUnits) { - $this->consumedUnits = $consumedUnits; - - return $this; - } - - /** - * Returns description. - * - * The metric usage report description describe the reported usage. This description may be shown to the end user. - * - * @return string - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param string $description - * @return SubscriptionMetricUsageReportCreate - */ - public function setDescription($description) { - $this->description = $description; - - return $this; - } - - /** - * Returns externalId. - * - * The external id identifies the metric usage uniquely. - * - * @return string - */ - public function getExternalId() { - return $this->externalId; - } - - /** - * Sets externalId. - * - * @param string $externalId - * @return SubscriptionMetricUsageReportCreate - */ - public function setExternalId($externalId) { - $this->externalId = $externalId; - - return $this; - } - - /** - * Returns metric. - * - * The metric usage report is linked to the metric for which the usage should be recorded. - * - * @return int - */ - public function getMetric() { - return $this->metric; - } - - /** - * Sets metric. - * - * @param int $metric - * @return SubscriptionMetricUsageReportCreate - */ - public function setMetric($metric) { - $this->metric = $metric; - - return $this; - } - - /** - * Returns subscription. - * - * The subscription to which the usage is added to. - * - * @return int - */ - public function getSubscription() { - return $this->subscription; - } - - /** - * Sets subscription. - * - * @param int $subscription - * @return SubscriptionMetricUsageReportCreate - */ - public function setSubscription($subscription) { - $this->subscription = $subscription; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getConsumedUnits() === null) { - throw new ValidationException("'consumedUnits' can't be null", 'consumedUnits', $this); - } - if ($this->getExternalId() === null) { - throw new ValidationException("'externalId' can't be null", 'externalId', $this); - } - if ($this->getMetric() === null) { - throw new ValidationException("'metric' can't be null", 'metric', $this); - } - if ($this->getSubscription() === null) { - throw new ValidationException("'subscription' can't be null", 'subscription', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionMetricUsageReportCreate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionMetricUsageReport.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'consumed_units' => 'float', + 'description' => 'string', + 'external_id' => 'string', + 'metric' => 'int', + 'subscription' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'consumed_units' => null, + 'description' => null, + 'external_id' => null, + 'metric' => 'int64', + 'subscription' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'consumed_units' => 'consumedUnits', + 'description' => 'description', + 'external_id' => 'externalId', + 'metric' => 'metric', + 'subscription' => 'subscription' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'consumed_units' => 'setConsumedUnits', + 'description' => 'setDescription', + 'external_id' => 'setExternalId', + 'metric' => 'setMetric', + 'subscription' => 'setSubscription' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'consumed_units' => 'getConsumedUnits', + 'description' => 'getDescription', + 'external_id' => 'getExternalId', + 'metric' => 'getMetric', + 'subscription' => 'getSubscription' + ]; + + + + /** + * 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['consumed_units'] = isset($data['consumed_units']) ? $data['consumed_units'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['metric'] = isset($data['metric']) ? $data['metric'] : null; + + $this->container['subscription'] = isset($data['subscription']) ? $data['subscription'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['consumed_units'] === null) { + $invalidProperties[] = "'consumed_units' can't be null"; + } + if ($this->container['external_id'] === null) { + $invalidProperties[] = "'external_id' can't be null"; + } + if ($this->container['metric'] === null) { + $invalidProperties[] = "'metric' can't be null"; + } + if ($this->container['subscription'] === null) { + $invalidProperties[] = "'subscription' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 consumed_units + * + * @return float + */ + public function getConsumedUnits() + { + return $this->container['consumed_units']; + } + + /** + * Sets consumed_units + * + * @param float $consumed_units The consumed units describe the amount of resources consumed. Those consumed units will be billed in the next billing cycle. + * + * @return $this + */ + public function setConsumedUnits($consumed_units) + { + $this->container['consumed_units'] = $consumed_units; + + return $this; + } + + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description The metric usage report description describe the reported usage. This description may be shown to the end user. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id identifies the metric usage uniquely. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets metric + * + * @return int + */ + public function getMetric() + { + return $this->container['metric']; + } + + /** + * Sets metric + * + * @param int $metric The metric usage report is linked to the metric for which the usage should be recorded. + * + * @return $this + */ + public function setMetric($metric) + { + $this->container['metric'] = $metric; + + return $this; + } + + + /** + * Gets subscription + * + * @return int + */ + public function getSubscription() + { + return $this->container['subscription']; + } + + /** + * Sets subscription + * + * @param int $subscription The subscription to which the usage is added to. + * + * @return $this + */ + public function setSubscription($subscription) + { + $this->container['subscription'] = $subscription; + + 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/wallee-sdk/lib/Model/SubscriptionPending.php b/wallee-sdk/lib/Model/SubscriptionPending.php index 77f9321..a7b588b 100644 --- a/wallee-sdk/lib/Model/SubscriptionPending.php +++ b/wallee-sdk/lib/Model/SubscriptionPending.php @@ -1,10 +1,8 @@ 'int', - 'reference' => 'string', - 'subscriber' => 'int', - 'token' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * - * - * @var int - */ - private $affiliate; - - /** - * - * - * @var string - */ - private $reference; - - /** - * - * - * @var int - */ - private $subscriber; - - /** - * - * - * @var int - */ - private $token; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['affiliate'])) { - $this->setAffiliate($data['affiliate']); - } - if (isset($data['reference'])) { - $this->setReference($data['reference']); - } - if (isset($data['subscriber'])) { - $this->setSubscriber($data['subscriber']); - } - if (isset($data['token'])) { - $this->setToken($data['token']); - } - } - - - /** - * Returns affiliate. - * - * - * - * @return int - */ - public function getAffiliate() { - return $this->affiliate; - } - - /** - * Sets affiliate. - * - * @param int $affiliate - * @return SubscriptionPending - */ - public function setAffiliate($affiliate) { - $this->affiliate = $affiliate; - - return $this; - } - - /** - * Returns reference. - * - * - * - * @return string - */ - public function getReference() { - return $this->reference; - } - - /** - * Sets reference. - * - * @param string $reference - * @return SubscriptionPending - */ - public function setReference($reference) { - $this->reference = $reference; - - return $this; - } - - /** - * Returns subscriber. - * - * - * - * @return int - */ - public function getSubscriber() { - return $this->subscriber; - } - - /** - * Sets subscriber. - * - * @param int $subscriber - * @return SubscriptionPending - */ - public function setSubscriber($subscriber) { - $this->subscriber = $subscriber; - - return $this; - } - - /** - * Returns token. - * - * - * - * @return int - */ - public function getToken() { - return $this->token; - } - - /** - * Sets token. - * - * @param int $token - * @return SubscriptionPending - */ - public function setToken($token) { - $this->token = $token; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionPending extends SubscriptionUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Subscription.Pending'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'reference' => 'string', + 'subscriber' => 'int', + 'token' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'reference' => null, + 'subscriber' => 'int64', + 'token' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'reference' => 'reference', + 'subscriber' => 'subscriber', + 'token' => 'token' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'reference' => 'setReference', + 'subscriber' => 'setSubscriber', + 'token' => 'setToken' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'reference' => 'getReference', + 'subscriber' => 'getSubscriber', + 'token' => 'getToken' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['reference'] = isset($data['reference']) ? $data['reference'] : null; + + $this->container['subscriber'] = isset($data['subscriber']) ? $data['subscriber'] : null; + + $this->container['token'] = isset($data['token']) ? $data['token'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference + * + * @return $this + */ + public function setReference($reference) + { + $this->container['reference'] = $reference; + + return $this; + } + + + /** + * Gets subscriber + * + * @return int + */ + public function getSubscriber() + { + return $this->container['subscriber']; + } + + /** + * Sets subscriber + * + * @param int $subscriber + * + * @return $this + */ + public function setSubscriber($subscriber) + { + $this->container['subscriber'] = $subscriber; + + return $this; + } + + + /** + * Gets token + * + * @return int + */ + public function getToken() + { + return $this->container['token']; + } + + /** + * Sets token + * + * @param int $token + * + * @return $this + */ + public function setToken($token) + { + $this->container['token'] = $token; + + 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/wallee-sdk/lib/Model/SubscriptionPeriodBill.php b/wallee-sdk/lib/Model/SubscriptionPeriodBill.php index 72d7478..3c09592 100644 --- a/wallee-sdk/lib/Model/SubscriptionPeriodBill.php +++ b/wallee-sdk/lib/Model/SubscriptionPeriodBill.php @@ -1,10 +1,8 @@ '\DateTime', - 'effectivePeriodEndDate' => '\DateTime', - 'id' => 'int', - 'language' => 'string', - 'linkedSpaceId' => 'int', - 'periodStartDate' => '\DateTime', - 'plannedPeriodEndDate' => '\DateTime', - 'plannedPurgeDate' => '\DateTime', - 'state' => '\Wallee\Sdk\Model\SubscriptionPeriodBillState', - 'subscriptionVersion' => '\Wallee\Sdk\Model\SubscriptionVersion', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \DateTime - */ - private $createdOn; - - /** - * - * - * @var \DateTime - */ - private $effectivePeriodEndDate; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var string - */ - private $language; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * - * - * @var \DateTime - */ - private $periodStartDate; - - /** - * - * - * @var \DateTime - */ - private $plannedPeriodEndDate; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionPeriodBillState - */ - private $state; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionVersion - */ - private $subscriptionVersion; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['subscriptionVersion'])) { - $this->setSubscriptionVersion($data['subscriptionVersion']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns createdOn. - * - * - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return SubscriptionPeriodBill - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns effectivePeriodEndDate. - * - * - * - * @return \DateTime - */ - public function getEffectivePeriodEndDate() { - return $this->effectivePeriodEndDate; - } - - /** - * Sets effectivePeriodEndDate. - * - * @param \DateTime $effectivePeriodEndDate - * @return SubscriptionPeriodBill - */ - protected function setEffectivePeriodEndDate($effectivePeriodEndDate) { - $this->effectivePeriodEndDate = $effectivePeriodEndDate; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionPeriodBill - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return SubscriptionPeriodBill - */ - protected function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return SubscriptionPeriodBill - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns periodStartDate. - * - * - * - * @return \DateTime - */ - public function getPeriodStartDate() { - return $this->periodStartDate; - } - - /** - * Sets periodStartDate. - * - * @param \DateTime $periodStartDate - * @return SubscriptionPeriodBill - */ - protected function setPeriodStartDate($periodStartDate) { - $this->periodStartDate = $periodStartDate; - - return $this; - } - - /** - * Returns plannedPeriodEndDate. - * - * - * - * @return \DateTime - */ - public function getPlannedPeriodEndDate() { - return $this->plannedPeriodEndDate; - } - - /** - * Sets plannedPeriodEndDate. - * - * @param \DateTime $plannedPeriodEndDate - * @return SubscriptionPeriodBill - */ - protected function setPlannedPeriodEndDate($plannedPeriodEndDate) { - $this->plannedPeriodEndDate = $plannedPeriodEndDate; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return SubscriptionPeriodBill - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionPeriodBillState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\SubscriptionPeriodBillState $state - * @return SubscriptionPeriodBill - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns subscriptionVersion. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionVersion - */ - public function getSubscriptionVersion() { - return $this->subscriptionVersion; - } - - /** - * Sets subscriptionVersion. - * - * @param \Wallee\Sdk\Model\SubscriptionVersion $subscriptionVersion - * @return SubscriptionPeriodBill - */ - public function setSubscriptionVersion($subscriptionVersion) { - $this->subscriptionVersion = $subscriptionVersion; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriptionPeriodBill - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionPeriodBill implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionPeriodBill'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'created_on' => '\DateTime', + 'effective_period_end_date' => '\DateTime', + 'id' => 'int', + 'language' => 'string', + 'linked_space_id' => 'int', + 'period_start_date' => '\DateTime', + 'planned_period_end_date' => '\DateTime', + 'planned_purge_date' => '\DateTime', + 'state' => '\Wallee\Sdk\Model\SubscriptionPeriodBillState', + 'subscription_version' => '\Wallee\Sdk\Model\SubscriptionVersion', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'created_on' => 'date-time', + 'effective_period_end_date' => 'date-time', + 'id' => 'int64', + 'language' => null, + 'linked_space_id' => 'int64', + 'period_start_date' => 'date-time', + 'planned_period_end_date' => 'date-time', + 'planned_purge_date' => 'date-time', + 'state' => null, + 'subscription_version' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'created_on' => 'createdOn', + 'effective_period_end_date' => 'effectivePeriodEndDate', + 'id' => 'id', + 'language' => 'language', + 'linked_space_id' => 'linkedSpaceId', + 'period_start_date' => 'periodStartDate', + 'planned_period_end_date' => 'plannedPeriodEndDate', + 'planned_purge_date' => 'plannedPurgeDate', + 'state' => 'state', + 'subscription_version' => 'subscriptionVersion', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'created_on' => 'setCreatedOn', + 'effective_period_end_date' => 'setEffectivePeriodEndDate', + 'id' => 'setId', + 'language' => 'setLanguage', + 'linked_space_id' => 'setLinkedSpaceId', + 'period_start_date' => 'setPeriodStartDate', + 'planned_period_end_date' => 'setPlannedPeriodEndDate', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'state' => 'setState', + 'subscription_version' => 'setSubscriptionVersion', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'created_on' => 'getCreatedOn', + 'effective_period_end_date' => 'getEffectivePeriodEndDate', + 'id' => 'getId', + 'language' => 'getLanguage', + 'linked_space_id' => 'getLinkedSpaceId', + 'period_start_date' => 'getPeriodStartDate', + 'planned_period_end_date' => 'getPlannedPeriodEndDate', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'state' => 'getState', + 'subscription_version' => 'getSubscriptionVersion', + 'version' => 'getVersion' + ]; + + + + /** + * 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['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['effective_period_end_date'] = isset($data['effective_period_end_date']) ? $data['effective_period_end_date'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['period_start_date'] = isset($data['period_start_date']) ? $data['period_start_date'] : null; + + $this->container['planned_period_end_date'] = isset($data['planned_period_end_date']) ? $data['planned_period_end_date'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['subscription_version'] = isset($data['subscription_version']) ? $data['subscription_version'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets effective_period_end_date + * + * @return \DateTime + */ + public function getEffectivePeriodEndDate() + { + return $this->container['effective_period_end_date']; + } + + /** + * Sets effective_period_end_date + * + * @param \DateTime $effective_period_end_date + * + * @return $this + */ + public function setEffectivePeriodEndDate($effective_period_end_date) + { + $this->container['effective_period_end_date'] = $effective_period_end_date; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets period_start_date + * + * @return \DateTime + */ + public function getPeriodStartDate() + { + return $this->container['period_start_date']; + } + + /** + * Sets period_start_date + * + * @param \DateTime $period_start_date + * + * @return $this + */ + public function setPeriodStartDate($period_start_date) + { + $this->container['period_start_date'] = $period_start_date; + + return $this; + } + + + /** + * Gets planned_period_end_date + * + * @return \DateTime + */ + public function getPlannedPeriodEndDate() + { + return $this->container['planned_period_end_date']; + } + + /** + * Sets planned_period_end_date + * + * @param \DateTime $planned_period_end_date + * + * @return $this + */ + public function setPlannedPeriodEndDate($planned_period_end_date) + { + $this->container['planned_period_end_date'] = $planned_period_end_date; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\SubscriptionPeriodBillState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\SubscriptionPeriodBillState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets subscription_version + * + * @return \Wallee\Sdk\Model\SubscriptionVersion + */ + public function getSubscriptionVersion() + { + return $this->container['subscription_version']; + } + + /** + * Sets subscription_version + * + * @param \Wallee\Sdk\Model\SubscriptionVersion $subscription_version + * + * @return $this + */ + public function setSubscriptionVersion($subscription_version) + { + $this->container['subscription_version'] = $subscription_version; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/SubscriptionPeriodBillState.php b/wallee-sdk/lib/Model/SubscriptionPeriodBillState.php index a18cedb..62431f0 100644 --- a/wallee-sdk/lib/Model/SubscriptionPeriodBillState.php +++ b/wallee-sdk/lib/Model/SubscriptionPeriodBillState.php @@ -1,10 +1,8 @@ 'int[]', - 'failedPaymentSuspensionPeriod' => 'string', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'name' => 'string', - 'plannedPurgeDate' => '\DateTime', - 'reference' => 'string', - 'sortOrder' => 'int', - 'spaceId' => 'int', - 'state' => '\Wallee\Sdk\Model\SubscriptionProductState', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The allowed payment method configurations control which payment methods can be used with this product. When none is selected all methods will be allowed. - * - * @var int[] - */ - private $allowedPaymentMethodConfigurations; - - /** - * When a payment fails, the subscription to which the payment belongs to will be suspended. When the suspension is not removed within the specified period the subscription will be terminated. A payment is considered as failed when the subscriber issues a refund or when a subscription charge fails. - * - * @var string - */ - private $failedPaymentSuspensionPeriod; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The product name is used internally to identify the configuration in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * The product reference identifies the product for external systems. This field may contain the product's SKU. - * - * @var string - */ - private $reference; - - /** - * The sort order controls in which order the product is listed. The sort order is used to order the products in ascending order. - * - * @var int - */ - private $sortOrder; - - /** - * - * - * @var int - */ - private $spaceId; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionProductState - */ - private $state; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['allowedPaymentMethodConfigurations'])) { - $this->setAllowedPaymentMethodConfigurations($data['allowedPaymentMethodConfigurations']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns allowedPaymentMethodConfigurations. - * - * The allowed payment method configurations control which payment methods can be used with this product. When none is selected all methods will be allowed. - * - * @return int[] - */ - public function getAllowedPaymentMethodConfigurations() { - return $this->allowedPaymentMethodConfigurations; - } - - /** - * Sets allowedPaymentMethodConfigurations. - * - * @param int[] $allowedPaymentMethodConfigurations - * @return SubscriptionProduct - */ - public function setAllowedPaymentMethodConfigurations($allowedPaymentMethodConfigurations) { - $this->allowedPaymentMethodConfigurations = $allowedPaymentMethodConfigurations; - - return $this; - } - - /** - * Returns failedPaymentSuspensionPeriod. - * - * When a payment fails, the subscription to which the payment belongs to will be suspended. When the suspension is not removed within the specified period the subscription will be terminated. A payment is considered as failed when the subscriber issues a refund or when a subscription charge fails. - * - * @return string - */ - public function getFailedPaymentSuspensionPeriod() { - return $this->failedPaymentSuspensionPeriod; - } - - /** - * Sets failedPaymentSuspensionPeriod. - * - * @param string $failedPaymentSuspensionPeriod - * @return SubscriptionProduct - */ - protected function setFailedPaymentSuspensionPeriod($failedPaymentSuspensionPeriod) { - $this->failedPaymentSuspensionPeriod = $failedPaymentSuspensionPeriod; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionProduct - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return SubscriptionProduct - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * The product name is used internally to identify the configuration in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return SubscriptionProduct - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return SubscriptionProduct - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns reference. - * - * The product reference identifies the product for external systems. This field may contain the product's SKU. - * - * @return string - */ - public function getReference() { - return $this->reference; - } - - /** - * Sets reference. - * - * @param string $reference - * @return SubscriptionProduct - */ - protected function setReference($reference) { - $this->reference = $reference; - - return $this; - } - - /** - * Returns sortOrder. - * - * The sort order controls in which order the product is listed. The sort order is used to order the products in ascending order. - * - * @return int - */ - public function getSortOrder() { - return $this->sortOrder; - } - - /** - * Sets sortOrder. - * - * @param int $sortOrder - * @return SubscriptionProduct - */ - protected function setSortOrder($sortOrder) { - $this->sortOrder = $sortOrder; - - return $this; - } - - /** - * Returns spaceId. - * - * - * - * @return int - */ - public function getSpaceId() { - return $this->spaceId; - } - - /** - * Sets spaceId. - * - * @param int $spaceId - * @return SubscriptionProduct - */ - protected function setSpaceId($spaceId) { - $this->spaceId = $spaceId; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionProductState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\SubscriptionProductState $state - * @return SubscriptionProduct - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriptionProduct - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionProduct implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionProduct'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'allowed_payment_method_configurations' => 'int[]', + 'failed_payment_suspension_period' => 'string', + 'id' => 'int', + 'linked_space_id' => 'int', + 'name' => 'string', + 'planned_purge_date' => '\DateTime', + 'reference' => 'string', + 'sort_order' => 'int', + 'space_id' => 'int', + 'state' => '\Wallee\Sdk\Model\SubscriptionProductState', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'allowed_payment_method_configurations' => 'int64', + 'failed_payment_suspension_period' => null, + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'name' => null, + 'planned_purge_date' => 'date-time', + 'reference' => null, + 'sort_order' => 'int32', + 'space_id' => 'int64', + 'state' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'allowed_payment_method_configurations' => 'allowedPaymentMethodConfigurations', + 'failed_payment_suspension_period' => 'failedPaymentSuspensionPeriod', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'planned_purge_date' => 'plannedPurgeDate', + 'reference' => 'reference', + 'sort_order' => 'sortOrder', + 'space_id' => 'spaceId', + 'state' => 'state', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'allowed_payment_method_configurations' => 'setAllowedPaymentMethodConfigurations', + 'failed_payment_suspension_period' => 'setFailedPaymentSuspensionPeriod', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'reference' => 'setReference', + 'sort_order' => 'setSortOrder', + 'space_id' => 'setSpaceId', + 'state' => 'setState', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'allowed_payment_method_configurations' => 'getAllowedPaymentMethodConfigurations', + 'failed_payment_suspension_period' => 'getFailedPaymentSuspensionPeriod', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'reference' => 'getReference', + 'sort_order' => 'getSortOrder', + 'space_id' => 'getSpaceId', + 'state' => 'getState', + 'version' => 'getVersion' + ]; + + + + /** + * 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['allowed_payment_method_configurations'] = isset($data['allowed_payment_method_configurations']) ? $data['allowed_payment_method_configurations'] : null; + + $this->container['failed_payment_suspension_period'] = isset($data['failed_payment_suspension_period']) ? $data['failed_payment_suspension_period'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['reference'] = isset($data['reference']) ? $data['reference'] : null; + + $this->container['sort_order'] = isset($data['sort_order']) ? $data['sort_order'] : null; + + $this->container['space_id'] = isset($data['space_id']) ? $data['space_id'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 allowed_payment_method_configurations + * + * @return int[] + */ + public function getAllowedPaymentMethodConfigurations() + { + return $this->container['allowed_payment_method_configurations']; + } + + /** + * Sets allowed_payment_method_configurations + * + * @param int[] $allowed_payment_method_configurations The allowed payment method configurations control which payment methods can be used with this product. When none is selected all methods will be allowed. + * + * @return $this + */ + public function setAllowedPaymentMethodConfigurations($allowed_payment_method_configurations) + { + $this->container['allowed_payment_method_configurations'] = $allowed_payment_method_configurations; + + return $this; + } + + + /** + * Gets failed_payment_suspension_period + * + * @return string + */ + public function getFailedPaymentSuspensionPeriod() + { + return $this->container['failed_payment_suspension_period']; + } + + /** + * Sets failed_payment_suspension_period + * + * @param string $failed_payment_suspension_period When a payment fails, the subscription to which the payment belongs to will be suspended. When the suspension is not removed within the specified period the subscription will be terminated. A payment is considered as failed when the subscriber issues a refund or when a subscription charge fails. + * + * @return $this + */ + public function setFailedPaymentSuspensionPeriod($failed_payment_suspension_period) + { + $this->container['failed_payment_suspension_period'] = $failed_payment_suspension_period; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The product name is used internally to identify the configuration in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference The product reference identifies the product for external systems. This field may contain the product's SKU. + * + * @return $this + */ + public function setReference($reference) + { + $this->container['reference'] = $reference; + + return $this; + } + + + /** + * Gets sort_order + * + * @return int + */ + public function getSortOrder() + { + return $this->container['sort_order']; + } + + /** + * Sets sort_order + * + * @param int $sort_order The sort order controls in which order the product is listed. The sort order is used to order the products in ascending order. + * + * @return $this + */ + public function setSortOrder($sort_order) + { + $this->container['sort_order'] = $sort_order; + + return $this; + } + + + /** + * Gets space_id + * + * @return int + */ + public function getSpaceId() + { + return $this->container['space_id']; + } + + /** + * Sets space_id + * + * @param int $space_id + * + * @return $this + */ + public function setSpaceId($space_id) + { + $this->container['space_id'] = $space_id; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\SubscriptionProductState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\SubscriptionProductState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/SubscriptionProductActive.php b/wallee-sdk/lib/Model/SubscriptionProductActive.php index d125b1d..c43833f 100644 --- a/wallee-sdk/lib/Model/SubscriptionProductActive.php +++ b/wallee-sdk/lib/Model/SubscriptionProductActive.php @@ -1,10 +1,8 @@ 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionProductActive - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriptionProductActive - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - if ($this->getId() === null) { - throw new ValidationException("'id' can't be null", 'id', $this); - } - if ($this->getVersion() === null) { - throw new ValidationException("'version' can't be null", 'version', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class SubscriptionProductActive extends AbstractSubscriptionProductActive +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionProduct.Active'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/SubscriptionProductComponent.php b/wallee-sdk/lib/Model/SubscriptionProductComponent.php index 80d00f3..99e6d16 100644 --- a/wallee-sdk/lib/Model/SubscriptionProductComponent.php +++ b/wallee-sdk/lib/Model/SubscriptionProductComponent.php @@ -1,10 +1,8 @@ 'int', - 'componentGroup' => '\Wallee\Sdk\Model\SubscriptionProductComponentGroup', - 'defaultComponent' => 'bool', - 'description' => '\Wallee\Sdk\Model\DatabaseTranslatedString', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedString', - 'reference' => '\Wallee\Sdk\Model\SubscriptionProductComponentReference', - 'sortOrder' => 'int', - 'taxClass' => '\Wallee\Sdk\Model\TaxClass', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The change weight determines whether if a component change is considered as upgrade or downgrade. If product component with a weight 10 is changed to a product component with a weight 20, the change is considered as upgrade. On the other hand a change from 20 to 10 is considered as a downgrade. - * - * @var int - */ - private $componentChangeWeight; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionProductComponentGroup - */ - private $componentGroup; - - /** - * When a component is marked as a 'default' component it is used when no other component is selected by the user. - * - * @var bool - */ - private $defaultComponent; - - /** - * The component description may contain a longer description which gives the subscriber a better understanding of what the component contains. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedString - */ - private $description; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The component name is shown to the subscriber. It should describe in few words what the component does contain. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedString - */ - private $name; - - /** - * The component reference is used to identify the component by external systems and it marks components to represent the same component within different product versions. - * - * @var \Wallee\Sdk\Model\SubscriptionProductComponentReference - */ - private $reference; - - /** - * The sort order controls in which order the component is listed. The sort order is used to order the components in ascending order. - * - * @var int - */ - private $sortOrder; - - /** - * The tax class of the component determines the taxes which are applicable on all fees linked with the component. - * - * @var \Wallee\Sdk\Model\TaxClass - */ - private $taxClass; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['componentGroup'])) { - $this->setComponentGroup($data['componentGroup']); - } - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['reference'])) { - $this->setReference($data['reference']); - } - if (isset($data['taxClass'])) { - $this->setTaxClass($data['taxClass']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns componentChangeWeight. - * - * The change weight determines whether if a component change is considered as upgrade or downgrade. If product component with a weight 10 is changed to a product component with a weight 20, the change is considered as upgrade. On the other hand a change from 20 to 10 is considered as a downgrade. - * - * @return int - */ - public function getComponentChangeWeight() { - return $this->componentChangeWeight; - } - - /** - * Sets componentChangeWeight. - * - * @param int $componentChangeWeight - * @return SubscriptionProductComponent - */ - protected function setComponentChangeWeight($componentChangeWeight) { - $this->componentChangeWeight = $componentChangeWeight; - - return $this; - } - - /** - * Returns componentGroup. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionProductComponentGroup - */ - public function getComponentGroup() { - return $this->componentGroup; - } - - /** - * Sets componentGroup. - * - * @param \Wallee\Sdk\Model\SubscriptionProductComponentGroup $componentGroup - * @return SubscriptionProductComponent - */ - public function setComponentGroup($componentGroup) { - $this->componentGroup = $componentGroup; - - return $this; - } - - /** - * Returns defaultComponent. - * - * When a component is marked as a 'default' component it is used when no other component is selected by the user. - * - * @return bool - */ - public function getDefaultComponent() { - return $this->defaultComponent; - } - - /** - * Sets defaultComponent. - * - * @param bool $defaultComponent - * @return SubscriptionProductComponent - */ - protected function setDefaultComponent($defaultComponent) { - $this->defaultComponent = $defaultComponent; - - return $this; - } - - /** - * Returns description. - * - * The component description may contain a longer description which gives the subscriber a better understanding of what the component contains. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedString - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedString $description - * @return SubscriptionProductComponent - */ - public function setDescription($description) { - $this->description = $description; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionProductComponent - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return SubscriptionProductComponent - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * The component name is shown to the subscriber. It should describe in few words what the component does contain. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedString - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedString $name - * @return SubscriptionProductComponent - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns reference. - * - * The component reference is used to identify the component by external systems and it marks components to represent the same component within different product versions. - * - * @return \Wallee\Sdk\Model\SubscriptionProductComponentReference - */ - public function getReference() { - return $this->reference; - } - - /** - * Sets reference. - * - * @param \Wallee\Sdk\Model\SubscriptionProductComponentReference $reference - * @return SubscriptionProductComponent - */ - public function setReference($reference) { - $this->reference = $reference; - - return $this; - } - - /** - * Returns sortOrder. - * - * The sort order controls in which order the component is listed. The sort order is used to order the components in ascending order. - * - * @return int - */ - public function getSortOrder() { - return $this->sortOrder; - } - - /** - * Sets sortOrder. - * - * @param int $sortOrder - * @return SubscriptionProductComponent - */ - protected function setSortOrder($sortOrder) { - $this->sortOrder = $sortOrder; - - return $this; - } - - /** - * Returns taxClass. - * - * The tax class of the component determines the taxes which are applicable on all fees linked with the component. - * - * @return \Wallee\Sdk\Model\TaxClass - */ - public function getTaxClass() { - return $this->taxClass; - } - - /** - * Sets taxClass. - * - * @param \Wallee\Sdk\Model\TaxClass $taxClass - * @return SubscriptionProductComponent - */ - public function setTaxClass($taxClass) { - $this->taxClass = $taxClass; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriptionProductComponent - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionProductComponent implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionProductComponent'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'component_change_weight' => 'int', + 'component_group' => '\Wallee\Sdk\Model\SubscriptionProductComponentGroup', + 'default_component' => 'bool', + 'description' => '\Wallee\Sdk\Model\DatabaseTranslatedString', + 'id' => 'int', + 'linked_space_id' => 'int', + 'maximal_quantity' => 'float', + 'minimal_quantity' => 'float', + 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedString', + 'quantity_step' => 'float', + 'reference' => '\Wallee\Sdk\Model\SubscriptionProductComponentReference', + 'sort_order' => 'int', + 'tax_class' => '\Wallee\Sdk\Model\TaxClass', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'component_change_weight' => 'int32', + 'component_group' => null, + 'default_component' => null, + 'description' => null, + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'maximal_quantity' => null, + 'minimal_quantity' => null, + 'name' => null, + 'quantity_step' => null, + 'reference' => null, + 'sort_order' => 'int32', + 'tax_class' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'component_change_weight' => 'componentChangeWeight', + 'component_group' => 'componentGroup', + 'default_component' => 'defaultComponent', + 'description' => 'description', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'maximal_quantity' => 'maximalQuantity', + 'minimal_quantity' => 'minimalQuantity', + 'name' => 'name', + 'quantity_step' => 'quantityStep', + 'reference' => 'reference', + 'sort_order' => 'sortOrder', + 'tax_class' => 'taxClass', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'component_change_weight' => 'setComponentChangeWeight', + 'component_group' => 'setComponentGroup', + 'default_component' => 'setDefaultComponent', + 'description' => 'setDescription', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'maximal_quantity' => 'setMaximalQuantity', + 'minimal_quantity' => 'setMinimalQuantity', + 'name' => 'setName', + 'quantity_step' => 'setQuantityStep', + 'reference' => 'setReference', + 'sort_order' => 'setSortOrder', + 'tax_class' => 'setTaxClass', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'component_change_weight' => 'getComponentChangeWeight', + 'component_group' => 'getComponentGroup', + 'default_component' => 'getDefaultComponent', + 'description' => 'getDescription', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'maximal_quantity' => 'getMaximalQuantity', + 'minimal_quantity' => 'getMinimalQuantity', + 'name' => 'getName', + 'quantity_step' => 'getQuantityStep', + 'reference' => 'getReference', + 'sort_order' => 'getSortOrder', + 'tax_class' => 'getTaxClass', + 'version' => 'getVersion' + ]; + + + + /** + * 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['component_change_weight'] = isset($data['component_change_weight']) ? $data['component_change_weight'] : null; + + $this->container['component_group'] = isset($data['component_group']) ? $data['component_group'] : null; + + $this->container['default_component'] = isset($data['default_component']) ? $data['default_component'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['maximal_quantity'] = isset($data['maximal_quantity']) ? $data['maximal_quantity'] : null; + + $this->container['minimal_quantity'] = isset($data['minimal_quantity']) ? $data['minimal_quantity'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['quantity_step'] = isset($data['quantity_step']) ? $data['quantity_step'] : null; + + $this->container['reference'] = isset($data['reference']) ? $data['reference'] : null; + + $this->container['sort_order'] = isset($data['sort_order']) ? $data['sort_order'] : null; + + $this->container['tax_class'] = isset($data['tax_class']) ? $data['tax_class'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 component_change_weight + * + * @return int + */ + public function getComponentChangeWeight() + { + return $this->container['component_change_weight']; + } + + /** + * Sets component_change_weight + * + * @param int $component_change_weight The change weight determines whether if a component change is considered as upgrade or downgrade. If product component with a weight 10 is changed to a product component with a weight 20, the change is considered as upgrade. On the other hand a change from 20 to 10 is considered as a downgrade. + * + * @return $this + */ + public function setComponentChangeWeight($component_change_weight) + { + $this->container['component_change_weight'] = $component_change_weight; + + return $this; + } + + + /** + * Gets component_group + * + * @return \Wallee\Sdk\Model\SubscriptionProductComponentGroup + */ + public function getComponentGroup() + { + return $this->container['component_group']; + } + + /** + * Sets component_group + * + * @param \Wallee\Sdk\Model\SubscriptionProductComponentGroup $component_group + * + * @return $this + */ + public function setComponentGroup($component_group) + { + $this->container['component_group'] = $component_group; + + return $this; + } + + + /** + * Gets default_component + * + * @return bool + */ + public function getDefaultComponent() + { + return $this->container['default_component']; + } + + /** + * Sets default_component + * + * @param bool $default_component When a component is marked as a 'default' component it is used when no other component is selected by the user. + * + * @return $this + */ + public function setDefaultComponent($default_component) + { + $this->container['default_component'] = $default_component; + + return $this; + } + + + /** + * Gets description + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedString + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedString $description The component description may contain a longer description which gives the subscriber a better understanding of what the component contains. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets maximal_quantity + * + * @return float + */ + public function getMaximalQuantity() + { + return $this->container['maximal_quantity']; + } + + /** + * Sets maximal_quantity + * + * @param float $maximal_quantity The maximum quantity defines the maximum value which must be entered for the quantity. + * + * @return $this + */ + public function setMaximalQuantity($maximal_quantity) + { + $this->container['maximal_quantity'] = $maximal_quantity; + + return $this; + } + + + /** + * Gets minimal_quantity + * + * @return float + */ + public function getMinimalQuantity() + { + return $this->container['minimal_quantity']; + } + + /** + * Sets minimal_quantity + * + * @param float $minimal_quantity The minimal quantity defines the minimum value which must be entered for the quantity. + * + * @return $this + */ + public function setMinimalQuantity($minimal_quantity) + { + $this->container['minimal_quantity'] = $minimal_quantity; + + return $this; + } + + + /** + * Gets name + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedString + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedString $name The component name is shown to the subscriber. It should describe in few words what the component does contain. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets quantity_step + * + * @return float + */ + public function getQuantityStep() + { + return $this->container['quantity_step']; + } + + /** + * Sets quantity_step + * + * @param float $quantity_step The quantity step defines at which interval the quantity can be increased. + * + * @return $this + */ + public function setQuantityStep($quantity_step) + { + $this->container['quantity_step'] = $quantity_step; + + return $this; + } + + + /** + * Gets reference + * + * @return \Wallee\Sdk\Model\SubscriptionProductComponentReference + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param \Wallee\Sdk\Model\SubscriptionProductComponentReference $reference The component reference is used to identify the component by external systems and it marks components to represent the same component within different product versions. + * + * @return $this + */ + public function setReference($reference) + { + $this->container['reference'] = $reference; + + return $this; + } + + + /** + * Gets sort_order + * + * @return int + */ + public function getSortOrder() + { + return $this->container['sort_order']; + } + + /** + * Sets sort_order + * + * @param int $sort_order The sort order controls in which order the component is listed. The sort order is used to order the components in ascending order. + * + * @return $this + */ + public function setSortOrder($sort_order) + { + $this->container['sort_order'] = $sort_order; + + return $this; + } + + + /** + * Gets tax_class + * + * @return \Wallee\Sdk\Model\TaxClass + */ + public function getTaxClass() + { + return $this->container['tax_class']; + } + + /** + * Sets tax_class + * + * @param \Wallee\Sdk\Model\TaxClass $tax_class The tax class of the component determines the taxes which are applicable on all fees linked with the component. + * + * @return $this + */ + public function setTaxClass($tax_class) + { + $this->container['tax_class'] = $tax_class; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/SubscriptionProductComponentGroup.php b/wallee-sdk/lib/Model/SubscriptionProductComponentGroup.php index 470e273..698c5c1 100644 --- a/wallee-sdk/lib/Model/SubscriptionProductComponentGroup.php +++ b/wallee-sdk/lib/Model/SubscriptionProductComponentGroup.php @@ -1,10 +1,8 @@ 'int', - 'linkedSpaceId' => 'int', - 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedString', - 'optional' => 'bool', - 'productVersion' => '\Wallee\Sdk\Model\SubscriptionProductVersion', - 'sortOrder' => 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The component group name will be shown when the components are selected. This can be visible to the subscriber. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedString - */ - private $name; - - /** - * The component group can be optional. This means no component has to be selected by the subscriber. - * - * @var bool - */ - private $optional; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionProductVersion - */ - private $productVersion; - - /** - * The sort order controls in which order the component group is listed. The sort order is used to order the component groups in ascending order. - * - * @var int - */ - private $sortOrder; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['productVersion'])) { - $this->setProductVersion($data['productVersion']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionProductComponentGroup - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return SubscriptionProductComponentGroup - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * The component group name will be shown when the components are selected. This can be visible to the subscriber. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedString - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedString $name - * @return SubscriptionProductComponentGroup - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns optional. - * - * The component group can be optional. This means no component has to be selected by the subscriber. - * - * @return bool - */ - public function getOptional() { - return $this->optional; - } - - /** - * Sets optional. - * - * @param bool $optional - * @return SubscriptionProductComponentGroup - */ - protected function setOptional($optional) { - $this->optional = $optional; - - return $this; - } - - /** - * Returns productVersion. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionProductVersion - */ - public function getProductVersion() { - return $this->productVersion; - } - - /** - * Sets productVersion. - * - * @param \Wallee\Sdk\Model\SubscriptionProductVersion $productVersion - * @return SubscriptionProductComponentGroup - */ - public function setProductVersion($productVersion) { - $this->productVersion = $productVersion; - - return $this; - } - - /** - * Returns sortOrder. - * - * The sort order controls in which order the component group is listed. The sort order is used to order the component groups in ascending order. - * - * @return int - */ - public function getSortOrder() { - return $this->sortOrder; - } - - /** - * Sets sortOrder. - * - * @param int $sortOrder - * @return SubscriptionProductComponentGroup - */ - protected function setSortOrder($sortOrder) { - $this->sortOrder = $sortOrder; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriptionProductComponentGroup - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionProductComponentGroup implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionProductComponentGroup'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'linked_space_id' => 'int', + 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedString', + 'optional' => 'bool', + 'product_version' => '\Wallee\Sdk\Model\SubscriptionProductVersion', + 'sort_order' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'name' => null, + 'optional' => null, + 'product_version' => null, + 'sort_order' => 'int32', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'optional' => 'optional', + 'product_version' => 'productVersion', + 'sort_order' => 'sortOrder', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'optional' => 'setOptional', + 'product_version' => 'setProductVersion', + 'sort_order' => 'setSortOrder', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'optional' => 'getOptional', + 'product_version' => 'getProductVersion', + 'sort_order' => 'getSortOrder', + 'version' => 'getVersion' + ]; + + + + /** + * 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['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['optional'] = isset($data['optional']) ? $data['optional'] : null; + + $this->container['product_version'] = isset($data['product_version']) ? $data['product_version'] : null; + + $this->container['sort_order'] = isset($data['sort_order']) ? $data['sort_order'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedString + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedString $name The component group name will be shown when the components are selected. This can be visible to the subscriber. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets optional + * + * @return bool + */ + public function getOptional() + { + return $this->container['optional']; + } + + /** + * Sets optional + * + * @param bool $optional The component group can be optional. This means no component has to be selected by the subscriber. + * + * @return $this + */ + public function setOptional($optional) + { + $this->container['optional'] = $optional; + + return $this; + } + + + /** + * Gets product_version + * + * @return \Wallee\Sdk\Model\SubscriptionProductVersion + */ + public function getProductVersion() + { + return $this->container['product_version']; + } + + /** + * Sets product_version + * + * @param \Wallee\Sdk\Model\SubscriptionProductVersion $product_version + * + * @return $this + */ + public function setProductVersion($product_version) + { + $this->container['product_version'] = $product_version; + + return $this; + } + + + /** + * Gets sort_order + * + * @return int + */ + public function getSortOrder() + { + return $this->container['sort_order']; + } + + /** + * Sets sort_order + * + * @param int $sort_order The sort order controls in which order the component group is listed. The sort order is used to order the component groups in ascending order. + * + * @return $this + */ + public function setSortOrder($sort_order) + { + $this->container['sort_order'] = $sort_order; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/SubscriptionProductComponentGroupUpdate.php b/wallee-sdk/lib/Model/SubscriptionProductComponentGroupUpdate.php index 04778f4..369082e 100644 --- a/wallee-sdk/lib/Model/SubscriptionProductComponentGroupUpdate.php +++ b/wallee-sdk/lib/Model/SubscriptionProductComponentGroupUpdate.php @@ -1,10 +1,8 @@ 'int', - 'version' => 'int', - 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', - 'optional' => 'bool', - 'productVersion' => 'int', - 'sortOrder' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - /** - * The component group name will be shown when the components are selected. This can be visible to the subscriber. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - private $name; - - /** - * The component group can be optional. This means no component has to be selected by the subscriber. - * - * @var bool - */ - private $optional; - - /** - * - * - * @var int - */ - private $productVersion; - - /** - * The sort order controls in which order the component group is listed. The sort order is used to order the component groups in ascending order. - * - * @var int - */ - private $sortOrder; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['optional'])) { - $this->setOptional($data['optional']); - } - if (isset($data['productVersion'])) { - $this->setProductVersion($data['productVersion']); - } - if (isset($data['sortOrder'])) { - $this->setSortOrder($data['sortOrder']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionProductComponentGroupUpdate - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriptionProductComponentGroupUpdate - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Returns name. - * - * The component group name will be shown when the components are selected. This can be visible to the subscriber. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $name - * @return SubscriptionProductComponentGroupUpdate - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns optional. - * - * The component group can be optional. This means no component has to be selected by the subscriber. - * - * @return bool - */ - public function getOptional() { - return $this->optional; - } - - /** - * Sets optional. - * - * @param bool $optional - * @return SubscriptionProductComponentGroupUpdate - */ - public function setOptional($optional) { - $this->optional = $optional; - - return $this; - } - - /** - * Returns productVersion. - * - * - * - * @return int - */ - public function getProductVersion() { - return $this->productVersion; - } - - /** - * Sets productVersion. - * - * @param int $productVersion - * @return SubscriptionProductComponentGroupUpdate - */ - public function setProductVersion($productVersion) { - $this->productVersion = $productVersion; - - return $this; - } - - /** - * Returns sortOrder. - * - * The sort order controls in which order the component group is listed. The sort order is used to order the component groups in ascending order. - * - * @return int - */ - public function getSortOrder() { - return $this->sortOrder; - } - - /** - * Sets sortOrder. - * - * @param int $sortOrder - * @return SubscriptionProductComponentGroupUpdate - */ - public function setSortOrder($sortOrder) { - $this->sortOrder = $sortOrder; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getId() === null) { - throw new ValidationException("'id' can't be null", 'id', $this); - } - if ($this->getVersion() === null) { - throw new ValidationException("'version' can't be null", 'version', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionProductComponentGroupUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionProductComponentGroup.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'version' => 'int', + 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', + 'optional' => 'bool', + 'product_version' => 'int', + 'sort_order' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64', + 'name' => null, + 'optional' => null, + 'product_version' => 'int64', + 'sort_order' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version', + 'name' => 'name', + 'optional' => 'optional', + 'product_version' => 'productVersion', + 'sort_order' => 'sortOrder' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion', + 'name' => 'setName', + 'optional' => 'setOptional', + 'product_version' => 'setProductVersion', + 'sort_order' => 'setSortOrder' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion', + 'name' => 'getName', + 'optional' => 'getOptional', + 'product_version' => 'getProductVersion', + 'sort_order' => 'getSortOrder' + ]; + + + + /** + * 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['version'] = isset($data['version']) ? $data['version'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['optional'] = isset($data['optional']) ? $data['optional'] : null; + + $this->container['product_version'] = isset($data['product_version']) ? $data['product_version'] : null; + + $this->container['sort_order'] = isset($data['sort_order']) ? $data['sort_order'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + + /** + * Gets name + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $name The component group name will be shown when the components are selected. This can be visible to the subscriber. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets optional + * + * @return bool + */ + public function getOptional() + { + return $this->container['optional']; + } + + /** + * Sets optional + * + * @param bool $optional The component group can be optional. This means no component has to be selected by the subscriber. + * + * @return $this + */ + public function setOptional($optional) + { + $this->container['optional'] = $optional; + + return $this; + } + + + /** + * Gets product_version + * + * @return int + */ + public function getProductVersion() + { + return $this->container['product_version']; + } + + /** + * Sets product_version + * + * @param int $product_version + * + * @return $this + */ + public function setProductVersion($product_version) + { + $this->container['product_version'] = $product_version; + + return $this; + } + + + /** + * Gets sort_order + * + * @return int + */ + public function getSortOrder() + { + return $this->container['sort_order']; + } + + /** + * Sets sort_order + * + * @param int $sort_order The sort order controls in which order the component group is listed. The sort order is used to order the component groups in ascending order. + * + * @return $this + */ + public function setSortOrder($sort_order) + { + $this->container['sort_order'] = $sort_order; + + 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/wallee-sdk/lib/Model/SubscriptionProductComponentReference.php b/wallee-sdk/lib/Model/SubscriptionProductComponentReference.php index 262d2a6..39f9493 100644 --- a/wallee-sdk/lib/Model/SubscriptionProductComponentReference.php +++ b/wallee-sdk/lib/Model/SubscriptionProductComponentReference.php @@ -1,10 +1,8 @@ 'int', - 'linkedSpaceId' => 'int', - 'name' => 'string', - 'plannedPurgeDate' => '\DateTime', - 'spaceId' => 'int', - 'state' => '\Wallee\Sdk\Model\SubscriptionProductComponentReferenceState', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The component reference name is used internally to identify the reference. For example the name is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var int - */ - private $spaceId; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionProductComponentReferenceState - */ - private $state; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionProductComponentReference - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return SubscriptionProductComponentReference - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * The component reference name is used internally to identify the reference. For example the name is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return SubscriptionProductComponentReference - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return SubscriptionProductComponentReference - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns spaceId. - * - * - * - * @return int - */ - public function getSpaceId() { - return $this->spaceId; - } - - /** - * Sets spaceId. - * - * @param int $spaceId - * @return SubscriptionProductComponentReference - */ - protected function setSpaceId($spaceId) { - $this->spaceId = $spaceId; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionProductComponentReferenceState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\SubscriptionProductComponentReferenceState $state - * @return SubscriptionProductComponentReference - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriptionProductComponentReference - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionProductComponentReference implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionProductComponentReference'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'linked_space_id' => 'int', + 'name' => 'string', + 'planned_purge_date' => '\DateTime', + 'space_id' => 'int', + 'state' => '\Wallee\Sdk\Model\SubscriptionProductComponentReferenceState', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'name' => null, + 'planned_purge_date' => 'date-time', + 'space_id' => 'int64', + 'state' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'planned_purge_date' => 'plannedPurgeDate', + 'space_id' => 'spaceId', + 'state' => 'state', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'space_id' => 'setSpaceId', + 'state' => 'setState', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'space_id' => 'getSpaceId', + 'state' => 'getState', + 'version' => 'getVersion' + ]; + + + + /** + * 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['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['space_id'] = isset($data['space_id']) ? $data['space_id'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The component reference name is used internally to identify the reference. For example the name is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets space_id + * + * @return int + */ + public function getSpaceId() + { + return $this->container['space_id']; + } + + /** + * Sets space_id + * + * @param int $space_id + * + * @return $this + */ + public function setSpaceId($space_id) + { + $this->container['space_id'] = $space_id; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\SubscriptionProductComponentReferenceState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\SubscriptionProductComponentReferenceState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/SubscriptionProductComponentReferenceState.php b/wallee-sdk/lib/Model/SubscriptionProductComponentReferenceState.php index 238562b..4e0b167 100644 --- a/wallee-sdk/lib/Model/SubscriptionProductComponentReferenceState.php +++ b/wallee-sdk/lib/Model/SubscriptionProductComponentReferenceState.php @@ -1,10 +1,8 @@ 'int', - 'version' => 'int', - 'componentChangeWeight' => 'int', - 'componentGroup' => 'int', - 'defaultComponent' => 'bool', - 'description' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', - 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', - 'reference' => 'int', - 'sortOrder' => 'int', - 'taxClass' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - /** - * The change weight determines whether if a component change is considered as upgrade or downgrade. If product component with a weight 10 is changed to a product component with a weight 20, the change is considered as upgrade. On the other hand a change from 20 to 10 is considered as a downgrade. - * - * @var int - */ - private $componentChangeWeight; - - /** - * - * - * @var int - */ - private $componentGroup; - - /** - * When a component is marked as a 'default' component it is used when no other component is selected by the user. - * - * @var bool - */ - private $defaultComponent; - - /** - * The component description may contain a longer description which gives the subscriber a better understanding of what the component contains. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - private $description; - - /** - * The component name is shown to the subscriber. It should describe in few words what the component does contain. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - private $name; - - /** - * The component reference is used to identify the component by external systems and it marks components to represent the same component within different product versions. - * - * @var int - */ - private $reference; - - /** - * The sort order controls in which order the component is listed. The sort order is used to order the components in ascending order. - * - * @var int - */ - private $sortOrder; - - /** - * The tax class of the component determines the taxes which are applicable on all fees linked with the component. - * - * @var int - */ - private $taxClass; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - if (isset($data['componentChangeWeight'])) { - $this->setComponentChangeWeight($data['componentChangeWeight']); - } - if (isset($data['componentGroup'])) { - $this->setComponentGroup($data['componentGroup']); - } - if (isset($data['defaultComponent'])) { - $this->setDefaultComponent($data['defaultComponent']); - } - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['reference'])) { - $this->setReference($data['reference']); - } - if (isset($data['sortOrder'])) { - $this->setSortOrder($data['sortOrder']); - } - if (isset($data['taxClass'])) { - $this->setTaxClass($data['taxClass']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionProductComponentUpdate - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriptionProductComponentUpdate - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Returns componentChangeWeight. - * - * The change weight determines whether if a component change is considered as upgrade or downgrade. If product component with a weight 10 is changed to a product component with a weight 20, the change is considered as upgrade. On the other hand a change from 20 to 10 is considered as a downgrade. - * - * @return int - */ - public function getComponentChangeWeight() { - return $this->componentChangeWeight; - } - - /** - * Sets componentChangeWeight. - * - * @param int $componentChangeWeight - * @return SubscriptionProductComponentUpdate - */ - public function setComponentChangeWeight($componentChangeWeight) { - $this->componentChangeWeight = $componentChangeWeight; - - return $this; - } - - /** - * Returns componentGroup. - * - * - * - * @return int - */ - public function getComponentGroup() { - return $this->componentGroup; - } - - /** - * Sets componentGroup. - * - * @param int $componentGroup - * @return SubscriptionProductComponentUpdate - */ - public function setComponentGroup($componentGroup) { - $this->componentGroup = $componentGroup; - - return $this; - } - - /** - * Returns defaultComponent. - * - * When a component is marked as a 'default' component it is used when no other component is selected by the user. - * - * @return bool - */ - public function getDefaultComponent() { - return $this->defaultComponent; - } - - /** - * Sets defaultComponent. - * - * @param bool $defaultComponent - * @return SubscriptionProductComponentUpdate - */ - public function setDefaultComponent($defaultComponent) { - $this->defaultComponent = $defaultComponent; - - return $this; - } - - /** - * Returns description. - * - * The component description may contain a longer description which gives the subscriber a better understanding of what the component contains. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $description - * @return SubscriptionProductComponentUpdate - */ - public function setDescription($description) { - $this->description = $description; - - return $this; - } - - /** - * Returns name. - * - * The component name is shown to the subscriber. It should describe in few words what the component does contain. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $name - * @return SubscriptionProductComponentUpdate - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns reference. - * - * The component reference is used to identify the component by external systems and it marks components to represent the same component within different product versions. - * - * @return int - */ - public function getReference() { - return $this->reference; - } - - /** - * Sets reference. - * - * @param int $reference - * @return SubscriptionProductComponentUpdate - */ - public function setReference($reference) { - $this->reference = $reference; - - return $this; - } - - /** - * Returns sortOrder. - * - * The sort order controls in which order the component is listed. The sort order is used to order the components in ascending order. - * - * @return int - */ - public function getSortOrder() { - return $this->sortOrder; - } - - /** - * Sets sortOrder. - * - * @param int $sortOrder - * @return SubscriptionProductComponentUpdate - */ - public function setSortOrder($sortOrder) { - $this->sortOrder = $sortOrder; - - return $this; - } - - /** - * Returns taxClass. - * - * The tax class of the component determines the taxes which are applicable on all fees linked with the component. - * - * @return int - */ - public function getTaxClass() { - return $this->taxClass; - } - - /** - * Sets taxClass. - * - * @param int $taxClass - * @return SubscriptionProductComponentUpdate - */ - public function setTaxClass($taxClass) { - $this->taxClass = $taxClass; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getId() === null) { - throw new ValidationException("'id' can't be null", 'id', $this); - } - if ($this->getVersion() === null) { - throw new ValidationException("'version' can't be null", 'version', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionProductComponentUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionProductComponent.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'version' => 'int', + 'component_change_weight' => 'int', + 'component_group' => 'int', + 'default_component' => 'bool', + 'description' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', + 'maximal_quantity' => 'float', + 'minimal_quantity' => 'float', + 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', + 'quantity_step' => 'float', + 'reference' => 'int', + 'sort_order' => 'int', + 'tax_class' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64', + 'component_change_weight' => 'int32', + 'component_group' => 'int64', + 'default_component' => null, + 'description' => null, + 'maximal_quantity' => null, + 'minimal_quantity' => null, + 'name' => null, + 'quantity_step' => null, + 'reference' => 'int64', + 'sort_order' => 'int32', + 'tax_class' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version', + 'component_change_weight' => 'componentChangeWeight', + 'component_group' => 'componentGroup', + 'default_component' => 'defaultComponent', + 'description' => 'description', + 'maximal_quantity' => 'maximalQuantity', + 'minimal_quantity' => 'minimalQuantity', + 'name' => 'name', + 'quantity_step' => 'quantityStep', + 'reference' => 'reference', + 'sort_order' => 'sortOrder', + 'tax_class' => 'taxClass' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion', + 'component_change_weight' => 'setComponentChangeWeight', + 'component_group' => 'setComponentGroup', + 'default_component' => 'setDefaultComponent', + 'description' => 'setDescription', + 'maximal_quantity' => 'setMaximalQuantity', + 'minimal_quantity' => 'setMinimalQuantity', + 'name' => 'setName', + 'quantity_step' => 'setQuantityStep', + 'reference' => 'setReference', + 'sort_order' => 'setSortOrder', + 'tax_class' => 'setTaxClass' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion', + 'component_change_weight' => 'getComponentChangeWeight', + 'component_group' => 'getComponentGroup', + 'default_component' => 'getDefaultComponent', + 'description' => 'getDescription', + 'maximal_quantity' => 'getMaximalQuantity', + 'minimal_quantity' => 'getMinimalQuantity', + 'name' => 'getName', + 'quantity_step' => 'getQuantityStep', + 'reference' => 'getReference', + 'sort_order' => 'getSortOrder', + 'tax_class' => 'getTaxClass' + ]; + + + + /** + * 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['version'] = isset($data['version']) ? $data['version'] : null; + + $this->container['component_change_weight'] = isset($data['component_change_weight']) ? $data['component_change_weight'] : null; + + $this->container['component_group'] = isset($data['component_group']) ? $data['component_group'] : null; + + $this->container['default_component'] = isset($data['default_component']) ? $data['default_component'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['maximal_quantity'] = isset($data['maximal_quantity']) ? $data['maximal_quantity'] : null; + + $this->container['minimal_quantity'] = isset($data['minimal_quantity']) ? $data['minimal_quantity'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['quantity_step'] = isset($data['quantity_step']) ? $data['quantity_step'] : null; + + $this->container['reference'] = isset($data['reference']) ? $data['reference'] : null; + + $this->container['sort_order'] = isset($data['sort_order']) ? $data['sort_order'] : null; + + $this->container['tax_class'] = isset($data['tax_class']) ? $data['tax_class'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + + /** + * Gets component_change_weight + * + * @return int + */ + public function getComponentChangeWeight() + { + return $this->container['component_change_weight']; + } + + /** + * Sets component_change_weight + * + * @param int $component_change_weight The change weight determines whether if a component change is considered as upgrade or downgrade. If product component with a weight 10 is changed to a product component with a weight 20, the change is considered as upgrade. On the other hand a change from 20 to 10 is considered as a downgrade. + * + * @return $this + */ + public function setComponentChangeWeight($component_change_weight) + { + $this->container['component_change_weight'] = $component_change_weight; + + return $this; + } + + + /** + * Gets component_group + * + * @return int + */ + public function getComponentGroup() + { + return $this->container['component_group']; + } + + /** + * Sets component_group + * + * @param int $component_group + * + * @return $this + */ + public function setComponentGroup($component_group) + { + $this->container['component_group'] = $component_group; + + return $this; + } + + + /** + * Gets default_component + * + * @return bool + */ + public function getDefaultComponent() + { + return $this->container['default_component']; + } + + /** + * Sets default_component + * + * @param bool $default_component When a component is marked as a 'default' component it is used when no other component is selected by the user. + * + * @return $this + */ + public function setDefaultComponent($default_component) + { + $this->container['default_component'] = $default_component; + + return $this; + } + + + /** + * Gets description + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $description The component description may contain a longer description which gives the subscriber a better understanding of what the component contains. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets maximal_quantity + * + * @return float + */ + public function getMaximalQuantity() + { + return $this->container['maximal_quantity']; + } + + /** + * Sets maximal_quantity + * + * @param float $maximal_quantity The maximum quantity defines the maximum value which must be entered for the quantity. + * + * @return $this + */ + public function setMaximalQuantity($maximal_quantity) + { + $this->container['maximal_quantity'] = $maximal_quantity; + + return $this; + } + + + /** + * Gets minimal_quantity + * + * @return float + */ + public function getMinimalQuantity() + { + return $this->container['minimal_quantity']; + } + + /** + * Sets minimal_quantity + * + * @param float $minimal_quantity The minimal quantity defines the minimum value which must be entered for the quantity. + * + * @return $this + */ + public function setMinimalQuantity($minimal_quantity) + { + $this->container['minimal_quantity'] = $minimal_quantity; + + return $this; + } + + + /** + * Gets name + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $name The component name is shown to the subscriber. It should describe in few words what the component does contain. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets quantity_step + * + * @return float + */ + public function getQuantityStep() + { + return $this->container['quantity_step']; + } + + /** + * Sets quantity_step + * + * @param float $quantity_step The quantity step defines at which interval the quantity can be increased. + * + * @return $this + */ + public function setQuantityStep($quantity_step) + { + $this->container['quantity_step'] = $quantity_step; + + return $this; + } + + + /** + * Gets reference + * + * @return int + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param int $reference The component reference is used to identify the component by external systems and it marks components to represent the same component within different product versions. + * + * @return $this + */ + public function setReference($reference) + { + $this->container['reference'] = $reference; + + return $this; + } + + + /** + * Gets sort_order + * + * @return int + */ + public function getSortOrder() + { + return $this->container['sort_order']; + } + + /** + * Sets sort_order + * + * @param int $sort_order The sort order controls in which order the component is listed. The sort order is used to order the components in ascending order. + * + * @return $this + */ + public function setSortOrder($sort_order) + { + $this->container['sort_order'] = $sort_order; + + return $this; + } + + + /** + * Gets tax_class + * + * @return int + */ + public function getTaxClass() + { + return $this->container['tax_class']; + } + + /** + * Sets tax_class + * + * @param int $tax_class The tax class of the component determines the taxes which are applicable on all fees linked with the component. + * + * @return $this + */ + public function setTaxClass($tax_class) + { + $this->container['tax_class'] = $tax_class; + + 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/wallee-sdk/lib/Model/SubscriptionProductCreate.php b/wallee-sdk/lib/Model/SubscriptionProductCreate.php index b7f7525..f800cb4 100644 --- a/wallee-sdk/lib/Model/SubscriptionProductCreate.php +++ b/wallee-sdk/lib/Model/SubscriptionProductCreate.php @@ -1,10 +1,8 @@ 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * The product reference identifies the product for external systems. This field may contain the product's SKU. - * - * @var string - */ - private $reference; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['reference'])) { - $this->setReference($data['reference']); - } - } - - - /** - * Returns reference. - * - * The product reference identifies the product for external systems. This field may contain the product's SKU. - * - * @return string - */ - public function getReference() { - return $this->reference; - } - - /** - * Sets reference. - * - * @param string $reference - * @return SubscriptionProductCreate - */ - public function setReference($reference) { - $this->reference = $reference; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - if ($this->getReference() === null) { - throw new ValidationException("'reference' can't be null", 'reference', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class SubscriptionProductCreate extends AbstractSubscriptionProductActive +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionProduct.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'reference' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'reference' => 'reference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'reference' => 'setReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'reference' => 'getReference' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['reference'] = isset($data['reference']) ? $data['reference'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['reference'] === null) { + $invalidProperties[] = "'reference' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference The product reference identifies the product for external systems. This field may contain the product's SKU. + * + * @return $this + */ + public function setReference($reference) + { + $this->container['reference'] = $reference; + + 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/wallee-sdk/lib/Model/SubscriptionProductRetirement.php b/wallee-sdk/lib/Model/SubscriptionProductRetirement.php index 48b7603..580addf 100644 --- a/wallee-sdk/lib/Model/SubscriptionProductRetirement.php +++ b/wallee-sdk/lib/Model/SubscriptionProductRetirement.php @@ -1,10 +1,8 @@ '\DateTime', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'product' => '\Wallee\Sdk\Model\SubscriptionProduct', - 'respectTerminiationPeriodsEnabled' => 'bool', - 'targetProduct' => '\Wallee\Sdk\Model\SubscriptionProduct', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The created on date indicates the date on which the entity was stored into the database. - * - * @var \DateTime - */ - private $createdOn; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionProduct - */ - private $product; - - /** - * - * - * @var bool - */ - private $respectTerminiationPeriodsEnabled; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionProduct - */ - private $targetProduct; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['product'])) { - $this->setProduct($data['product']); - } - if (isset($data['targetProduct'])) { - $this->setTargetProduct($data['targetProduct']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns createdOn. - * - * The created on date indicates the date on which the entity was stored into the database. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return SubscriptionProductRetirement - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionProductRetirement - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return SubscriptionProductRetirement - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns product. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionProduct - */ - public function getProduct() { - return $this->product; - } - - /** - * Sets product. - * - * @param \Wallee\Sdk\Model\SubscriptionProduct $product - * @return SubscriptionProductRetirement - */ - public function setProduct($product) { - $this->product = $product; - - return $this; - } - - /** - * Returns respectTerminiationPeriodsEnabled. - * - * - * - * @return bool - */ - public function getRespectTerminiationPeriodsEnabled() { - return $this->respectTerminiationPeriodsEnabled; - } - - /** - * Sets respectTerminiationPeriodsEnabled. - * - * @param bool $respectTerminiationPeriodsEnabled - * @return SubscriptionProductRetirement - */ - protected function setRespectTerminiationPeriodsEnabled($respectTerminiationPeriodsEnabled) { - $this->respectTerminiationPeriodsEnabled = $respectTerminiationPeriodsEnabled; - - return $this; - } - - /** - * Returns targetProduct. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionProduct - */ - public function getTargetProduct() { - return $this->targetProduct; - } - - /** - * Sets targetProduct. - * - * @param \Wallee\Sdk\Model\SubscriptionProduct $targetProduct - * @return SubscriptionProductRetirement - */ - public function setTargetProduct($targetProduct) { - $this->targetProduct = $targetProduct; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriptionProductRetirement - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionProductRetirement implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionProductRetirement'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'created_on' => '\DateTime', + 'id' => 'int', + 'linked_space_id' => 'int', + 'product' => '\Wallee\Sdk\Model\SubscriptionProduct', + 'respect_terminiation_periods_enabled' => 'bool', + 'target_product' => '\Wallee\Sdk\Model\SubscriptionProduct', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'created_on' => 'date-time', + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'product' => null, + 'respect_terminiation_periods_enabled' => null, + 'target_product' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'created_on' => 'createdOn', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'product' => 'product', + 'respect_terminiation_periods_enabled' => 'respectTerminiationPeriodsEnabled', + 'target_product' => 'targetProduct', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'created_on' => 'setCreatedOn', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'product' => 'setProduct', + 'respect_terminiation_periods_enabled' => 'setRespectTerminiationPeriodsEnabled', + 'target_product' => 'setTargetProduct', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'created_on' => 'getCreatedOn', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'product' => 'getProduct', + 'respect_terminiation_periods_enabled' => 'getRespectTerminiationPeriodsEnabled', + 'target_product' => 'getTargetProduct', + 'version' => 'getVersion' + ]; + + + + /** + * 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['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['product'] = isset($data['product']) ? $data['product'] : null; + + $this->container['respect_terminiation_periods_enabled'] = isset($data['respect_terminiation_periods_enabled']) ? $data['respect_terminiation_periods_enabled'] : null; + + $this->container['target_product'] = isset($data['target_product']) ? $data['target_product'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets product + * + * @return \Wallee\Sdk\Model\SubscriptionProduct + */ + public function getProduct() + { + return $this->container['product']; + } + + /** + * Sets product + * + * @param \Wallee\Sdk\Model\SubscriptionProduct $product + * + * @return $this + */ + public function setProduct($product) + { + $this->container['product'] = $product; + + return $this; + } + + + /** + * Gets respect_terminiation_periods_enabled + * + * @return bool + */ + public function getRespectTerminiationPeriodsEnabled() + { + return $this->container['respect_terminiation_periods_enabled']; + } + + /** + * Sets respect_terminiation_periods_enabled + * + * @param bool $respect_terminiation_periods_enabled + * + * @return $this + */ + public function setRespectTerminiationPeriodsEnabled($respect_terminiation_periods_enabled) + { + $this->container['respect_terminiation_periods_enabled'] = $respect_terminiation_periods_enabled; + + return $this; + } + + + /** + * Gets target_product + * + * @return \Wallee\Sdk\Model\SubscriptionProduct + */ + public function getTargetProduct() + { + return $this->container['target_product']; + } + + /** + * Sets target_product + * + * @param \Wallee\Sdk\Model\SubscriptionProduct $target_product + * + * @return $this + */ + public function setTargetProduct($target_product) + { + $this->container['target_product'] = $target_product; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/SubscriptionProductRetirementCreate.php b/wallee-sdk/lib/Model/SubscriptionProductRetirementCreate.php index a0e341f..1760a3f 100644 --- a/wallee-sdk/lib/Model/SubscriptionProductRetirementCreate.php +++ b/wallee-sdk/lib/Model/SubscriptionProductRetirementCreate.php @@ -1,10 +1,8 @@ 'int', - 'respectTerminiationPeriodsEnabled' => 'bool', - 'targetProduct' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var int - */ - private $product; - - /** - * - * - * @var bool - */ - private $respectTerminiationPeriodsEnabled; - - /** - * - * - * @var int - */ - private $targetProduct; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['product'])) { - $this->setProduct($data['product']); - } - if (isset($data['respectTerminiationPeriodsEnabled'])) { - $this->setRespectTerminiationPeriodsEnabled($data['respectTerminiationPeriodsEnabled']); - } - if (isset($data['targetProduct'])) { - $this->setTargetProduct($data['targetProduct']); - } - } - - - /** - * Returns product. - * - * - * - * @return int - */ - public function getProduct() { - return $this->product; - } - - /** - * Sets product. - * - * @param int $product - * @return SubscriptionProductRetirementCreate - */ - public function setProduct($product) { - $this->product = $product; - - return $this; - } - - /** - * Returns respectTerminiationPeriodsEnabled. - * - * - * - * @return bool - */ - public function getRespectTerminiationPeriodsEnabled() { - return $this->respectTerminiationPeriodsEnabled; - } - - /** - * Sets respectTerminiationPeriodsEnabled. - * - * @param bool $respectTerminiationPeriodsEnabled - * @return SubscriptionProductRetirementCreate - */ - public function setRespectTerminiationPeriodsEnabled($respectTerminiationPeriodsEnabled) { - $this->respectTerminiationPeriodsEnabled = $respectTerminiationPeriodsEnabled; - - return $this; - } - - /** - * Returns targetProduct. - * - * - * - * @return int - */ - public function getTargetProduct() { - return $this->targetProduct; - } - - /** - * Sets targetProduct. - * - * @param int $targetProduct - * @return SubscriptionProductRetirementCreate - */ - public function setTargetProduct($targetProduct) { - $this->targetProduct = $targetProduct; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getProduct() === null) { - throw new ValidationException("'product' can't be null", 'product', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class SubscriptionProductRetirementCreate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionProductRetirement.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'product' => 'int', + 'respect_terminiation_periods_enabled' => 'bool', + 'target_product' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'product' => 'int64', + 'respect_terminiation_periods_enabled' => null, + 'target_product' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'product' => 'product', + 'respect_terminiation_periods_enabled' => 'respectTerminiationPeriodsEnabled', + 'target_product' => 'targetProduct' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'product' => 'setProduct', + 'respect_terminiation_periods_enabled' => 'setRespectTerminiationPeriodsEnabled', + 'target_product' => 'setTargetProduct' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'product' => 'getProduct', + 'respect_terminiation_periods_enabled' => 'getRespectTerminiationPeriodsEnabled', + 'target_product' => 'getTargetProduct' + ]; + + + + /** + * 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['product'] = isset($data['product']) ? $data['product'] : null; + + $this->container['respect_terminiation_periods_enabled'] = isset($data['respect_terminiation_periods_enabled']) ? $data['respect_terminiation_periods_enabled'] : null; + + $this->container['target_product'] = isset($data['target_product']) ? $data['target_product'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['product'] === null) { + $invalidProperties[] = "'product' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 product + * + * @return int + */ + public function getProduct() + { + return $this->container['product']; + } + + /** + * Sets product + * + * @param int $product + * + * @return $this + */ + public function setProduct($product) + { + $this->container['product'] = $product; + + return $this; + } + + + /** + * Gets respect_terminiation_periods_enabled + * + * @return bool + */ + public function getRespectTerminiationPeriodsEnabled() + { + return $this->container['respect_terminiation_periods_enabled']; + } + + /** + * Sets respect_terminiation_periods_enabled + * + * @param bool $respect_terminiation_periods_enabled + * + * @return $this + */ + public function setRespectTerminiationPeriodsEnabled($respect_terminiation_periods_enabled) + { + $this->container['respect_terminiation_periods_enabled'] = $respect_terminiation_periods_enabled; + + return $this; + } + + + /** + * Gets target_product + * + * @return int + */ + public function getTargetProduct() + { + return $this->container['target_product']; + } + + /** + * Sets target_product + * + * @param int $target_product + * + * @return $this + */ + public function setTargetProduct($target_product) + { + $this->container['target_product'] = $target_product; + + 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/wallee-sdk/lib/Model/SubscriptionProductState.php b/wallee-sdk/lib/Model/SubscriptionProductState.php index 145c3ab..05d6da2 100644 --- a/wallee-sdk/lib/Model/SubscriptionProductState.php +++ b/wallee-sdk/lib/Model/SubscriptionProductState.php @@ -1,10 +1,8 @@ '\DateTime', - 'billingCycle' => 'string', - 'comment' => 'string', - 'createdOn' => '\DateTime', - 'defaultCurrency' => 'string', - 'enabledCurrencies' => 'string[]', - 'id' => 'int', - 'incrementNumber' => 'int', - 'linkedSpaceId' => 'int', - 'minimalNumberOfPeriods' => 'int', - 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedString', - 'numberOfNoticePeriods' => 'int', - 'obsoletedOn' => '\DateTime', - 'plannedPurgeDate' => '\DateTime', - 'product' => '\Wallee\Sdk\Model\SubscriptionProduct', - 'reference' => 'string', - 'retiringFinishedOn' => '\DateTime', - 'retiringStartedOn' => '\DateTime', - 'state' => '\Wallee\Sdk\Model\SubscriptionProductVersionState', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \DateTime - */ - private $activatedOn; - - /** - * The billing cycle determines the rhythm with which the subscriber is billed. The charging may have different rhythm. - * - * @var string - */ - private $billingCycle; - - /** - * The comment allows to provide a internal comment for the version. It helps to document why a product was changed. The comment is not disclosed to the subscriber. - * - * @var string - */ - private $comment; - - /** - * - * - * @var \DateTime - */ - private $createdOn; - - /** - * The default currency has to be used in all fees. - * - * @var string - */ - private $defaultCurrency; - - /** - * The currencies which are enabled can be selected to define component fees. Currencies which are not enabled cannot be used to define fees. - * - * @var string[] - */ - private $enabledCurrencies; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The increment number represents the version number incremented whenever a new version is activated. - * - * @var int - */ - private $incrementNumber; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The minimal number of periods determines how long the subscription has to run before the subscription can be terminated. - * - * @var int - */ - private $minimalNumberOfPeriods; - - /** - * The product version name is the name of the product which is shown to the user for the version. When the visible product name should be changed for a particular product a new version has to be created which contains the new name of the product. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedString - */ - private $name; - - /** - * The number of notice periods determines the number of periods which need to be paid between the request to terminate the subscription and the final period. - * - * @var int - */ - private $numberOfNoticePeriods; - - /** - * - * - * @var \DateTime - */ - private $obsoletedOn; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * Each product version is linked to a product. - * - * @var \Wallee\Sdk\Model\SubscriptionProduct - */ - private $product; - - /** - * The product version reference helps to identify the version. The reference is generated out of the product reference. - * - * @var string - */ - private $reference; - - /** - * - * - * @var \DateTime - */ - private $retiringFinishedOn; - - /** - * - * - * @var \DateTime - */ - private $retiringStartedOn; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionProductVersionState - */ - private $state; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['enabledCurrencies'])) { - $this->setEnabledCurrencies($data['enabledCurrencies']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['product'])) { - $this->setProduct($data['product']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns activatedOn. - * - * - * - * @return \DateTime - */ - public function getActivatedOn() { - return $this->activatedOn; - } - - /** - * Sets activatedOn. - * - * @param \DateTime $activatedOn - * @return SubscriptionProductVersion - */ - protected function setActivatedOn($activatedOn) { - $this->activatedOn = $activatedOn; - - return $this; - } - - /** - * Returns billingCycle. - * - * The billing cycle determines the rhythm with which the subscriber is billed. The charging may have different rhythm. - * - * @return string - */ - public function getBillingCycle() { - return $this->billingCycle; - } - - /** - * Sets billingCycle. - * - * @param string $billingCycle - * @return SubscriptionProductVersion - */ - protected function setBillingCycle($billingCycle) { - $this->billingCycle = $billingCycle; - - return $this; - } - - /** - * Returns comment. - * - * The comment allows to provide a internal comment for the version. It helps to document why a product was changed. The comment is not disclosed to the subscriber. - * - * @return string - */ - public function getComment() { - return $this->comment; - } - - /** - * Sets comment. - * - * @param string $comment - * @return SubscriptionProductVersion - */ - protected function setComment($comment) { - $this->comment = $comment; - - return $this; - } - - /** - * Returns createdOn. - * - * - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return SubscriptionProductVersion - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns defaultCurrency. - * - * The default currency has to be used in all fees. - * - * @return string - */ - public function getDefaultCurrency() { - return $this->defaultCurrency; - } - - /** - * Sets defaultCurrency. - * - * @param string $defaultCurrency - * @return SubscriptionProductVersion - */ - protected function setDefaultCurrency($defaultCurrency) { - $this->defaultCurrency = $defaultCurrency; - - return $this; - } - - /** - * Returns enabledCurrencies. - * - * The currencies which are enabled can be selected to define component fees. Currencies which are not enabled cannot be used to define fees. - * - * @return string[] - */ - public function getEnabledCurrencies() { - return $this->enabledCurrencies; - } - - /** - * Sets enabledCurrencies. - * - * @param string[] $enabledCurrencies - * @return SubscriptionProductVersion - */ - public function setEnabledCurrencies($enabledCurrencies) { - $this->enabledCurrencies = $enabledCurrencies; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionProductVersion - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns incrementNumber. - * - * The increment number represents the version number incremented whenever a new version is activated. - * - * @return int - */ - public function getIncrementNumber() { - return $this->incrementNumber; - } - - /** - * Sets incrementNumber. - * - * @param int $incrementNumber - * @return SubscriptionProductVersion - */ - protected function setIncrementNumber($incrementNumber) { - $this->incrementNumber = $incrementNumber; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return SubscriptionProductVersion - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns minimalNumberOfPeriods. - * - * The minimal number of periods determines how long the subscription has to run before the subscription can be terminated. - * - * @return int - */ - public function getMinimalNumberOfPeriods() { - return $this->minimalNumberOfPeriods; - } - - /** - * Sets minimalNumberOfPeriods. - * - * @param int $minimalNumberOfPeriods - * @return SubscriptionProductVersion - */ - protected function setMinimalNumberOfPeriods($minimalNumberOfPeriods) { - $this->minimalNumberOfPeriods = $minimalNumberOfPeriods; - - return $this; - } - - /** - * Returns name. - * - * The product version name is the name of the product which is shown to the user for the version. When the visible product name should be changed for a particular product a new version has to be created which contains the new name of the product. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedString - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedString $name - * @return SubscriptionProductVersion - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns numberOfNoticePeriods. - * - * The number of notice periods determines the number of periods which need to be paid between the request to terminate the subscription and the final period. - * - * @return int - */ - public function getNumberOfNoticePeriods() { - return $this->numberOfNoticePeriods; - } - - /** - * Sets numberOfNoticePeriods. - * - * @param int $numberOfNoticePeriods - * @return SubscriptionProductVersion - */ - protected function setNumberOfNoticePeriods($numberOfNoticePeriods) { - $this->numberOfNoticePeriods = $numberOfNoticePeriods; - - return $this; - } - - /** - * Returns obsoletedOn. - * - * - * - * @return \DateTime - */ - public function getObsoletedOn() { - return $this->obsoletedOn; - } - - /** - * Sets obsoletedOn. - * - * @param \DateTime $obsoletedOn - * @return SubscriptionProductVersion - */ - protected function setObsoletedOn($obsoletedOn) { - $this->obsoletedOn = $obsoletedOn; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return SubscriptionProductVersion - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns product. - * - * Each product version is linked to a product. - * - * @return \Wallee\Sdk\Model\SubscriptionProduct - */ - public function getProduct() { - return $this->product; - } - - /** - * Sets product. - * - * @param \Wallee\Sdk\Model\SubscriptionProduct $product - * @return SubscriptionProductVersion - */ - public function setProduct($product) { - $this->product = $product; - - return $this; - } - - /** - * Returns reference. - * - * The product version reference helps to identify the version. The reference is generated out of the product reference. - * - * @return string - */ - public function getReference() { - return $this->reference; - } - - /** - * Sets reference. - * - * @param string $reference - * @return SubscriptionProductVersion - */ - protected function setReference($reference) { - $this->reference = $reference; - - return $this; - } - - /** - * Returns retiringFinishedOn. - * - * - * - * @return \DateTime - */ - public function getRetiringFinishedOn() { - return $this->retiringFinishedOn; - } - - /** - * Sets retiringFinishedOn. - * - * @param \DateTime $retiringFinishedOn - * @return SubscriptionProductVersion - */ - protected function setRetiringFinishedOn($retiringFinishedOn) { - $this->retiringFinishedOn = $retiringFinishedOn; - - return $this; - } - - /** - * Returns retiringStartedOn. - * - * - * - * @return \DateTime - */ - public function getRetiringStartedOn() { - return $this->retiringStartedOn; - } - - /** - * Sets retiringStartedOn. - * - * @param \DateTime $retiringStartedOn - * @return SubscriptionProductVersion - */ - protected function setRetiringStartedOn($retiringStartedOn) { - $this->retiringStartedOn = $retiringStartedOn; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionProductVersionState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\SubscriptionProductVersionState $state - * @return SubscriptionProductVersion - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriptionProductVersion - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionProductVersion implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionProductVersion'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'activated_on' => '\DateTime', + 'billing_cycle' => 'string', + 'comment' => 'string', + 'created_on' => '\DateTime', + 'default_currency' => 'string', + 'enabled_currencies' => 'string[]', + 'id' => 'int', + 'increment_number' => 'int', + 'linked_space_id' => 'int', + 'minimal_number_of_periods' => 'int', + 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedString', + 'number_of_notice_periods' => 'int', + 'obsoleted_on' => '\DateTime', + 'planned_purge_date' => '\DateTime', + 'product' => '\Wallee\Sdk\Model\SubscriptionProduct', + 'reference' => 'string', + 'retiring_finished_on' => '\DateTime', + 'retiring_started_on' => '\DateTime', + 'state' => '\Wallee\Sdk\Model\SubscriptionProductVersionState', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'activated_on' => 'date-time', + 'billing_cycle' => null, + 'comment' => null, + 'created_on' => 'date-time', + 'default_currency' => null, + 'enabled_currencies' => null, + 'id' => 'int64', + 'increment_number' => 'int32', + 'linked_space_id' => 'int64', + 'minimal_number_of_periods' => 'int32', + 'name' => null, + 'number_of_notice_periods' => 'int32', + 'obsoleted_on' => 'date-time', + 'planned_purge_date' => 'date-time', + 'product' => null, + 'reference' => null, + 'retiring_finished_on' => 'date-time', + 'retiring_started_on' => 'date-time', + 'state' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'activated_on' => 'activatedOn', + 'billing_cycle' => 'billingCycle', + 'comment' => 'comment', + 'created_on' => 'createdOn', + 'default_currency' => 'defaultCurrency', + 'enabled_currencies' => 'enabledCurrencies', + 'id' => 'id', + 'increment_number' => 'incrementNumber', + 'linked_space_id' => 'linkedSpaceId', + 'minimal_number_of_periods' => 'minimalNumberOfPeriods', + 'name' => 'name', + 'number_of_notice_periods' => 'numberOfNoticePeriods', + 'obsoleted_on' => 'obsoletedOn', + 'planned_purge_date' => 'plannedPurgeDate', + 'product' => 'product', + 'reference' => 'reference', + 'retiring_finished_on' => 'retiringFinishedOn', + 'retiring_started_on' => 'retiringStartedOn', + 'state' => 'state', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'activated_on' => 'setActivatedOn', + 'billing_cycle' => 'setBillingCycle', + 'comment' => 'setComment', + 'created_on' => 'setCreatedOn', + 'default_currency' => 'setDefaultCurrency', + 'enabled_currencies' => 'setEnabledCurrencies', + 'id' => 'setId', + 'increment_number' => 'setIncrementNumber', + 'linked_space_id' => 'setLinkedSpaceId', + 'minimal_number_of_periods' => 'setMinimalNumberOfPeriods', + 'name' => 'setName', + 'number_of_notice_periods' => 'setNumberOfNoticePeriods', + 'obsoleted_on' => 'setObsoletedOn', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'product' => 'setProduct', + 'reference' => 'setReference', + 'retiring_finished_on' => 'setRetiringFinishedOn', + 'retiring_started_on' => 'setRetiringStartedOn', + 'state' => 'setState', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'activated_on' => 'getActivatedOn', + 'billing_cycle' => 'getBillingCycle', + 'comment' => 'getComment', + 'created_on' => 'getCreatedOn', + 'default_currency' => 'getDefaultCurrency', + 'enabled_currencies' => 'getEnabledCurrencies', + 'id' => 'getId', + 'increment_number' => 'getIncrementNumber', + 'linked_space_id' => 'getLinkedSpaceId', + 'minimal_number_of_periods' => 'getMinimalNumberOfPeriods', + 'name' => 'getName', + 'number_of_notice_periods' => 'getNumberOfNoticePeriods', + 'obsoleted_on' => 'getObsoletedOn', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'product' => 'getProduct', + 'reference' => 'getReference', + 'retiring_finished_on' => 'getRetiringFinishedOn', + 'retiring_started_on' => 'getRetiringStartedOn', + 'state' => 'getState', + 'version' => 'getVersion' + ]; + + + + /** + * 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['activated_on'] = isset($data['activated_on']) ? $data['activated_on'] : null; + + $this->container['billing_cycle'] = isset($data['billing_cycle']) ? $data['billing_cycle'] : null; + + $this->container['comment'] = isset($data['comment']) ? $data['comment'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['default_currency'] = isset($data['default_currency']) ? $data['default_currency'] : null; + + $this->container['enabled_currencies'] = isset($data['enabled_currencies']) ? $data['enabled_currencies'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['increment_number'] = isset($data['increment_number']) ? $data['increment_number'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['minimal_number_of_periods'] = isset($data['minimal_number_of_periods']) ? $data['minimal_number_of_periods'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['number_of_notice_periods'] = isset($data['number_of_notice_periods']) ? $data['number_of_notice_periods'] : null; + + $this->container['obsoleted_on'] = isset($data['obsoleted_on']) ? $data['obsoleted_on'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['product'] = isset($data['product']) ? $data['product'] : null; + + $this->container['reference'] = isset($data['reference']) ? $data['reference'] : null; + + $this->container['retiring_finished_on'] = isset($data['retiring_finished_on']) ? $data['retiring_finished_on'] : null; + + $this->container['retiring_started_on'] = isset($data['retiring_started_on']) ? $data['retiring_started_on'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 activated_on + * + * @return \DateTime + */ + public function getActivatedOn() + { + return $this->container['activated_on']; + } + + /** + * Sets activated_on + * + * @param \DateTime $activated_on + * + * @return $this + */ + public function setActivatedOn($activated_on) + { + $this->container['activated_on'] = $activated_on; + + return $this; + } + + + /** + * Gets billing_cycle + * + * @return string + */ + public function getBillingCycle() + { + return $this->container['billing_cycle']; + } + + /** + * Sets billing_cycle + * + * @param string $billing_cycle The billing cycle determines the rhythm with which the subscriber is billed. The charging may have different rhythm. + * + * @return $this + */ + public function setBillingCycle($billing_cycle) + { + $this->container['billing_cycle'] = $billing_cycle; + + return $this; + } + + + /** + * Gets comment + * + * @return string + */ + public function getComment() + { + return $this->container['comment']; + } + + /** + * Sets comment + * + * @param string $comment The comment allows to provide a internal comment for the version. It helps to document why a product was changed. The comment is not disclosed to the subscriber. + * + * @return $this + */ + public function setComment($comment) + { + $this->container['comment'] = $comment; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets default_currency + * + * @return string + */ + public function getDefaultCurrency() + { + return $this->container['default_currency']; + } + + /** + * Sets default_currency + * + * @param string $default_currency The default currency has to be used in all fees. + * + * @return $this + */ + public function setDefaultCurrency($default_currency) + { + $this->container['default_currency'] = $default_currency; + + return $this; + } + + + /** + * Gets enabled_currencies + * + * @return string[] + */ + public function getEnabledCurrencies() + { + return $this->container['enabled_currencies']; + } + + /** + * Sets enabled_currencies + * + * @param string[] $enabled_currencies The currencies which are enabled can be selected to define component fees. Currencies which are not enabled cannot be used to define fees. + * + * @return $this + */ + public function setEnabledCurrencies($enabled_currencies) + { + $this->container['enabled_currencies'] = $enabled_currencies; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets increment_number + * + * @return int + */ + public function getIncrementNumber() + { + return $this->container['increment_number']; + } + + /** + * Sets increment_number + * + * @param int $increment_number The increment number represents the version number incremented whenever a new version is activated. + * + * @return $this + */ + public function setIncrementNumber($increment_number) + { + $this->container['increment_number'] = $increment_number; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets minimal_number_of_periods + * + * @return int + */ + public function getMinimalNumberOfPeriods() + { + return $this->container['minimal_number_of_periods']; + } + + /** + * Sets minimal_number_of_periods + * + * @param int $minimal_number_of_periods The minimal number of periods determines how long the subscription has to run before the subscription can be terminated. + * + * @return $this + */ + public function setMinimalNumberOfPeriods($minimal_number_of_periods) + { + $this->container['minimal_number_of_periods'] = $minimal_number_of_periods; + + return $this; + } + + + /** + * Gets name + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedString + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedString $name The product version name is the name of the product which is shown to the user for the version. When the visible product name should be changed for a particular product a new version has to be created which contains the new name of the product. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets number_of_notice_periods + * + * @return int + */ + public function getNumberOfNoticePeriods() + { + return $this->container['number_of_notice_periods']; + } + + /** + * Sets number_of_notice_periods + * + * @param int $number_of_notice_periods The number of notice periods determines the number of periods which need to be paid between the request to terminate the subscription and the final period. + * + * @return $this + */ + public function setNumberOfNoticePeriods($number_of_notice_periods) + { + $this->container['number_of_notice_periods'] = $number_of_notice_periods; + + return $this; + } + + + /** + * Gets obsoleted_on + * + * @return \DateTime + */ + public function getObsoletedOn() + { + return $this->container['obsoleted_on']; + } + + /** + * Sets obsoleted_on + * + * @param \DateTime $obsoleted_on + * + * @return $this + */ + public function setObsoletedOn($obsoleted_on) + { + $this->container['obsoleted_on'] = $obsoleted_on; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets product + * + * @return \Wallee\Sdk\Model\SubscriptionProduct + */ + public function getProduct() + { + return $this->container['product']; + } + + /** + * Sets product + * + * @param \Wallee\Sdk\Model\SubscriptionProduct $product Each product version is linked to a product. + * + * @return $this + */ + public function setProduct($product) + { + $this->container['product'] = $product; + + return $this; + } + + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference The product version reference helps to identify the version. The reference is generated out of the product reference. + * + * @return $this + */ + public function setReference($reference) + { + $this->container['reference'] = $reference; + + return $this; + } + + + /** + * Gets retiring_finished_on + * + * @return \DateTime + */ + public function getRetiringFinishedOn() + { + return $this->container['retiring_finished_on']; + } + + /** + * Sets retiring_finished_on + * + * @param \DateTime $retiring_finished_on + * + * @return $this + */ + public function setRetiringFinishedOn($retiring_finished_on) + { + $this->container['retiring_finished_on'] = $retiring_finished_on; + + return $this; + } + + + /** + * Gets retiring_started_on + * + * @return \DateTime + */ + public function getRetiringStartedOn() + { + return $this->container['retiring_started_on']; + } + + /** + * Sets retiring_started_on + * + * @param \DateTime $retiring_started_on + * + * @return $this + */ + public function setRetiringStartedOn($retiring_started_on) + { + $this->container['retiring_started_on'] = $retiring_started_on; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\SubscriptionProductVersionState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\SubscriptionProductVersionState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/SubscriptionProductVersionPending.php b/wallee-sdk/lib/Model/SubscriptionProductVersionPending.php index 60ef281..151a264 100644 --- a/wallee-sdk/lib/Model/SubscriptionProductVersionPending.php +++ b/wallee-sdk/lib/Model/SubscriptionProductVersionPending.php @@ -1,10 +1,8 @@ 'int', - 'version' => 'int', - 'billingCycle' => 'string', - 'comment' => 'string', - 'defaultCurrency' => 'string', - 'enabledCurrencies' => 'string[]', - 'minimalNumberOfPeriods' => 'int', - 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', - 'numberOfNoticePeriods' => 'int', - 'product' => 'int', - 'state' => '\Wallee\Sdk\Model\SubscriptionProductVersionState' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - /** - * The billing cycle determines the rhythm with which the subscriber is billed. The charging may have different rhythm. - * - * @var string - */ - private $billingCycle; - - /** - * The comment allows to provide a internal comment for the version. It helps to document why a product was changed. The comment is not disclosed to the subscriber. - * - * @var string - */ - private $comment; - - /** - * The default currency has to be used in all fees. - * - * @var string - */ - private $defaultCurrency; - - /** - * The currencies which are enabled can be selected to define component fees. Currencies which are not enabled cannot be used to define fees. - * - * @var string[] - */ - private $enabledCurrencies; - - /** - * The minimal number of periods determines how long the subscription has to run before the subscription can be terminated. - * - * @var int - */ - private $minimalNumberOfPeriods; - - /** - * The product version name is the name of the product which is shown to the user for the version. When the visible product name should be changed for a particular product a new version has to be created which contains the new name of the product. - * - * @var \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - private $name; - - /** - * The number of notice periods determines the number of periods which need to be paid between the request to terminate the subscription and the final period. - * - * @var int - */ - private $numberOfNoticePeriods; - - /** - * Each product version is linked to a product. - * - * @var int - */ - private $product; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionProductVersionState - */ - private $state; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - if (isset($data['billingCycle'])) { - $this->setBillingCycle($data['billingCycle']); - } - if (isset($data['comment'])) { - $this->setComment($data['comment']); - } - if (isset($data['defaultCurrency'])) { - $this->setDefaultCurrency($data['defaultCurrency']); - } - if (isset($data['enabledCurrencies'])) { - $this->setEnabledCurrencies($data['enabledCurrencies']); - } - if (isset($data['minimalNumberOfPeriods'])) { - $this->setMinimalNumberOfPeriods($data['minimalNumberOfPeriods']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - if (isset($data['numberOfNoticePeriods'])) { - $this->setNumberOfNoticePeriods($data['numberOfNoticePeriods']); - } - if (isset($data['product'])) { - $this->setProduct($data['product']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionProductVersionPending - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriptionProductVersionPending - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Returns billingCycle. - * - * The billing cycle determines the rhythm with which the subscriber is billed. The charging may have different rhythm. - * - * @return string - */ - public function getBillingCycle() { - return $this->billingCycle; - } - - /** - * Sets billingCycle. - * - * @param string $billingCycle - * @return SubscriptionProductVersionPending - */ - public function setBillingCycle($billingCycle) { - $this->billingCycle = $billingCycle; - - return $this; - } - - /** - * Returns comment. - * - * The comment allows to provide a internal comment for the version. It helps to document why a product was changed. The comment is not disclosed to the subscriber. - * - * @return string - */ - public function getComment() { - return $this->comment; - } - - /** - * Sets comment. - * - * @param string $comment - * @return SubscriptionProductVersionPending - */ - public function setComment($comment) { - $this->comment = $comment; - - return $this; - } - - /** - * Returns defaultCurrency. - * - * The default currency has to be used in all fees. - * - * @return string - */ - public function getDefaultCurrency() { - return $this->defaultCurrency; - } - - /** - * Sets defaultCurrency. - * - * @param string $defaultCurrency - * @return SubscriptionProductVersionPending - */ - public function setDefaultCurrency($defaultCurrency) { - $this->defaultCurrency = $defaultCurrency; - - return $this; - } - - /** - * Returns enabledCurrencies. - * - * The currencies which are enabled can be selected to define component fees. Currencies which are not enabled cannot be used to define fees. - * - * @return string[] - */ - public function getEnabledCurrencies() { - return $this->enabledCurrencies; - } - - /** - * Sets enabledCurrencies. - * - * @param string[] $enabledCurrencies - * @return SubscriptionProductVersionPending - */ - public function setEnabledCurrencies($enabledCurrencies) { - $this->enabledCurrencies = $enabledCurrencies; - - return $this; - } - - /** - * Returns minimalNumberOfPeriods. - * - * The minimal number of periods determines how long the subscription has to run before the subscription can be terminated. - * - * @return int - */ - public function getMinimalNumberOfPeriods() { - return $this->minimalNumberOfPeriods; - } - - /** - * Sets minimalNumberOfPeriods. - * - * @param int $minimalNumberOfPeriods - * @return SubscriptionProductVersionPending - */ - public function setMinimalNumberOfPeriods($minimalNumberOfPeriods) { - $this->minimalNumberOfPeriods = $minimalNumberOfPeriods; - - return $this; - } - - /** - * Returns name. - * - * The product version name is the name of the product which is shown to the user for the version. When the visible product name should be changed for a particular product a new version has to be created which contains the new name of the product. - * - * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $name - * @return SubscriptionProductVersionPending - */ - public function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns numberOfNoticePeriods. - * - * The number of notice periods determines the number of periods which need to be paid between the request to terminate the subscription and the final period. - * - * @return int - */ - public function getNumberOfNoticePeriods() { - return $this->numberOfNoticePeriods; - } - - /** - * Sets numberOfNoticePeriods. - * - * @param int $numberOfNoticePeriods - * @return SubscriptionProductVersionPending - */ - public function setNumberOfNoticePeriods($numberOfNoticePeriods) { - $this->numberOfNoticePeriods = $numberOfNoticePeriods; - - return $this; - } - - /** - * Returns product. - * - * Each product version is linked to a product. - * - * @return int - */ - public function getProduct() { - return $this->product; - } - - /** - * Sets product. - * - * @param int $product - * @return SubscriptionProductVersionPending - */ - public function setProduct($product) { - $this->product = $product; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionProductVersionState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\SubscriptionProductVersionState $state - * @return SubscriptionProductVersionPending - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getId() === null) { - throw new ValidationException("'id' can't be null", 'id', $this); - } - if ($this->getVersion() === null) { - throw new ValidationException("'version' can't be null", 'version', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionProductVersionPending implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionProductVersion.Pending'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'version' => 'int', + 'billing_cycle' => 'string', + 'comment' => 'string', + 'default_currency' => 'string', + 'enabled_currencies' => 'string[]', + 'minimal_number_of_periods' => 'int', + 'name' => '\Wallee\Sdk\Model\DatabaseTranslatedStringCreate', + 'number_of_notice_periods' => 'int', + 'product' => 'int', + 'state' => '\Wallee\Sdk\Model\SubscriptionProductVersionState' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64', + 'billing_cycle' => null, + 'comment' => null, + 'default_currency' => null, + 'enabled_currencies' => null, + 'minimal_number_of_periods' => 'int32', + 'name' => null, + 'number_of_notice_periods' => 'int32', + 'product' => 'int64', + 'state' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version', + 'billing_cycle' => 'billingCycle', + 'comment' => 'comment', + 'default_currency' => 'defaultCurrency', + 'enabled_currencies' => 'enabledCurrencies', + 'minimal_number_of_periods' => 'minimalNumberOfPeriods', + 'name' => 'name', + 'number_of_notice_periods' => 'numberOfNoticePeriods', + 'product' => 'product', + 'state' => 'state' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion', + 'billing_cycle' => 'setBillingCycle', + 'comment' => 'setComment', + 'default_currency' => 'setDefaultCurrency', + 'enabled_currencies' => 'setEnabledCurrencies', + 'minimal_number_of_periods' => 'setMinimalNumberOfPeriods', + 'name' => 'setName', + 'number_of_notice_periods' => 'setNumberOfNoticePeriods', + 'product' => 'setProduct', + 'state' => 'setState' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion', + 'billing_cycle' => 'getBillingCycle', + 'comment' => 'getComment', + 'default_currency' => 'getDefaultCurrency', + 'enabled_currencies' => 'getEnabledCurrencies', + 'minimal_number_of_periods' => 'getMinimalNumberOfPeriods', + 'name' => 'getName', + 'number_of_notice_periods' => 'getNumberOfNoticePeriods', + 'product' => 'getProduct', + 'state' => 'getState' + ]; + + + + /** + * 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['version'] = isset($data['version']) ? $data['version'] : null; + + $this->container['billing_cycle'] = isset($data['billing_cycle']) ? $data['billing_cycle'] : null; + + $this->container['comment'] = isset($data['comment']) ? $data['comment'] : null; + + $this->container['default_currency'] = isset($data['default_currency']) ? $data['default_currency'] : null; + + $this->container['enabled_currencies'] = isset($data['enabled_currencies']) ? $data['enabled_currencies'] : null; + + $this->container['minimal_number_of_periods'] = isset($data['minimal_number_of_periods']) ? $data['minimal_number_of_periods'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['number_of_notice_periods'] = isset($data['number_of_notice_periods']) ? $data['number_of_notice_periods'] : null; + + $this->container['product'] = isset($data['product']) ? $data['product'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + + /** + * Gets billing_cycle + * + * @return string + */ + public function getBillingCycle() + { + return $this->container['billing_cycle']; + } + + /** + * Sets billing_cycle + * + * @param string $billing_cycle The billing cycle determines the rhythm with which the subscriber is billed. The charging may have different rhythm. + * + * @return $this + */ + public function setBillingCycle($billing_cycle) + { + $this->container['billing_cycle'] = $billing_cycle; + + return $this; + } + + + /** + * Gets comment + * + * @return string + */ + public function getComment() + { + return $this->container['comment']; + } + + /** + * Sets comment + * + * @param string $comment The comment allows to provide a internal comment for the version. It helps to document why a product was changed. The comment is not disclosed to the subscriber. + * + * @return $this + */ + public function setComment($comment) + { + $this->container['comment'] = $comment; + + return $this; + } + + + /** + * Gets default_currency + * + * @return string + */ + public function getDefaultCurrency() + { + return $this->container['default_currency']; + } + + /** + * Sets default_currency + * + * @param string $default_currency The default currency has to be used in all fees. + * + * @return $this + */ + public function setDefaultCurrency($default_currency) + { + $this->container['default_currency'] = $default_currency; + + return $this; + } + + + /** + * Gets enabled_currencies + * + * @return string[] + */ + public function getEnabledCurrencies() + { + return $this->container['enabled_currencies']; + } + + /** + * Sets enabled_currencies + * + * @param string[] $enabled_currencies The currencies which are enabled can be selected to define component fees. Currencies which are not enabled cannot be used to define fees. + * + * @return $this + */ + public function setEnabledCurrencies($enabled_currencies) + { + $this->container['enabled_currencies'] = $enabled_currencies; + + return $this; + } + + + /** + * Gets minimal_number_of_periods + * + * @return int + */ + public function getMinimalNumberOfPeriods() + { + return $this->container['minimal_number_of_periods']; + } + + /** + * Sets minimal_number_of_periods + * + * @param int $minimal_number_of_periods The minimal number of periods determines how long the subscription has to run before the subscription can be terminated. + * + * @return $this + */ + public function setMinimalNumberOfPeriods($minimal_number_of_periods) + { + $this->container['minimal_number_of_periods'] = $minimal_number_of_periods; + + return $this; + } + + + /** + * Gets name + * + * @return \Wallee\Sdk\Model\DatabaseTranslatedStringCreate + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Wallee\Sdk\Model\DatabaseTranslatedStringCreate $name The product version name is the name of the product which is shown to the user for the version. When the visible product name should be changed for a particular product a new version has to be created which contains the new name of the product. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets number_of_notice_periods + * + * @return int + */ + public function getNumberOfNoticePeriods() + { + return $this->container['number_of_notice_periods']; + } + + /** + * Sets number_of_notice_periods + * + * @param int $number_of_notice_periods The number of notice periods determines the number of periods which need to be paid between the request to terminate the subscription and the final period. + * + * @return $this + */ + public function setNumberOfNoticePeriods($number_of_notice_periods) + { + $this->container['number_of_notice_periods'] = $number_of_notice_periods; + + return $this; + } + + + /** + * Gets product + * + * @return int + */ + public function getProduct() + { + return $this->container['product']; + } + + /** + * Sets product + * + * @param int $product Each product version is linked to a product. + * + * @return $this + */ + public function setProduct($product) + { + $this->container['product'] = $product; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\SubscriptionProductVersionState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\SubscriptionProductVersionState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + 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/wallee-sdk/lib/Model/SubscriptionProductVersionRetirement.php b/wallee-sdk/lib/Model/SubscriptionProductVersionRetirement.php index bcea72c..0ca05ed 100644 --- a/wallee-sdk/lib/Model/SubscriptionProductVersionRetirement.php +++ b/wallee-sdk/lib/Model/SubscriptionProductVersionRetirement.php @@ -1,10 +1,8 @@ '\DateTime', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'productVersion' => '\Wallee\Sdk\Model\SubscriptionProductVersion', - 'respectTerminiationPeriodsEnabled' => 'bool', - 'targetProduct' => '\Wallee\Sdk\Model\SubscriptionProduct', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The created on date indicates the date on which the entity was stored into the database. - * - * @var \DateTime - */ - private $createdOn; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionProductVersion - */ - private $productVersion; - - /** - * - * - * @var bool - */ - private $respectTerminiationPeriodsEnabled; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionProduct - */ - private $targetProduct; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['productVersion'])) { - $this->setProductVersion($data['productVersion']); - } - if (isset($data['targetProduct'])) { - $this->setTargetProduct($data['targetProduct']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns createdOn. - * - * The created on date indicates the date on which the entity was stored into the database. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return SubscriptionProductVersionRetirement - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionProductVersionRetirement - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return SubscriptionProductVersionRetirement - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns productVersion. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionProductVersion - */ - public function getProductVersion() { - return $this->productVersion; - } - - /** - * Sets productVersion. - * - * @param \Wallee\Sdk\Model\SubscriptionProductVersion $productVersion - * @return SubscriptionProductVersionRetirement - */ - public function setProductVersion($productVersion) { - $this->productVersion = $productVersion; - - return $this; - } - - /** - * Returns respectTerminiationPeriodsEnabled. - * - * - * - * @return bool - */ - public function getRespectTerminiationPeriodsEnabled() { - return $this->respectTerminiationPeriodsEnabled; - } - - /** - * Sets respectTerminiationPeriodsEnabled. - * - * @param bool $respectTerminiationPeriodsEnabled - * @return SubscriptionProductVersionRetirement - */ - protected function setRespectTerminiationPeriodsEnabled($respectTerminiationPeriodsEnabled) { - $this->respectTerminiationPeriodsEnabled = $respectTerminiationPeriodsEnabled; - - return $this; - } - - /** - * Returns targetProduct. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionProduct - */ - public function getTargetProduct() { - return $this->targetProduct; - } - - /** - * Sets targetProduct. - * - * @param \Wallee\Sdk\Model\SubscriptionProduct $targetProduct - * @return SubscriptionProductVersionRetirement - */ - public function setTargetProduct($targetProduct) { - $this->targetProduct = $targetProduct; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriptionProductVersionRetirement - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionProductVersionRetirement implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionProductVersionRetirement'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'created_on' => '\DateTime', + 'id' => 'int', + 'linked_space_id' => 'int', + 'product_version' => '\Wallee\Sdk\Model\SubscriptionProductVersion', + 'respect_terminiation_periods_enabled' => 'bool', + 'target_product' => '\Wallee\Sdk\Model\SubscriptionProduct', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'created_on' => 'date-time', + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'product_version' => null, + 'respect_terminiation_periods_enabled' => null, + 'target_product' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'created_on' => 'createdOn', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'product_version' => 'productVersion', + 'respect_terminiation_periods_enabled' => 'respectTerminiationPeriodsEnabled', + 'target_product' => 'targetProduct', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'created_on' => 'setCreatedOn', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'product_version' => 'setProductVersion', + 'respect_terminiation_periods_enabled' => 'setRespectTerminiationPeriodsEnabled', + 'target_product' => 'setTargetProduct', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'created_on' => 'getCreatedOn', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'product_version' => 'getProductVersion', + 'respect_terminiation_periods_enabled' => 'getRespectTerminiationPeriodsEnabled', + 'target_product' => 'getTargetProduct', + 'version' => 'getVersion' + ]; + + + + /** + * 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['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['product_version'] = isset($data['product_version']) ? $data['product_version'] : null; + + $this->container['respect_terminiation_periods_enabled'] = isset($data['respect_terminiation_periods_enabled']) ? $data['respect_terminiation_periods_enabled'] : null; + + $this->container['target_product'] = isset($data['target_product']) ? $data['target_product'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets product_version + * + * @return \Wallee\Sdk\Model\SubscriptionProductVersion + */ + public function getProductVersion() + { + return $this->container['product_version']; + } + + /** + * Sets product_version + * + * @param \Wallee\Sdk\Model\SubscriptionProductVersion $product_version + * + * @return $this + */ + public function setProductVersion($product_version) + { + $this->container['product_version'] = $product_version; + + return $this; + } + + + /** + * Gets respect_terminiation_periods_enabled + * + * @return bool + */ + public function getRespectTerminiationPeriodsEnabled() + { + return $this->container['respect_terminiation_periods_enabled']; + } + + /** + * Sets respect_terminiation_periods_enabled + * + * @param bool $respect_terminiation_periods_enabled + * + * @return $this + */ + public function setRespectTerminiationPeriodsEnabled($respect_terminiation_periods_enabled) + { + $this->container['respect_terminiation_periods_enabled'] = $respect_terminiation_periods_enabled; + + return $this; + } + + + /** + * Gets target_product + * + * @return \Wallee\Sdk\Model\SubscriptionProduct + */ + public function getTargetProduct() + { + return $this->container['target_product']; + } + + /** + * Sets target_product + * + * @param \Wallee\Sdk\Model\SubscriptionProduct $target_product + * + * @return $this + */ + public function setTargetProduct($target_product) + { + $this->container['target_product'] = $target_product; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/SubscriptionProductVersionRetirementCreate.php b/wallee-sdk/lib/Model/SubscriptionProductVersionRetirementCreate.php index 5577851..24f0396 100644 --- a/wallee-sdk/lib/Model/SubscriptionProductVersionRetirementCreate.php +++ b/wallee-sdk/lib/Model/SubscriptionProductVersionRetirementCreate.php @@ -1,10 +1,8 @@ 'int', - 'respectTerminiationPeriodsEnabled' => 'bool', - 'targetProduct' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var int - */ - private $productVersion; - - /** - * - * - * @var bool - */ - private $respectTerminiationPeriodsEnabled; - - /** - * - * - * @var int - */ - private $targetProduct; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['productVersion'])) { - $this->setProductVersion($data['productVersion']); - } - if (isset($data['respectTerminiationPeriodsEnabled'])) { - $this->setRespectTerminiationPeriodsEnabled($data['respectTerminiationPeriodsEnabled']); - } - if (isset($data['targetProduct'])) { - $this->setTargetProduct($data['targetProduct']); - } - } - - - /** - * Returns productVersion. - * - * - * - * @return int - */ - public function getProductVersion() { - return $this->productVersion; - } - - /** - * Sets productVersion. - * - * @param int $productVersion - * @return SubscriptionProductVersionRetirementCreate - */ - public function setProductVersion($productVersion) { - $this->productVersion = $productVersion; - - return $this; - } - - /** - * Returns respectTerminiationPeriodsEnabled. - * - * - * - * @return bool - */ - public function getRespectTerminiationPeriodsEnabled() { - return $this->respectTerminiationPeriodsEnabled; - } - - /** - * Sets respectTerminiationPeriodsEnabled. - * - * @param bool $respectTerminiationPeriodsEnabled - * @return SubscriptionProductVersionRetirementCreate - */ - public function setRespectTerminiationPeriodsEnabled($respectTerminiationPeriodsEnabled) { - $this->respectTerminiationPeriodsEnabled = $respectTerminiationPeriodsEnabled; - - return $this; - } - - /** - * Returns targetProduct. - * - * - * - * @return int - */ - public function getTargetProduct() { - return $this->targetProduct; - } - - /** - * Sets targetProduct. - * - * @param int $targetProduct - * @return SubscriptionProductVersionRetirementCreate - */ - public function setTargetProduct($targetProduct) { - $this->targetProduct = $targetProduct; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getProductVersion() === null) { - throw new ValidationException("'productVersion' can't be null", 'productVersion', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class SubscriptionProductVersionRetirementCreate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionProductVersionRetirement.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'product_version' => 'int', + 'respect_terminiation_periods_enabled' => 'bool', + 'target_product' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'product_version' => 'int64', + 'respect_terminiation_periods_enabled' => null, + 'target_product' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'product_version' => 'productVersion', + 'respect_terminiation_periods_enabled' => 'respectTerminiationPeriodsEnabled', + 'target_product' => 'targetProduct' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'product_version' => 'setProductVersion', + 'respect_terminiation_periods_enabled' => 'setRespectTerminiationPeriodsEnabled', + 'target_product' => 'setTargetProduct' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'product_version' => 'getProductVersion', + 'respect_terminiation_periods_enabled' => 'getRespectTerminiationPeriodsEnabled', + 'target_product' => 'getTargetProduct' + ]; + + + + /** + * 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['product_version'] = isset($data['product_version']) ? $data['product_version'] : null; + + $this->container['respect_terminiation_periods_enabled'] = isset($data['respect_terminiation_periods_enabled']) ? $data['respect_terminiation_periods_enabled'] : null; + + $this->container['target_product'] = isset($data['target_product']) ? $data['target_product'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['product_version'] === null) { + $invalidProperties[] = "'product_version' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 product_version + * + * @return int + */ + public function getProductVersion() + { + return $this->container['product_version']; + } + + /** + * Sets product_version + * + * @param int $product_version + * + * @return $this + */ + public function setProductVersion($product_version) + { + $this->container['product_version'] = $product_version; + + return $this; + } + + + /** + * Gets respect_terminiation_periods_enabled + * + * @return bool + */ + public function getRespectTerminiationPeriodsEnabled() + { + return $this->container['respect_terminiation_periods_enabled']; + } + + /** + * Sets respect_terminiation_periods_enabled + * + * @param bool $respect_terminiation_periods_enabled + * + * @return $this + */ + public function setRespectTerminiationPeriodsEnabled($respect_terminiation_periods_enabled) + { + $this->container['respect_terminiation_periods_enabled'] = $respect_terminiation_periods_enabled; + + return $this; + } + + + /** + * Gets target_product + * + * @return int + */ + public function getTargetProduct() + { + return $this->container['target_product']; + } + + /** + * Sets target_product + * + * @param int $target_product + * + * @return $this + */ + public function setTargetProduct($target_product) + { + $this->container['target_product'] = $target_product; + + 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/wallee-sdk/lib/Model/SubscriptionProductVersionState.php b/wallee-sdk/lib/Model/SubscriptionProductVersionState.php index a4ac31d..fbddeb6 100644 --- a/wallee-sdk/lib/Model/SubscriptionProductVersionState.php +++ b/wallee-sdk/lib/Model/SubscriptionProductVersionState.php @@ -1,10 +1,8 @@ '\DateTime', - 'effectiveEndDate' => '\DateTime', - 'endAction' => '\Wallee\Sdk\Model\SubscriptionSuspensionAction', - 'id' => 'int', - 'language' => 'string', - 'linkedSpaceId' => 'int', - 'note' => 'string', - 'periodBill' => 'int', - 'plannedEndDate' => '\DateTime', - 'plannedPurgeDate' => '\DateTime', - 'reason' => '\Wallee\Sdk\Model\SubscriptionSuspensionReason', - 'state' => '\Wallee\Sdk\Model\SubscriptionSuspensionState', - 'subscription' => 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The created on date indicates the date on which the entity was stored into the database. - * - * @var \DateTime - */ - private $createdOn; - - /** - * - * - * @var \DateTime - */ - private $effectiveEndDate; - - /** - * When the suspension reaches the planned end date the end action will be carried out. This action is only executed when the suspension is ended automatically based on the end date. - * - * @var \Wallee\Sdk\Model\SubscriptionSuspensionAction - */ - private $endAction; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var string - */ - private $language; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The note may contain some internal information for the suspension. The note will not be disclosed to the subscriber. - * - * @var string - */ - private $note; - - /** - * - * - * @var int - */ - private $periodBill; - - /** - * The planned end date of the suspension identifies the date on which the suspension will be ended automatically. - * - * @var \DateTime - */ - private $plannedEndDate; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * The suspension reason indicates why a suspension has been created. - * - * @var \Wallee\Sdk\Model\SubscriptionSuspensionReason - */ - private $reason; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionSuspensionState - */ - private $state; - - /** - * - * - * @var int - */ - private $subscription; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['endAction'])) { - $this->setEndAction($data['endAction']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['reason'])) { - $this->setReason($data['reason']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns createdOn. - * - * The created on date indicates the date on which the entity was stored into the database. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return SubscriptionSuspension - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns effectiveEndDate. - * - * - * - * @return \DateTime - */ - public function getEffectiveEndDate() { - return $this->effectiveEndDate; - } - - /** - * Sets effectiveEndDate. - * - * @param \DateTime $effectiveEndDate - * @return SubscriptionSuspension - */ - protected function setEffectiveEndDate($effectiveEndDate) { - $this->effectiveEndDate = $effectiveEndDate; - - return $this; - } - - /** - * Returns endAction. - * - * When the suspension reaches the planned end date the end action will be carried out. This action is only executed when the suspension is ended automatically based on the end date. - * - * @return \Wallee\Sdk\Model\SubscriptionSuspensionAction - */ - public function getEndAction() { - return $this->endAction; - } - - /** - * Sets endAction. - * - * @param \Wallee\Sdk\Model\SubscriptionSuspensionAction $endAction - * @return SubscriptionSuspension - */ - public function setEndAction($endAction) { - $this->endAction = $endAction; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionSuspension - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return SubscriptionSuspension - */ - protected function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return SubscriptionSuspension - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns note. - * - * The note may contain some internal information for the suspension. The note will not be disclosed to the subscriber. - * - * @return string - */ - public function getNote() { - return $this->note; - } - - /** - * Sets note. - * - * @param string $note - * @return SubscriptionSuspension - */ - protected function setNote($note) { - $this->note = $note; - - return $this; - } - - /** - * Returns periodBill. - * - * - * - * @return int - */ - public function getPeriodBill() { - return $this->periodBill; - } - - /** - * Sets periodBill. - * - * @param int $periodBill - * @return SubscriptionSuspension - */ - protected function setPeriodBill($periodBill) { - $this->periodBill = $periodBill; - - return $this; - } - - /** - * Returns plannedEndDate. - * - * The planned end date of the suspension identifies the date on which the suspension will be ended automatically. - * - * @return \DateTime - */ - public function getPlannedEndDate() { - return $this->plannedEndDate; - } - - /** - * Sets plannedEndDate. - * - * @param \DateTime $plannedEndDate - * @return SubscriptionSuspension - */ - protected function setPlannedEndDate($plannedEndDate) { - $this->plannedEndDate = $plannedEndDate; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return SubscriptionSuspension - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns reason. - * - * The suspension reason indicates why a suspension has been created. - * - * @return \Wallee\Sdk\Model\SubscriptionSuspensionReason - */ - public function getReason() { - return $this->reason; - } - - /** - * Sets reason. - * - * @param \Wallee\Sdk\Model\SubscriptionSuspensionReason $reason - * @return SubscriptionSuspension - */ - public function setReason($reason) { - $this->reason = $reason; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionSuspensionState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\SubscriptionSuspensionState $state - * @return SubscriptionSuspension - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns subscription. - * - * - * - * @return int - */ - public function getSubscription() { - return $this->subscription; - } - - /** - * Sets subscription. - * - * @param int $subscription - * @return SubscriptionSuspension - */ - protected function setSubscription($subscription) { - $this->subscription = $subscription; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriptionSuspension - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionSuspension implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionSuspension'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'created_on' => '\DateTime', + 'effective_end_date' => '\DateTime', + 'end_action' => '\Wallee\Sdk\Model\SubscriptionSuspensionAction', + 'id' => 'int', + 'language' => 'string', + 'linked_space_id' => 'int', + 'note' => 'string', + 'period_bill' => 'int', + 'planned_end_date' => '\DateTime', + 'planned_purge_date' => '\DateTime', + 'reason' => '\Wallee\Sdk\Model\SubscriptionSuspensionReason', + 'state' => '\Wallee\Sdk\Model\SubscriptionSuspensionState', + 'subscription' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'created_on' => 'date-time', + 'effective_end_date' => 'date-time', + 'end_action' => null, + 'id' => 'int64', + 'language' => null, + 'linked_space_id' => 'int64', + 'note' => null, + 'period_bill' => 'int64', + 'planned_end_date' => 'date-time', + 'planned_purge_date' => 'date-time', + 'reason' => null, + 'state' => null, + 'subscription' => 'int64', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'created_on' => 'createdOn', + 'effective_end_date' => 'effectiveEndDate', + 'end_action' => 'endAction', + 'id' => 'id', + 'language' => 'language', + 'linked_space_id' => 'linkedSpaceId', + 'note' => 'note', + 'period_bill' => 'periodBill', + 'planned_end_date' => 'plannedEndDate', + 'planned_purge_date' => 'plannedPurgeDate', + 'reason' => 'reason', + 'state' => 'state', + 'subscription' => 'subscription', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'created_on' => 'setCreatedOn', + 'effective_end_date' => 'setEffectiveEndDate', + 'end_action' => 'setEndAction', + 'id' => 'setId', + 'language' => 'setLanguage', + 'linked_space_id' => 'setLinkedSpaceId', + 'note' => 'setNote', + 'period_bill' => 'setPeriodBill', + 'planned_end_date' => 'setPlannedEndDate', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'reason' => 'setReason', + 'state' => 'setState', + 'subscription' => 'setSubscription', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'created_on' => 'getCreatedOn', + 'effective_end_date' => 'getEffectiveEndDate', + 'end_action' => 'getEndAction', + 'id' => 'getId', + 'language' => 'getLanguage', + 'linked_space_id' => 'getLinkedSpaceId', + 'note' => 'getNote', + 'period_bill' => 'getPeriodBill', + 'planned_end_date' => 'getPlannedEndDate', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'reason' => 'getReason', + 'state' => 'getState', + 'subscription' => 'getSubscription', + 'version' => 'getVersion' + ]; + + + + /** + * 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['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['effective_end_date'] = isset($data['effective_end_date']) ? $data['effective_end_date'] : null; + + $this->container['end_action'] = isset($data['end_action']) ? $data['end_action'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['note'] = isset($data['note']) ? $data['note'] : null; + + $this->container['period_bill'] = isset($data['period_bill']) ? $data['period_bill'] : null; + + $this->container['planned_end_date'] = isset($data['planned_end_date']) ? $data['planned_end_date'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['reason'] = isset($data['reason']) ? $data['reason'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['subscription'] = isset($data['subscription']) ? $data['subscription'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets effective_end_date + * + * @return \DateTime + */ + public function getEffectiveEndDate() + { + return $this->container['effective_end_date']; + } + + /** + * Sets effective_end_date + * + * @param \DateTime $effective_end_date + * + * @return $this + */ + public function setEffectiveEndDate($effective_end_date) + { + $this->container['effective_end_date'] = $effective_end_date; + + return $this; + } + + + /** + * Gets end_action + * + * @return \Wallee\Sdk\Model\SubscriptionSuspensionAction + */ + public function getEndAction() + { + return $this->container['end_action']; + } + + /** + * Sets end_action + * + * @param \Wallee\Sdk\Model\SubscriptionSuspensionAction $end_action When the suspension reaches the planned end date the end action will be carried out. This action is only executed when the suspension is ended automatically based on the end date. + * + * @return $this + */ + public function setEndAction($end_action) + { + $this->container['end_action'] = $end_action; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets note + * + * @return string + */ + public function getNote() + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string $note The note may contain some internal information for the suspension. The note will not be disclosed to the subscriber. + * + * @return $this + */ + public function setNote($note) + { + $this->container['note'] = $note; + + return $this; + } + + + /** + * Gets period_bill + * + * @return int + */ + public function getPeriodBill() + { + return $this->container['period_bill']; + } + + /** + * Sets period_bill + * + * @param int $period_bill + * + * @return $this + */ + public function setPeriodBill($period_bill) + { + $this->container['period_bill'] = $period_bill; + + return $this; + } + + + /** + * Gets planned_end_date + * + * @return \DateTime + */ + public function getPlannedEndDate() + { + return $this->container['planned_end_date']; + } + + /** + * Sets planned_end_date + * + * @param \DateTime $planned_end_date The planned end date of the suspension identifies the date on which the suspension will be ended automatically. + * + * @return $this + */ + public function setPlannedEndDate($planned_end_date) + { + $this->container['planned_end_date'] = $planned_end_date; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets reason + * + * @return \Wallee\Sdk\Model\SubscriptionSuspensionReason + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param \Wallee\Sdk\Model\SubscriptionSuspensionReason $reason The suspension reason indicates why a suspension has been created. + * + * @return $this + */ + public function setReason($reason) + { + $this->container['reason'] = $reason; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\SubscriptionSuspensionState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\SubscriptionSuspensionState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets subscription + * + * @return int + */ + public function getSubscription() + { + return $this->container['subscription']; + } + + /** + * Sets subscription + * + * @param int $subscription + * + * @return $this + */ + public function setSubscription($subscription) + { + $this->container['subscription'] = $subscription; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/SubscriptionSuspensionAction.php b/wallee-sdk/lib/Model/SubscriptionSuspensionAction.php index c327025..b736bfa 100644 --- a/wallee-sdk/lib/Model/SubscriptionSuspensionAction.php +++ b/wallee-sdk/lib/Model/SubscriptionSuspensionAction.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\SubscriptionSuspensionAction', - 'note' => 'string', - 'plannedEndDate' => '\DateTime', - 'subscription' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * When the suspension reaches the planned end date the end action will be carried out. This action is only executed when the suspension is ended automatically based on the end date. - * - * @var \Wallee\Sdk\Model\SubscriptionSuspensionAction - */ - private $endAction; - - /** - * The note may contain some internal information for the suspension. The note will not be disclosed to the subscriber. - * - * @var string - */ - private $note; - - /** - * The planned end date of the suspension identifies the date on which the suspension will be ended automatically. - * - * @var \DateTime - */ - private $plannedEndDate; - - /** - * - * - * @var int - */ - private $subscription; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['endAction'])) { - $this->setEndAction($data['endAction']); - } - if (isset($data['note'])) { - $this->setNote($data['note']); - } - if (isset($data['plannedEndDate'])) { - $this->setPlannedEndDate($data['plannedEndDate']); - } - if (isset($data['subscription'])) { - $this->setSubscription($data['subscription']); - } - } - - - /** - * Returns endAction. - * - * When the suspension reaches the planned end date the end action will be carried out. This action is only executed when the suspension is ended automatically based on the end date. - * - * @return \Wallee\Sdk\Model\SubscriptionSuspensionAction - */ - public function getEndAction() { - return $this->endAction; - } - - /** - * Sets endAction. - * - * @param \Wallee\Sdk\Model\SubscriptionSuspensionAction $endAction - * @return SubscriptionSuspensionCreate - */ - public function setEndAction($endAction) { - $this->endAction = $endAction; - - return $this; - } - - /** - * Returns note. - * - * The note may contain some internal information for the suspension. The note will not be disclosed to the subscriber. - * - * @return string - */ - public function getNote() { - return $this->note; - } - - /** - * Sets note. - * - * @param string $note - * @return SubscriptionSuspensionCreate - */ - public function setNote($note) { - $this->note = $note; - - return $this; - } - - /** - * Returns plannedEndDate. - * - * The planned end date of the suspension identifies the date on which the suspension will be ended automatically. - * - * @return \DateTime - */ - public function getPlannedEndDate() { - return $this->plannedEndDate; - } - - /** - * Sets plannedEndDate. - * - * @param \DateTime $plannedEndDate - * @return SubscriptionSuspensionCreate - */ - public function setPlannedEndDate($plannedEndDate) { - $this->plannedEndDate = $plannedEndDate; - - return $this; - } - - /** - * Returns subscription. - * - * - * - * @return int - */ - public function getSubscription() { - return $this->subscription; - } - - /** - * Sets subscription. - * - * @param int $subscription - * @return SubscriptionSuspensionCreate - */ - public function setSubscription($subscription) { - $this->subscription = $subscription; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getEndAction() === null) { - throw new ValidationException("'endAction' can't be null", 'endAction', $this); - } - if ($this->getPlannedEndDate() === null) { - throw new ValidationException("'plannedEndDate' can't be null", 'plannedEndDate', $this); - } - if ($this->getSubscription() === null) { - throw new ValidationException("'subscription' can't be null", 'subscription', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionSuspensionCreate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionSuspension.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'end_action' => '\Wallee\Sdk\Model\SubscriptionSuspensionAction', + 'note' => 'string', + 'planned_end_date' => '\DateTime', + 'subscription' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'end_action' => null, + 'note' => null, + 'planned_end_date' => 'date-time', + 'subscription' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'end_action' => 'endAction', + 'note' => 'note', + 'planned_end_date' => 'plannedEndDate', + 'subscription' => 'subscription' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'end_action' => 'setEndAction', + 'note' => 'setNote', + 'planned_end_date' => 'setPlannedEndDate', + 'subscription' => 'setSubscription' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'end_action' => 'getEndAction', + 'note' => 'getNote', + 'planned_end_date' => 'getPlannedEndDate', + 'subscription' => 'getSubscription' + ]; + + + + /** + * 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['end_action'] = isset($data['end_action']) ? $data['end_action'] : null; + + $this->container['note'] = isset($data['note']) ? $data['note'] : null; + + $this->container['planned_end_date'] = isset($data['planned_end_date']) ? $data['planned_end_date'] : null; + + $this->container['subscription'] = isset($data['subscription']) ? $data['subscription'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['end_action'] === null) { + $invalidProperties[] = "'end_action' can't be null"; + } + if ($this->container['planned_end_date'] === null) { + $invalidProperties[] = "'planned_end_date' can't be null"; + } + if ($this->container['subscription'] === null) { + $invalidProperties[] = "'subscription' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 end_action + * + * @return \Wallee\Sdk\Model\SubscriptionSuspensionAction + */ + public function getEndAction() + { + return $this->container['end_action']; + } + + /** + * Sets end_action + * + * @param \Wallee\Sdk\Model\SubscriptionSuspensionAction $end_action When the suspension reaches the planned end date the end action will be carried out. This action is only executed when the suspension is ended automatically based on the end date. + * + * @return $this + */ + public function setEndAction($end_action) + { + $this->container['end_action'] = $end_action; + + return $this; + } + + + /** + * Gets note + * + * @return string + */ + public function getNote() + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string $note The note may contain some internal information for the suspension. The note will not be disclosed to the subscriber. + * + * @return $this + */ + public function setNote($note) + { + $this->container['note'] = $note; + + return $this; + } + + + /** + * Gets planned_end_date + * + * @return \DateTime + */ + public function getPlannedEndDate() + { + return $this->container['planned_end_date']; + } + + /** + * Sets planned_end_date + * + * @param \DateTime $planned_end_date The planned end date of the suspension identifies the date on which the suspension will be ended automatically. + * + * @return $this + */ + public function setPlannedEndDate($planned_end_date) + { + $this->container['planned_end_date'] = $planned_end_date; + + return $this; + } + + + /** + * Gets subscription + * + * @return int + */ + public function getSubscription() + { + return $this->container['subscription']; + } + + /** + * Sets subscription + * + * @param int $subscription + * + * @return $this + */ + public function setSubscription($subscription) + { + $this->container['subscription'] = $subscription; + + 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/wallee-sdk/lib/Model/SubscriptionSuspensionReason.php b/wallee-sdk/lib/Model/SubscriptionSuspensionReason.php index c9e645e..60814ef 100644 --- a/wallee-sdk/lib/Model/SubscriptionSuspensionReason.php +++ b/wallee-sdk/lib/Model/SubscriptionSuspensionReason.php @@ -1,10 +1,8 @@ validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class SubscriptionSuspensionRunning extends SubscriptionSuspension +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionSuspension.Running'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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; + } + + + /** + * 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/wallee-sdk/lib/Model/SubscriptionSuspensionState.php b/wallee-sdk/lib/Model/SubscriptionSuspensionState.php index 683ea14..aad84a3 100644 --- a/wallee-sdk/lib/Model/SubscriptionSuspensionState.php +++ b/wallee-sdk/lib/Model/SubscriptionSuspensionState.php @@ -1,10 +1,8 @@ 'int', - 'version' => 'int', - 'description' => 'string', - 'plannedTerminationDate' => '\DateTime' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - /** - * - * - * @var string - */ - private $description; - - /** - * - * - * @var \DateTime - */ - private $plannedTerminationDate; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['plannedTerminationDate'])) { - $this->setPlannedTerminationDate($data['plannedTerminationDate']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionUpdate - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriptionUpdate - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Returns description. - * - * - * - * @return string - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param string $description - * @return SubscriptionUpdate - */ - public function setDescription($description) { - $this->description = $description; - - return $this; - } - - /** - * Returns plannedTerminationDate. - * - * - * - * @return \DateTime - */ - public function getPlannedTerminationDate() { - return $this->plannedTerminationDate; - } - - /** - * Sets plannedTerminationDate. - * - * @param \DateTime $plannedTerminationDate - * @return SubscriptionUpdate - */ - public function setPlannedTerminationDate($plannedTerminationDate) { - $this->plannedTerminationDate = $plannedTerminationDate; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getId() === null) { - throw new ValidationException("'id' can't be null", 'id', $this); - } - if ($this->getVersion() === null) { - throw new ValidationException("'version' can't be null", 'version', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionUpdate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Subscription.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'version' => 'int', + 'affiliate' => 'int', + 'description' => 'string', + 'planned_termination_date' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64', + 'affiliate' => 'int64', + 'description' => null, + 'planned_termination_date' => 'date-time' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version', + 'affiliate' => 'affiliate', + 'description' => 'description', + 'planned_termination_date' => 'plannedTerminationDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion', + 'affiliate' => 'setAffiliate', + 'description' => 'setDescription', + 'planned_termination_date' => 'setPlannedTerminationDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion', + 'affiliate' => 'getAffiliate', + 'description' => 'getDescription', + 'planned_termination_date' => 'getPlannedTerminationDate' + ]; + + + + /** + * 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['version'] = isset($data['version']) ? $data['version'] : null; + + $this->container['affiliate'] = isset($data['affiliate']) ? $data['affiliate'] : null; + + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['planned_termination_date'] = isset($data['planned_termination_date']) ? $data['planned_termination_date'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + + /** + * Gets affiliate + * + * @return int + */ + public function getAffiliate() + { + return $this->container['affiliate']; + } + + /** + * Sets affiliate + * + * @param int $affiliate + * + * @return $this + */ + public function setAffiliate($affiliate) + { + $this->container['affiliate'] = $affiliate; + + return $this; + } + + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets planned_termination_date + * + * @return \DateTime + */ + public function getPlannedTerminationDate() + { + return $this->container['planned_termination_date']; + } + + /** + * Sets planned_termination_date + * + * @param \DateTime $planned_termination_date + * + * @return $this + */ + public function setPlannedTerminationDate($planned_termination_date) + { + $this->container['planned_termination_date'] = $planned_termination_date; + + 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/wallee-sdk/lib/Model/SubscriptionVersion.php b/wallee-sdk/lib/Model/SubscriptionVersion.php index f9c1525..d2a8ced 100644 --- a/wallee-sdk/lib/Model/SubscriptionVersion.php +++ b/wallee-sdk/lib/Model/SubscriptionVersion.php @@ -1,10 +1,8 @@ '\DateTime', - 'billingCurrency' => 'string', - 'createdOn' => '\DateTime', - 'expectedLastPeriodEnd' => '\DateTime', - 'failedOn' => '\DateTime', - 'id' => 'int', - 'language' => 'string', - 'linkedSpaceId' => 'int', - 'plannedPurgeDate' => '\DateTime', - 'plannedTerminationDate' => '\DateTime', - 'productVersion' => '\Wallee\Sdk\Model\SubscriptionProductVersion', - 'selectedComponents' => '\Wallee\Sdk\Model\SubscriptionProductComponent[]', - 'state' => '\Wallee\Sdk\Model\SubscriptionVersionState', - 'subscription' => '\Wallee\Sdk\Model\Subscription', - 'terminatedOn' => '\DateTime', - 'terminatingOn' => '\DateTime', - 'terminationIssuedOn' => '\DateTime', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \DateTime - */ - private $activatedOn; - - /** - * The subscriber is charged in the billing currency. The billing currency has to be one of the enabled currencies on the subscription product. - * - * @var string - */ - private $billingCurrency; - - /** - * - * - * @var \DateTime - */ - private $createdOn; - - /** - * The expected last period end is the date on which the projected end date of the last period is. This is only a projection and as such the actual date may be different. - * - * @var \DateTime - */ - private $expectedLastPeriodEnd; - - /** - * - * - * @var \DateTime - */ - private $failedOn; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var string - */ - private $language; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var \DateTime - */ - private $plannedTerminationDate; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionProductVersion - */ - private $productVersion; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionProductComponent[] - */ - private $selectedComponents; - - /** - * - * - * @var \Wallee\Sdk\Model\SubscriptionVersionState - */ - private $state; - - /** - * - * - * @var \Wallee\Sdk\Model\Subscription - */ - private $subscription; - - /** - * - * - * @var \DateTime - */ - private $terminatedOn; - - /** - * - * - * @var \DateTime - */ - private $terminatingOn; - - /** - * - * - * @var \DateTime - */ - private $terminationIssuedOn; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['productVersion'])) { - $this->setProductVersion($data['productVersion']); - } - if (isset($data['selectedComponents'])) { - $this->setSelectedComponents($data['selectedComponents']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['subscription'])) { - $this->setSubscription($data['subscription']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns activatedOn. - * - * - * - * @return \DateTime - */ - public function getActivatedOn() { - return $this->activatedOn; - } - - /** - * Sets activatedOn. - * - * @param \DateTime $activatedOn - * @return SubscriptionVersion - */ - protected function setActivatedOn($activatedOn) { - $this->activatedOn = $activatedOn; - - return $this; - } - - /** - * Returns billingCurrency. - * - * The subscriber is charged in the billing currency. The billing currency has to be one of the enabled currencies on the subscription product. - * - * @return string - */ - public function getBillingCurrency() { - return $this->billingCurrency; - } - - /** - * Sets billingCurrency. - * - * @param string $billingCurrency - * @return SubscriptionVersion - */ - protected function setBillingCurrency($billingCurrency) { - $this->billingCurrency = $billingCurrency; - - return $this; - } - - /** - * Returns createdOn. - * - * - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return SubscriptionVersion - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns expectedLastPeriodEnd. - * - * The expected last period end is the date on which the projected end date of the last period is. This is only a projection and as such the actual date may be different. - * - * @return \DateTime - */ - public function getExpectedLastPeriodEnd() { - return $this->expectedLastPeriodEnd; - } - - /** - * Sets expectedLastPeriodEnd. - * - * @param \DateTime $expectedLastPeriodEnd - * @return SubscriptionVersion - */ - protected function setExpectedLastPeriodEnd($expectedLastPeriodEnd) { - $this->expectedLastPeriodEnd = $expectedLastPeriodEnd; - - return $this; - } - - /** - * Returns failedOn. - * - * - * - * @return \DateTime - */ - public function getFailedOn() { - return $this->failedOn; - } - - /** - * Sets failedOn. - * - * @param \DateTime $failedOn - * @return SubscriptionVersion - */ - protected function setFailedOn($failedOn) { - $this->failedOn = $failedOn; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return SubscriptionVersion - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return SubscriptionVersion - */ - protected function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return SubscriptionVersion - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return SubscriptionVersion - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns plannedTerminationDate. - * - * - * - * @return \DateTime - */ - public function getPlannedTerminationDate() { - return $this->plannedTerminationDate; - } - - /** - * Sets plannedTerminationDate. - * - * @param \DateTime $plannedTerminationDate - * @return SubscriptionVersion - */ - protected function setPlannedTerminationDate($plannedTerminationDate) { - $this->plannedTerminationDate = $plannedTerminationDate; - - return $this; - } - - /** - * Returns productVersion. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionProductVersion - */ - public function getProductVersion() { - return $this->productVersion; - } - - /** - * Sets productVersion. - * - * @param \Wallee\Sdk\Model\SubscriptionProductVersion $productVersion - * @return SubscriptionVersion - */ - public function setProductVersion($productVersion) { - $this->productVersion = $productVersion; - - return $this; - } - - /** - * Returns selectedComponents. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionProductComponent[] - */ - public function getSelectedComponents() { - return $this->selectedComponents; - } - - /** - * Sets selectedComponents. - * - * @param \Wallee\Sdk\Model\SubscriptionProductComponent[] $selectedComponents - * @return SubscriptionVersion - */ - public function setSelectedComponents($selectedComponents) { - $this->selectedComponents = $selectedComponents; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\SubscriptionVersionState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\SubscriptionVersionState $state - * @return SubscriptionVersion - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns subscription. - * - * - * - * @return \Wallee\Sdk\Model\Subscription - */ - public function getSubscription() { - return $this->subscription; - } - - /** - * Sets subscription. - * - * @param \Wallee\Sdk\Model\Subscription $subscription - * @return SubscriptionVersion - */ - public function setSubscription($subscription) { - $this->subscription = $subscription; - - return $this; - } - - /** - * Returns terminatedOn. - * - * - * - * @return \DateTime - */ - public function getTerminatedOn() { - return $this->terminatedOn; - } - - /** - * Sets terminatedOn. - * - * @param \DateTime $terminatedOn - * @return SubscriptionVersion - */ - protected function setTerminatedOn($terminatedOn) { - $this->terminatedOn = $terminatedOn; - - return $this; - } - - /** - * Returns terminatingOn. - * - * - * - * @return \DateTime - */ - public function getTerminatingOn() { - return $this->terminatingOn; - } - - /** - * Sets terminatingOn. - * - * @param \DateTime $terminatingOn - * @return SubscriptionVersion - */ - protected function setTerminatingOn($terminatingOn) { - $this->terminatingOn = $terminatingOn; - - return $this; - } - - /** - * Returns terminationIssuedOn. - * - * - * - * @return \DateTime - */ - public function getTerminationIssuedOn() { - return $this->terminationIssuedOn; - } - - /** - * Sets terminationIssuedOn. - * - * @param \DateTime $terminationIssuedOn - * @return SubscriptionVersion - */ - protected function setTerminationIssuedOn($terminationIssuedOn) { - $this->terminationIssuedOn = $terminationIssuedOn; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return SubscriptionVersion - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class SubscriptionVersion implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'SubscriptionVersion'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'activated_on' => '\DateTime', + 'billing_currency' => 'string', + 'component_configurations' => '\Wallee\Sdk\Model\SubscriptionComponentConfiguration[]', + 'created_on' => '\DateTime', + 'expected_last_period_end' => '\DateTime', + 'failed_on' => '\DateTime', + 'id' => 'int', + 'language' => 'string', + 'linked_space_id' => 'int', + 'planned_purge_date' => '\DateTime', + 'planned_termination_date' => '\DateTime', + 'product_version' => '\Wallee\Sdk\Model\SubscriptionProductVersion', + 'selected_components' => '\Wallee\Sdk\Model\SubscriptionProductComponent[]', + 'state' => '\Wallee\Sdk\Model\SubscriptionVersionState', + 'subscription' => '\Wallee\Sdk\Model\Subscription', + 'terminated_on' => '\DateTime', + 'terminating_on' => '\DateTime', + 'termination_issued_on' => '\DateTime', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'activated_on' => 'date-time', + 'billing_currency' => null, + 'component_configurations' => null, + 'created_on' => 'date-time', + 'expected_last_period_end' => 'date-time', + 'failed_on' => 'date-time', + 'id' => 'int64', + 'language' => null, + 'linked_space_id' => 'int64', + 'planned_purge_date' => 'date-time', + 'planned_termination_date' => 'date-time', + 'product_version' => null, + 'selected_components' => null, + 'state' => null, + 'subscription' => null, + 'terminated_on' => 'date-time', + 'terminating_on' => 'date-time', + 'termination_issued_on' => 'date-time', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'activated_on' => 'activatedOn', + 'billing_currency' => 'billingCurrency', + 'component_configurations' => 'componentConfigurations', + 'created_on' => 'createdOn', + 'expected_last_period_end' => 'expectedLastPeriodEnd', + 'failed_on' => 'failedOn', + 'id' => 'id', + 'language' => 'language', + 'linked_space_id' => 'linkedSpaceId', + 'planned_purge_date' => 'plannedPurgeDate', + 'planned_termination_date' => 'plannedTerminationDate', + 'product_version' => 'productVersion', + 'selected_components' => 'selectedComponents', + 'state' => 'state', + 'subscription' => 'subscription', + 'terminated_on' => 'terminatedOn', + 'terminating_on' => 'terminatingOn', + 'termination_issued_on' => 'terminationIssuedOn', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'activated_on' => 'setActivatedOn', + 'billing_currency' => 'setBillingCurrency', + 'component_configurations' => 'setComponentConfigurations', + 'created_on' => 'setCreatedOn', + 'expected_last_period_end' => 'setExpectedLastPeriodEnd', + 'failed_on' => 'setFailedOn', + 'id' => 'setId', + 'language' => 'setLanguage', + 'linked_space_id' => 'setLinkedSpaceId', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'planned_termination_date' => 'setPlannedTerminationDate', + 'product_version' => 'setProductVersion', + 'selected_components' => 'setSelectedComponents', + 'state' => 'setState', + 'subscription' => 'setSubscription', + 'terminated_on' => 'setTerminatedOn', + 'terminating_on' => 'setTerminatingOn', + 'termination_issued_on' => 'setTerminationIssuedOn', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'activated_on' => 'getActivatedOn', + 'billing_currency' => 'getBillingCurrency', + 'component_configurations' => 'getComponentConfigurations', + 'created_on' => 'getCreatedOn', + 'expected_last_period_end' => 'getExpectedLastPeriodEnd', + 'failed_on' => 'getFailedOn', + 'id' => 'getId', + 'language' => 'getLanguage', + 'linked_space_id' => 'getLinkedSpaceId', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'planned_termination_date' => 'getPlannedTerminationDate', + 'product_version' => 'getProductVersion', + 'selected_components' => 'getSelectedComponents', + 'state' => 'getState', + 'subscription' => 'getSubscription', + 'terminated_on' => 'getTerminatedOn', + 'terminating_on' => 'getTerminatingOn', + 'termination_issued_on' => 'getTerminationIssuedOn', + 'version' => 'getVersion' + ]; + + + + /** + * 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['activated_on'] = isset($data['activated_on']) ? $data['activated_on'] : null; + + $this->container['billing_currency'] = isset($data['billing_currency']) ? $data['billing_currency'] : null; + + $this->container['component_configurations'] = isset($data['component_configurations']) ? $data['component_configurations'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['expected_last_period_end'] = isset($data['expected_last_period_end']) ? $data['expected_last_period_end'] : null; + + $this->container['failed_on'] = isset($data['failed_on']) ? $data['failed_on'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['planned_termination_date'] = isset($data['planned_termination_date']) ? $data['planned_termination_date'] : null; + + $this->container['product_version'] = isset($data['product_version']) ? $data['product_version'] : null; + + $this->container['selected_components'] = isset($data['selected_components']) ? $data['selected_components'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['subscription'] = isset($data['subscription']) ? $data['subscription'] : null; + + $this->container['terminated_on'] = isset($data['terminated_on']) ? $data['terminated_on'] : null; + + $this->container['terminating_on'] = isset($data['terminating_on']) ? $data['terminating_on'] : null; + + $this->container['termination_issued_on'] = isset($data['termination_issued_on']) ? $data['termination_issued_on'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 activated_on + * + * @return \DateTime + */ + public function getActivatedOn() + { + return $this->container['activated_on']; + } + + /** + * Sets activated_on + * + * @param \DateTime $activated_on + * + * @return $this + */ + public function setActivatedOn($activated_on) + { + $this->container['activated_on'] = $activated_on; + + return $this; + } + + + /** + * Gets billing_currency + * + * @return string + */ + public function getBillingCurrency() + { + return $this->container['billing_currency']; + } + + /** + * Sets billing_currency + * + * @param string $billing_currency The subscriber is charged in the billing currency. The billing currency has to be one of the enabled currencies on the subscription product. + * + * @return $this + */ + public function setBillingCurrency($billing_currency) + { + $this->container['billing_currency'] = $billing_currency; + + return $this; + } + + + /** + * Gets component_configurations + * + * @return \Wallee\Sdk\Model\SubscriptionComponentConfiguration[] + */ + public function getComponentConfigurations() + { + return $this->container['component_configurations']; + } + + /** + * Sets component_configurations + * + * @param \Wallee\Sdk\Model\SubscriptionComponentConfiguration[] $component_configurations + * + * @return $this + */ + public function setComponentConfigurations($component_configurations) + { + $this->container['component_configurations'] = $component_configurations; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets expected_last_period_end + * + * @return \DateTime + */ + public function getExpectedLastPeriodEnd() + { + return $this->container['expected_last_period_end']; + } + + /** + * Sets expected_last_period_end + * + * @param \DateTime $expected_last_period_end The expected last period end is the date on which the projected end date of the last period is. This is only a projection and as such the actual date may be different. + * + * @return $this + */ + public function setExpectedLastPeriodEnd($expected_last_period_end) + { + $this->container['expected_last_period_end'] = $expected_last_period_end; + + return $this; + } + + + /** + * Gets failed_on + * + * @return \DateTime + */ + public function getFailedOn() + { + return $this->container['failed_on']; + } + + /** + * Sets failed_on + * + * @param \DateTime $failed_on + * + * @return $this + */ + public function setFailedOn($failed_on) + { + $this->container['failed_on'] = $failed_on; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets planned_termination_date + * + * @return \DateTime + */ + public function getPlannedTerminationDate() + { + return $this->container['planned_termination_date']; + } + + /** + * Sets planned_termination_date + * + * @param \DateTime $planned_termination_date + * + * @return $this + */ + public function setPlannedTerminationDate($planned_termination_date) + { + $this->container['planned_termination_date'] = $planned_termination_date; + + return $this; + } + + + /** + * Gets product_version + * + * @return \Wallee\Sdk\Model\SubscriptionProductVersion + */ + public function getProductVersion() + { + return $this->container['product_version']; + } + + /** + * Sets product_version + * + * @param \Wallee\Sdk\Model\SubscriptionProductVersion $product_version + * + * @return $this + */ + public function setProductVersion($product_version) + { + $this->container['product_version'] = $product_version; + + return $this; + } + + + /** + * Gets selected_components + * + * @return \Wallee\Sdk\Model\SubscriptionProductComponent[] + */ + public function getSelectedComponents() + { + return $this->container['selected_components']; + } + + /** + * Sets selected_components + * + * @param \Wallee\Sdk\Model\SubscriptionProductComponent[] $selected_components + * + * @return $this + */ + public function setSelectedComponents($selected_components) + { + $this->container['selected_components'] = $selected_components; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\SubscriptionVersionState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\SubscriptionVersionState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets subscription + * + * @return \Wallee\Sdk\Model\Subscription + */ + public function getSubscription() + { + return $this->container['subscription']; + } + + /** + * Sets subscription + * + * @param \Wallee\Sdk\Model\Subscription $subscription + * + * @return $this + */ + public function setSubscription($subscription) + { + $this->container['subscription'] = $subscription; + + return $this; + } + + + /** + * Gets terminated_on + * + * @return \DateTime + */ + public function getTerminatedOn() + { + return $this->container['terminated_on']; + } + + /** + * Sets terminated_on + * + * @param \DateTime $terminated_on + * + * @return $this + */ + public function setTerminatedOn($terminated_on) + { + $this->container['terminated_on'] = $terminated_on; + + return $this; + } + + + /** + * Gets terminating_on + * + * @return \DateTime + */ + public function getTerminatingOn() + { + return $this->container['terminating_on']; + } + + /** + * Sets terminating_on + * + * @param \DateTime $terminating_on + * + * @return $this + */ + public function setTerminatingOn($terminating_on) + { + $this->container['terminating_on'] = $terminating_on; + + return $this; + } + + + /** + * Gets termination_issued_on + * + * @return \DateTime + */ + public function getTerminationIssuedOn() + { + return $this->container['termination_issued_on']; + } + + /** + * Sets termination_issued_on + * + * @param \DateTime $termination_issued_on + * + * @return $this + */ + public function setTerminationIssuedOn($termination_issued_on) + { + $this->container['termination_issued_on'] = $termination_issued_on; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/SubscriptionVersionState.php b/wallee-sdk/lib/Model/SubscriptionVersionState.php index 8dbe5ed..2d0631b 100644 --- a/wallee-sdk/lib/Model/SubscriptionVersionState.php +++ b/wallee-sdk/lib/Model/SubscriptionVersionState.php @@ -1,10 +1,8 @@ 'float', - 'title' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var float - */ - private $rate; - - /** - * - * - * @var string - */ - private $title; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - } - - - /** - * Returns rate. - * - * - * - * @return float - */ - public function getRate() { - return $this->rate; - } - - /** - * Sets rate. - * - * @param float $rate - * @return Tax - */ - protected function setRate($rate) { - $this->rate = $rate; - - return $this; - } - - /** - * Returns title. - * - * - * - * @return string - */ - public function getTitle() { - return $this->title; - } - - /** - * Sets title. - * - * @param string $title - * @return Tax - */ - protected function setTitle($title) { - $this->title = $title; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class Tax implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Tax'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'rate' => 'float', + 'title' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'rate' => null, + 'title' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rate' => 'rate', + 'title' => 'title' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rate' => 'setRate', + 'title' => 'setTitle' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rate' => 'getRate', + 'title' => 'getTitle' + ]; + + + + /** + * 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['rate'] = isset($data['rate']) ? $data['rate'] : null; + + $this->container['title'] = isset($data['title']) ? $data['title'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 rate + * + * @return float + */ + public function getRate() + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float $rate + * + * @return $this + */ + public function setRate($rate) + { + $this->container['rate'] = $rate; + + return $this; + } + + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title + * + * @return $this + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + 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/wallee-sdk/lib/Model/TaxClass.php b/wallee-sdk/lib/Model/TaxClass.php index 060849f..54f0c15 100644 --- a/wallee-sdk/lib/Model/TaxClass.php +++ b/wallee-sdk/lib/Model/TaxClass.php @@ -1,10 +1,8 @@ 'int', - 'linkedSpaceId' => 'int', - 'name' => 'string', - 'plannedPurgeDate' => '\DateTime', - 'spaceId' => 'int', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The tax class name is used internally to identify the tax class in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var int - */ - private $spaceId; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return TaxClass - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return TaxClass - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * The tax class name is used internally to identify the tax class in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return TaxClass - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return TaxClass - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns spaceId. - * - * - * - * @return int - */ - public function getSpaceId() { - return $this->spaceId; - } - - /** - * Sets spaceId. - * - * @param int $spaceId - * @return TaxClass - */ - protected function setSpaceId($spaceId) { - $this->spaceId = $spaceId; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return TaxClass - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return TaxClass - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class TaxClass implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'TaxClass'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'linked_space_id' => 'int', + 'name' => 'string', + 'planned_purge_date' => '\DateTime', + 'space_id' => 'int', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'name' => null, + 'planned_purge_date' => 'date-time', + 'space_id' => 'int64', + 'state' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'planned_purge_date' => 'plannedPurgeDate', + 'space_id' => 'spaceId', + 'state' => 'state', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'space_id' => 'setSpaceId', + 'state' => 'setState', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'space_id' => 'getSpaceId', + 'state' => 'getState', + 'version' => 'getVersion' + ]; + + + + /** + * 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['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['space_id'] = isset($data['space_id']) ? $data['space_id'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The tax class name is used internally to identify the tax class in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets space_id + * + * @return int + */ + public function getSpaceId() + { + return $this->container['space_id']; + } + + /** + * Sets space_id + * + * @param int $space_id + * + * @return $this + */ + public function setSpaceId($space_id) + { + $this->container['space_id'] = $space_id; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/TaxCreate.php b/wallee-sdk/lib/Model/TaxCreate.php index 2d8d48c..62cd987 100644 --- a/wallee-sdk/lib/Model/TaxCreate.php +++ b/wallee-sdk/lib/Model/TaxCreate.php @@ -1,10 +1,8 @@ 'float', - 'title' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var float - */ - private $rate; - - /** - * - * - * @var string - */ - private $title; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['rate'])) { - $this->setRate($data['rate']); - } - if (isset($data['title'])) { - $this->setTitle($data['title']); - } - } - - - /** - * Returns rate. - * - * - * - * @return float - */ - public function getRate() { - return $this->rate; - } - - /** - * Sets rate. - * - * @param float $rate - * @return TaxCreate - */ - public function setRate($rate) { - $this->rate = $rate; - - return $this; - } - - /** - * Returns title. - * - * - * - * @return string - */ - public function getTitle() { - return $this->title; - } - - /** - * Sets title. - * - * @param string $title - * @return TaxCreate - */ - public function setTitle($title) { - $this->title = $title; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getRate() === null) { - throw new ValidationException("'rate' can't be null", 'rate', $this); - } - if ($this->getTitle() === null) { - throw new ValidationException("'title' can't be null", 'title', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class TaxCreate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Tax.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'rate' => 'float', + 'title' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'rate' => null, + 'title' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rate' => 'rate', + 'title' => 'title' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rate' => 'setRate', + 'title' => 'setTitle' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rate' => 'getRate', + 'title' => 'getTitle' + ]; + + + + /** + * 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['rate'] = isset($data['rate']) ? $data['rate'] : null; + + $this->container['title'] = isset($data['title']) ? $data['title'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rate'] === null) { + $invalidProperties[] = "'rate' can't be null"; + } + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 rate + * + * @return float + */ + public function getRate() + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float $rate + * + * @return $this + */ + public function setRate($rate) + { + $this->container['rate'] = $rate; + + return $this; + } + + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title + * + * @return $this + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + 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/wallee-sdk/lib/Model/TenantDatabase.php b/wallee-sdk/lib/Model/TenantDatabase.php index 4bcd3b1..1c38e1e 100644 --- a/wallee-sdk/lib/Model/TenantDatabase.php +++ b/wallee-sdk/lib/Model/TenantDatabase.php @@ -1,10 +1,8 @@ 'int', - 'name' => 'string', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The name of the database. - * - * @var string - */ - private $name; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return TenantDatabase - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * The name of the database. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return TenantDatabase - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return TenantDatabase - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class TenantDatabase implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'TenantDatabase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'name' => 'string', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'name' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'version' => 'getVersion' + ]; + + + + /** + * 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['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the database. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/Token.php b/wallee-sdk/lib/Model/Token.php index 1134013..068349d 100644 --- a/wallee-sdk/lib/Model/Token.php +++ b/wallee-sdk/lib/Model/Token.php @@ -1,10 +1,8 @@ '\DateTime', - 'customerEmailAddress' => 'string', - 'customerId' => 'string', - 'enabledForOneClickPayment' => 'bool', - 'externalId' => 'string', - 'id' => 'int', - 'language' => 'string', - 'linkedSpaceId' => 'int', - 'plannedPurgeDate' => '\DateTime', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'timeZone' => 'string', - 'tokenReference' => 'string', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The created on date indicates the date on which the entity was stored into the database. - * - * @var \DateTime - */ - private $createdOn; - - /** - * The customer email address is the email address of the customer. - * - * @var string - */ - private $customerEmailAddress; - - /** - * The customer ID identifies the customer in the merchant system. In case the customer ID has been provided it has to correspond with the customer ID provided on the transaction. The customer ID will not be changed automatically. The merchant system has to provide it. - * - * @var string - */ - private $customerId; - - /** - * When a token is enabled for one-click payments the buyer will be able to select the token within the iFrame or on the payment page to pay with the token. The usage of the token will reduce the number of steps the buyer has to go through. The buyer is linked via the customer ID on the transaction with the token. Means the token will be visible for buyers with the same customer ID. Additionally the payment method has to be configured to allow the one-click payments. - * - * @var bool - */ - private $enabledForOneClickPayment; - - /** - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @var string - */ - private $externalId; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var string - */ - private $language; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The time zone defines in which time zone the customer is located in. The time zone may affects how dates are formatted when interacting with the customer. - * - * @var string - */ - private $timeZone; - - /** - * Use something that it is easy to identify and may help you find the token (e.g. customer id, email address). - * - * @var string - */ - private $tokenReference; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns createdOn. - * - * The created on date indicates the date on which the entity was stored into the database. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return Token - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns customerEmailAddress. - * - * The customer email address is the email address of the customer. - * - * @return string - */ - public function getCustomerEmailAddress() { - return $this->customerEmailAddress; - } - - /** - * Sets customerEmailAddress. - * - * @param string $customerEmailAddress - * @return Token - */ - protected function setCustomerEmailAddress($customerEmailAddress) { - $this->customerEmailAddress = $customerEmailAddress; - - return $this; - } - - /** - * Returns customerId. - * - * The customer ID identifies the customer in the merchant system. In case the customer ID has been provided it has to correspond with the customer ID provided on the transaction. The customer ID will not be changed automatically. The merchant system has to provide it. - * - * @return string - */ - public function getCustomerId() { - return $this->customerId; - } - - /** - * Sets customerId. - * - * @param string $customerId - * @return Token - */ - protected function setCustomerId($customerId) { - $this->customerId = $customerId; - - return $this; - } - - /** - * Returns enabledForOneClickPayment. - * - * When a token is enabled for one-click payments the buyer will be able to select the token within the iFrame or on the payment page to pay with the token. The usage of the token will reduce the number of steps the buyer has to go through. The buyer is linked via the customer ID on the transaction with the token. Means the token will be visible for buyers with the same customer ID. Additionally the payment method has to be configured to allow the one-click payments. - * - * @return bool - */ - public function getEnabledForOneClickPayment() { - return $this->enabledForOneClickPayment; - } - - /** - * Sets enabledForOneClickPayment. - * - * @param bool $enabledForOneClickPayment - * @return Token - */ - protected function setEnabledForOneClickPayment($enabledForOneClickPayment) { - $this->enabledForOneClickPayment = $enabledForOneClickPayment; - - return $this; - } - - /** - * Returns externalId. - * - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @return string - */ - public function getExternalId() { - return $this->externalId; - } - - /** - * Sets externalId. - * - * @param string $externalId - * @return Token - */ - protected function setExternalId($externalId) { - $this->externalId = $externalId; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return Token - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return Token - */ - protected function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return Token - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return Token - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return Token - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns timeZone. - * - * The time zone defines in which time zone the customer is located in. The time zone may affects how dates are formatted when interacting with the customer. - * - * @return string - */ - public function getTimeZone() { - return $this->timeZone; - } - - /** - * Sets timeZone. - * - * @param string $timeZone - * @return Token - */ - protected function setTimeZone($timeZone) { - $this->timeZone = $timeZone; - - return $this; - } - - /** - * Returns tokenReference. - * - * Use something that it is easy to identify and may help you find the token (e.g. customer id, email address). - * - * @return string - */ - public function getTokenReference() { - return $this->tokenReference; - } - - /** - * Sets tokenReference. - * - * @param string $tokenReference - * @return Token - */ - protected function setTokenReference($tokenReference) { - $this->tokenReference = $tokenReference; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return Token - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class Token implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Token'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'created_on' => '\DateTime', + 'customer_email_address' => 'string', + 'customer_id' => 'string', + 'enabled_for_one_click_payment' => 'bool', + 'external_id' => 'string', + 'id' => 'int', + 'language' => 'string', + 'linked_space_id' => 'int', + 'planned_purge_date' => '\DateTime', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'time_zone' => 'string', + 'token_reference' => 'string', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'created_on' => 'date-time', + 'customer_email_address' => null, + 'customer_id' => null, + 'enabled_for_one_click_payment' => null, + 'external_id' => null, + 'id' => 'int64', + 'language' => null, + 'linked_space_id' => 'int64', + 'planned_purge_date' => 'date-time', + 'state' => null, + 'time_zone' => null, + 'token_reference' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'created_on' => 'createdOn', + 'customer_email_address' => 'customerEmailAddress', + 'customer_id' => 'customerId', + 'enabled_for_one_click_payment' => 'enabledForOneClickPayment', + 'external_id' => 'externalId', + 'id' => 'id', + 'language' => 'language', + 'linked_space_id' => 'linkedSpaceId', + 'planned_purge_date' => 'plannedPurgeDate', + 'state' => 'state', + 'time_zone' => 'timeZone', + 'token_reference' => 'tokenReference', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'created_on' => 'setCreatedOn', + 'customer_email_address' => 'setCustomerEmailAddress', + 'customer_id' => 'setCustomerId', + 'enabled_for_one_click_payment' => 'setEnabledForOneClickPayment', + 'external_id' => 'setExternalId', + 'id' => 'setId', + 'language' => 'setLanguage', + 'linked_space_id' => 'setLinkedSpaceId', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'state' => 'setState', + 'time_zone' => 'setTimeZone', + 'token_reference' => 'setTokenReference', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'created_on' => 'getCreatedOn', + 'customer_email_address' => 'getCustomerEmailAddress', + 'customer_id' => 'getCustomerId', + 'enabled_for_one_click_payment' => 'getEnabledForOneClickPayment', + 'external_id' => 'getExternalId', + 'id' => 'getId', + 'language' => 'getLanguage', + 'linked_space_id' => 'getLinkedSpaceId', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'state' => 'getState', + 'time_zone' => 'getTimeZone', + 'token_reference' => 'getTokenReference', + 'version' => 'getVersion' + ]; + + + + /** + * 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['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['customer_email_address'] = isset($data['customer_email_address']) ? $data['customer_email_address'] : null; + + $this->container['customer_id'] = isset($data['customer_id']) ? $data['customer_id'] : null; + + $this->container['enabled_for_one_click_payment'] = isset($data['enabled_for_one_click_payment']) ? $data['enabled_for_one_click_payment'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['time_zone'] = isset($data['time_zone']) ? $data['time_zone'] : null; + + $this->container['token_reference'] = isset($data['token_reference']) ? $data['token_reference'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets customer_email_address + * + * @return string + */ + public function getCustomerEmailAddress() + { + return $this->container['customer_email_address']; + } + + /** + * Sets customer_email_address + * + * @param string $customer_email_address The customer email address is the email address of the customer. + * + * @return $this + */ + public function setCustomerEmailAddress($customer_email_address) + { + $this->container['customer_email_address'] = $customer_email_address; + + return $this; + } + + + /** + * Gets customer_id + * + * @return string + */ + public function getCustomerId() + { + return $this->container['customer_id']; + } + + /** + * Sets customer_id + * + * @param string $customer_id The customer ID identifies the customer in the merchant system. In case the customer ID has been provided it has to correspond with the customer ID provided on the transaction. The customer ID will not be changed automatically. The merchant system has to provide it. + * + * @return $this + */ + public function setCustomerId($customer_id) + { + $this->container['customer_id'] = $customer_id; + + return $this; + } + + + /** + * Gets enabled_for_one_click_payment + * + * @return bool + */ + public function getEnabledForOneClickPayment() + { + return $this->container['enabled_for_one_click_payment']; + } + + /** + * Sets enabled_for_one_click_payment + * + * @param bool $enabled_for_one_click_payment When a token is enabled for one-click payments the buyer will be able to select the token within the iFrame or on the payment page to pay with the token. The usage of the token will reduce the number of steps the buyer has to go through. The buyer is linked via the customer ID on the transaction with the token. Means the token will be visible for buyers with the same customer ID. Additionally the payment method has to be configured to allow the one-click payments. + * + * @return $this + */ + public function setEnabledForOneClickPayment($enabled_for_one_click_payment) + { + $this->container['enabled_for_one_click_payment'] = $enabled_for_one_click_payment; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets time_zone + * + * @return string + */ + public function getTimeZone() + { + return $this->container['time_zone']; + } + + /** + * Sets time_zone + * + * @param string $time_zone The time zone defines in which time zone the customer is located in. The time zone may affects how dates are formatted when interacting with the customer. + * + * @return $this + */ + public function setTimeZone($time_zone) + { + $this->container['time_zone'] = $time_zone; + + return $this; + } + + + /** + * Gets token_reference + * + * @return string + */ + public function getTokenReference() + { + return $this->container['token_reference']; + } + + /** + * Sets token_reference + * + * @param string $token_reference Use something that it is easy to identify and may help you find the token (e.g. customer id, email address). + * + * @return $this + */ + public function setTokenReference($token_reference) + { + $this->container['token_reference'] = $token_reference; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/TokenCreate.php b/wallee-sdk/lib/Model/TokenCreate.php index 4106ee7..84a9a55 100644 --- a/wallee-sdk/lib/Model/TokenCreate.php +++ b/wallee-sdk/lib/Model/TokenCreate.php @@ -1,10 +1,8 @@ 'string', - 'state' => '\Wallee\Sdk\Model\CreationEntityState' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @var string - */ - private $externalId; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['externalId'])) { - $this->setExternalId($data['externalId']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - } - - - /** - * Returns externalId. - * - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @return string - */ - public function getExternalId() { - return $this->externalId; - } - - /** - * Sets externalId. - * - * @param string $externalId - * @return TokenCreate - */ - public function setExternalId($externalId) { - $this->externalId = $externalId; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return TokenCreate - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - if ($this->getExternalId() === null) { - throw new ValidationException("'externalId' can't be null", 'externalId', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class TokenCreate extends AbstractTokenUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Token.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'external_id' => 'string', + 'state' => '\Wallee\Sdk\Model\CreationEntityState' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'external_id' => null, + 'state' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'external_id' => 'externalId', + 'state' => 'state' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'external_id' => 'setExternalId', + 'state' => 'setState' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'external_id' => 'getExternalId', + 'state' => 'getState' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['external_id'] === null) { + $invalidProperties[] = "'external_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + 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/wallee-sdk/lib/Model/TokenUpdate.php b/wallee-sdk/lib/Model/TokenUpdate.php index 22a535c..7d78e7e 100644 --- a/wallee-sdk/lib/Model/TokenUpdate.php +++ b/wallee-sdk/lib/Model/TokenUpdate.php @@ -1,10 +1,8 @@ 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return TokenUpdate - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return TokenUpdate - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - if ($this->getId() === null) { - throw new ValidationException("'id' can't be null", 'id', $this); - } - if ($this->getVersion() === null) { - throw new ValidationException("'version' can't be null", 'version', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class TokenUpdate extends AbstractTokenUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Token.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/TokenVersion.php b/wallee-sdk/lib/Model/TokenVersion.php index 092641e..ee42036 100644 --- a/wallee-sdk/lib/Model/TokenVersion.php +++ b/wallee-sdk/lib/Model/TokenVersion.php @@ -1,10 +1,8 @@ '\DateTime', - 'billingAddress' => '\Wallee\Sdk\Model\Address', - 'createdOn' => '\DateTime', - 'environment' => '\Wallee\Sdk\Model\ChargeAttemptEnvironment', - 'expiresOn' => '\DateTime', - 'id' => 'int', - 'labels' => '\Wallee\Sdk\Model\Label[]', - 'language' => 'string', - 'linkedSpaceId' => 'int', - 'name' => 'string', - 'obsoletedOn' => '\DateTime', - 'paymentConnectorConfiguration' => '\Wallee\Sdk\Model\PaymentConnectorConfiguration', - 'plannedPurgeDate' => '\DateTime', - 'processorToken' => 'string', - 'shippingAddress' => '\Wallee\Sdk\Model\Address', - 'state' => '\Wallee\Sdk\Model\TokenVersionState', - 'token' => '\Wallee\Sdk\Model\Token', - 'type' => '\Wallee\Sdk\Model\TokenVersionType', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \DateTime - */ - private $activatedOn; - - /** - * - * - * @var \Wallee\Sdk\Model\Address - */ - private $billingAddress; - - /** - * The created on date indicates the date on which the entity was stored into the database. - * - * @var \DateTime - */ - private $createdOn; - - /** - * - * - * @var \Wallee\Sdk\Model\ChargeAttemptEnvironment - */ - private $environment; - - /** - * The expires on date indicates when token version expires. Once this date is reached the token version is marked as obsolete. - * - * @var \DateTime - */ - private $expiresOn; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var \Wallee\Sdk\Model\Label[] - */ - private $labels; - - /** - * - * - * @var string - */ - private $language; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * - * - * @var string - */ - private $name; - - /** - * - * - * @var \DateTime - */ - private $obsoletedOn; - - /** - * - * - * @var \Wallee\Sdk\Model\PaymentConnectorConfiguration - */ - private $paymentConnectorConfiguration; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var string - */ - private $processorToken; - - /** - * - * - * @var \Wallee\Sdk\Model\Address - */ - private $shippingAddress; - - /** - * - * - * @var \Wallee\Sdk\Model\TokenVersionState - */ - private $state; - - /** - * - * - * @var \Wallee\Sdk\Model\Token - */ - private $token; - - /** - * The token version type determines what kind of token it is and by which payment connector the token can be processed by. - * - * @var \Wallee\Sdk\Model\TokenVersionType - */ - private $type; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['billingAddress'])) { - $this->setBillingAddress($data['billingAddress']); - } - if (isset($data['environment'])) { - $this->setEnvironment($data['environment']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['labels'])) { - $this->setLabels($data['labels']); - } - if (isset($data['paymentConnectorConfiguration'])) { - $this->setPaymentConnectorConfiguration($data['paymentConnectorConfiguration']); - } - if (isset($data['shippingAddress'])) { - $this->setShippingAddress($data['shippingAddress']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['token'])) { - $this->setToken($data['token']); - } - if (isset($data['type'])) { - $this->setType($data['type']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns activatedOn. - * - * - * - * @return \DateTime - */ - public function getActivatedOn() { - return $this->activatedOn; - } - - /** - * Sets activatedOn. - * - * @param \DateTime $activatedOn - * @return TokenVersion - */ - protected function setActivatedOn($activatedOn) { - $this->activatedOn = $activatedOn; - - return $this; - } - - /** - * Returns billingAddress. - * - * - * - * @return \Wallee\Sdk\Model\Address - */ - public function getBillingAddress() { - return $this->billingAddress; - } - - /** - * Sets billingAddress. - * - * @param \Wallee\Sdk\Model\Address $billingAddress - * @return TokenVersion - */ - public function setBillingAddress($billingAddress) { - $this->billingAddress = $billingAddress; - - return $this; - } - - /** - * Returns createdOn. - * - * The created on date indicates the date on which the entity was stored into the database. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return TokenVersion - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns environment. - * - * - * - * @return \Wallee\Sdk\Model\ChargeAttemptEnvironment - */ - public function getEnvironment() { - return $this->environment; - } - - /** - * Sets environment. - * - * @param \Wallee\Sdk\Model\ChargeAttemptEnvironment $environment - * @return TokenVersion - */ - public function setEnvironment($environment) { - $this->environment = $environment; - - return $this; - } - - /** - * Returns expiresOn. - * - * The expires on date indicates when token version expires. Once this date is reached the token version is marked as obsolete. - * - * @return \DateTime - */ - public function getExpiresOn() { - return $this->expiresOn; - } - - /** - * Sets expiresOn. - * - * @param \DateTime $expiresOn - * @return TokenVersion - */ - protected function setExpiresOn($expiresOn) { - $this->expiresOn = $expiresOn; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return TokenVersion - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns labels. - * - * - * - * @return \Wallee\Sdk\Model\Label[] - */ - public function getLabels() { - return $this->labels; - } - - /** - * Sets labels. - * - * @param \Wallee\Sdk\Model\Label[] $labels - * @return TokenVersion - */ - public function setLabels($labels) { - $this->labels = $labels; - - return $this; - } - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return TokenVersion - */ - protected function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return TokenVersion - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return TokenVersion - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns obsoletedOn. - * - * - * - * @return \DateTime - */ - public function getObsoletedOn() { - return $this->obsoletedOn; - } - - /** - * Sets obsoletedOn. - * - * @param \DateTime $obsoletedOn - * @return TokenVersion - */ - protected function setObsoletedOn($obsoletedOn) { - $this->obsoletedOn = $obsoletedOn; - - return $this; - } - - /** - * Returns paymentConnectorConfiguration. - * - * - * - * @return \Wallee\Sdk\Model\PaymentConnectorConfiguration - */ - public function getPaymentConnectorConfiguration() { - return $this->paymentConnectorConfiguration; - } - - /** - * Sets paymentConnectorConfiguration. - * - * @param \Wallee\Sdk\Model\PaymentConnectorConfiguration $paymentConnectorConfiguration - * @return TokenVersion - */ - public function setPaymentConnectorConfiguration($paymentConnectorConfiguration) { - $this->paymentConnectorConfiguration = $paymentConnectorConfiguration; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return TokenVersion - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns processorToken. - * - * - * - * @return string - */ - public function getProcessorToken() { - return $this->processorToken; - } - - /** - * Sets processorToken. - * - * @param string $processorToken - * @return TokenVersion - */ - protected function setProcessorToken($processorToken) { - $this->processorToken = $processorToken; - - return $this; - } - - /** - * Returns shippingAddress. - * - * - * - * @return \Wallee\Sdk\Model\Address - */ - public function getShippingAddress() { - return $this->shippingAddress; - } - - /** - * Sets shippingAddress. - * - * @param \Wallee\Sdk\Model\Address $shippingAddress - * @return TokenVersion - */ - public function setShippingAddress($shippingAddress) { - $this->shippingAddress = $shippingAddress; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\TokenVersionState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\TokenVersionState $state - * @return TokenVersion - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns token. - * - * - * - * @return \Wallee\Sdk\Model\Token - */ - public function getToken() { - return $this->token; - } - - /** - * Sets token. - * - * @param \Wallee\Sdk\Model\Token $token - * @return TokenVersion - */ - public function setToken($token) { - $this->token = $token; - - return $this; - } - - /** - * Returns type. - * - * The token version type determines what kind of token it is and by which payment connector the token can be processed by. - * - * @return \Wallee\Sdk\Model\TokenVersionType - */ - public function getType() { - return $this->type; - } - - /** - * Sets type. - * - * @param \Wallee\Sdk\Model\TokenVersionType $type - * @return TokenVersion - */ - public function setType($type) { - $this->type = $type; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return TokenVersion - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class TokenVersion implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'TokenVersion'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'activated_on' => '\DateTime', + 'billing_address' => '\Wallee\Sdk\Model\Address', + 'created_on' => '\DateTime', + 'environment' => '\Wallee\Sdk\Model\ChargeAttemptEnvironment', + 'expires_on' => '\DateTime', + 'id' => 'int', + 'labels' => '\Wallee\Sdk\Model\Label[]', + 'language' => 'string', + 'linked_space_id' => 'int', + 'name' => 'string', + 'obsoleted_on' => '\DateTime', + 'payment_connector_configuration' => '\Wallee\Sdk\Model\PaymentConnectorConfiguration', + 'payment_method' => 'int', + 'payment_method_brand' => 'int', + 'planned_purge_date' => '\DateTime', + 'processor_token' => 'string', + 'shipping_address' => '\Wallee\Sdk\Model\Address', + 'state' => '\Wallee\Sdk\Model\TokenVersionState', + 'token' => '\Wallee\Sdk\Model\Token', + 'type' => '\Wallee\Sdk\Model\TokenVersionType', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'activated_on' => 'date-time', + 'billing_address' => null, + 'created_on' => 'date-time', + 'environment' => null, + 'expires_on' => 'date-time', + 'id' => 'int64', + 'labels' => null, + 'language' => null, + 'linked_space_id' => 'int64', + 'name' => null, + 'obsoleted_on' => 'date-time', + 'payment_connector_configuration' => null, + 'payment_method' => 'int64', + 'payment_method_brand' => 'int64', + 'planned_purge_date' => 'date-time', + 'processor_token' => null, + 'shipping_address' => null, + 'state' => null, + 'token' => null, + 'type' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'activated_on' => 'activatedOn', + 'billing_address' => 'billingAddress', + 'created_on' => 'createdOn', + 'environment' => 'environment', + 'expires_on' => 'expiresOn', + 'id' => 'id', + 'labels' => 'labels', + 'language' => 'language', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'obsoleted_on' => 'obsoletedOn', + 'payment_connector_configuration' => 'paymentConnectorConfiguration', + 'payment_method' => 'paymentMethod', + 'payment_method_brand' => 'paymentMethodBrand', + 'planned_purge_date' => 'plannedPurgeDate', + 'processor_token' => 'processorToken', + 'shipping_address' => 'shippingAddress', + 'state' => 'state', + 'token' => 'token', + 'type' => 'type', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'activated_on' => 'setActivatedOn', + 'billing_address' => 'setBillingAddress', + 'created_on' => 'setCreatedOn', + 'environment' => 'setEnvironment', + 'expires_on' => 'setExpiresOn', + 'id' => 'setId', + 'labels' => 'setLabels', + 'language' => 'setLanguage', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'obsoleted_on' => 'setObsoletedOn', + 'payment_connector_configuration' => 'setPaymentConnectorConfiguration', + 'payment_method' => 'setPaymentMethod', + 'payment_method_brand' => 'setPaymentMethodBrand', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'processor_token' => 'setProcessorToken', + 'shipping_address' => 'setShippingAddress', + 'state' => 'setState', + 'token' => 'setToken', + 'type' => 'setType', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'activated_on' => 'getActivatedOn', + 'billing_address' => 'getBillingAddress', + 'created_on' => 'getCreatedOn', + 'environment' => 'getEnvironment', + 'expires_on' => 'getExpiresOn', + 'id' => 'getId', + 'labels' => 'getLabels', + 'language' => 'getLanguage', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'obsoleted_on' => 'getObsoletedOn', + 'payment_connector_configuration' => 'getPaymentConnectorConfiguration', + 'payment_method' => 'getPaymentMethod', + 'payment_method_brand' => 'getPaymentMethodBrand', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'processor_token' => 'getProcessorToken', + 'shipping_address' => 'getShippingAddress', + 'state' => 'getState', + 'token' => 'getToken', + 'type' => 'getType', + 'version' => 'getVersion' + ]; + + + + /** + * 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['activated_on'] = isset($data['activated_on']) ? $data['activated_on'] : null; + + $this->container['billing_address'] = isset($data['billing_address']) ? $data['billing_address'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['environment'] = isset($data['environment']) ? $data['environment'] : null; + + $this->container['expires_on'] = isset($data['expires_on']) ? $data['expires_on'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['labels'] = isset($data['labels']) ? $data['labels'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['obsoleted_on'] = isset($data['obsoleted_on']) ? $data['obsoleted_on'] : null; + + $this->container['payment_connector_configuration'] = isset($data['payment_connector_configuration']) ? $data['payment_connector_configuration'] : null; + + $this->container['payment_method'] = isset($data['payment_method']) ? $data['payment_method'] : null; + + $this->container['payment_method_brand'] = isset($data['payment_method_brand']) ? $data['payment_method_brand'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['processor_token'] = isset($data['processor_token']) ? $data['processor_token'] : null; + + $this->container['shipping_address'] = isset($data['shipping_address']) ? $data['shipping_address'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['token'] = isset($data['token']) ? $data['token'] : null; + + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 activated_on + * + * @return \DateTime + */ + public function getActivatedOn() + { + return $this->container['activated_on']; + } + + /** + * Sets activated_on + * + * @param \DateTime $activated_on + * + * @return $this + */ + public function setActivatedOn($activated_on) + { + $this->container['activated_on'] = $activated_on; + + return $this; + } + + + /** + * Gets billing_address + * + * @return \Wallee\Sdk\Model\Address + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Wallee\Sdk\Model\Address $billing_address + * + * @return $this + */ + public function setBillingAddress($billing_address) + { + $this->container['billing_address'] = $billing_address; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets environment + * + * @return \Wallee\Sdk\Model\ChargeAttemptEnvironment + */ + public function getEnvironment() + { + return $this->container['environment']; + } + + /** + * Sets environment + * + * @param \Wallee\Sdk\Model\ChargeAttemptEnvironment $environment + * + * @return $this + */ + public function setEnvironment($environment) + { + $this->container['environment'] = $environment; + + return $this; + } + + + /** + * Gets expires_on + * + * @return \DateTime + */ + public function getExpiresOn() + { + return $this->container['expires_on']; + } + + /** + * Sets expires_on + * + * @param \DateTime $expires_on The expires on date indicates when token version expires. Once this date is reached the token version is marked as obsolete. + * + * @return $this + */ + public function setExpiresOn($expires_on) + { + $this->container['expires_on'] = $expires_on; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets labels + * + * @return \Wallee\Sdk\Model\Label[] + */ + public function getLabels() + { + return $this->container['labels']; + } + + /** + * Sets labels + * + * @param \Wallee\Sdk\Model\Label[] $labels + * + * @return $this + */ + public function setLabels($labels) + { + $this->container['labels'] = $labels; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets obsoleted_on + * + * @return \DateTime + */ + public function getObsoletedOn() + { + return $this->container['obsoleted_on']; + } + + /** + * Sets obsoleted_on + * + * @param \DateTime $obsoleted_on + * + * @return $this + */ + public function setObsoletedOn($obsoleted_on) + { + $this->container['obsoleted_on'] = $obsoleted_on; + + return $this; + } + + + /** + * Gets payment_connector_configuration + * + * @return \Wallee\Sdk\Model\PaymentConnectorConfiguration + */ + public function getPaymentConnectorConfiguration() + { + return $this->container['payment_connector_configuration']; + } + + /** + * Sets payment_connector_configuration + * + * @param \Wallee\Sdk\Model\PaymentConnectorConfiguration $payment_connector_configuration + * + * @return $this + */ + public function setPaymentConnectorConfiguration($payment_connector_configuration) + { + $this->container['payment_connector_configuration'] = $payment_connector_configuration; + + return $this; + } + + + /** + * Gets payment_method + * + * @return int + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param int $payment_method + * + * @return $this + */ + public function setPaymentMethod($payment_method) + { + $this->container['payment_method'] = $payment_method; + + return $this; + } + + + /** + * Gets payment_method_brand + * + * @return int + */ + public function getPaymentMethodBrand() + { + return $this->container['payment_method_brand']; + } + + /** + * Sets payment_method_brand + * + * @param int $payment_method_brand + * + * @return $this + */ + public function setPaymentMethodBrand($payment_method_brand) + { + $this->container['payment_method_brand'] = $payment_method_brand; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets processor_token + * + * @return string + */ + public function getProcessorToken() + { + return $this->container['processor_token']; + } + + /** + * Sets processor_token + * + * @param string $processor_token + * + * @return $this + */ + public function setProcessorToken($processor_token) + { + $this->container['processor_token'] = $processor_token; + + return $this; + } + + + /** + * Gets shipping_address + * + * @return \Wallee\Sdk\Model\Address + */ + public function getShippingAddress() + { + return $this->container['shipping_address']; + } + + /** + * Sets shipping_address + * + * @param \Wallee\Sdk\Model\Address $shipping_address + * + * @return $this + */ + public function setShippingAddress($shipping_address) + { + $this->container['shipping_address'] = $shipping_address; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\TokenVersionState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\TokenVersionState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets token + * + * @return \Wallee\Sdk\Model\Token + */ + public function getToken() + { + return $this->container['token']; + } + + /** + * Sets token + * + * @param \Wallee\Sdk\Model\Token $token + * + * @return $this + */ + public function setToken($token) + { + $this->container['token'] = $token; + + return $this; + } + + + /** + * Gets type + * + * @return \Wallee\Sdk\Model\TokenVersionType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Wallee\Sdk\Model\TokenVersionType $type The token version type determines what kind of token it is and by which payment connector the token can be processed by. + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/TokenVersionState.php b/wallee-sdk/lib/Model/TokenVersionState.php index 71a9e99..18c4064 100644 --- a/wallee-sdk/lib/Model/TokenVersionState.php +++ b/wallee-sdk/lib/Model/TokenVersionState.php @@ -1,10 +1,8 @@ 'map[string,string]', - 'feature' => '\Wallee\Sdk\Model\Feature', - 'id' => 'int', - 'name' => 'map[string,string]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * - * - * @var \Wallee\Sdk\Model\Feature - */ - private $feature; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $name; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['feature'])) { - $this->setFeature($data['feature']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - } - - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return TokenVersionType - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns feature. - * - * - * - * @return \Wallee\Sdk\Model\Feature - */ - public function getFeature() { - return $this->feature; - } - - /** - * Sets feature. - * - * @param \Wallee\Sdk\Model\Feature $feature - * @return TokenVersionType - */ - public function setFeature($feature) { - $this->feature = $feature; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return TokenVersionType - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return TokenVersionType - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class TokenVersionType implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'TokenVersionType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'description' => 'map[string,string]', + 'feature' => '\Wallee\Sdk\Model\Feature', + 'id' => 'int', + 'name' => 'map[string,string]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'feature' => null, + 'id' => 'int64', + 'name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'feature' => 'feature', + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'feature' => 'setFeature', + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'feature' => 'getFeature', + 'id' => 'getId', + 'name' => 'getName' + ]; + + + + /** + * 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['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['feature'] = isset($data['feature']) ? $data['feature'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets feature + * + * @return \Wallee\Sdk\Model\Feature + */ + public function getFeature() + { + return $this->container['feature']; + } + + /** + * Sets feature + * + * @param \Wallee\Sdk\Model\Feature $feature + * + * @return $this + */ + public function setFeature($feature) + { + $this->container['feature'] = $feature; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + 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/wallee-sdk/lib/Model/TokenizationMode.php b/wallee-sdk/lib/Model/TokenizationMode.php new file mode 100644 index 0000000..40ad91e --- /dev/null +++ b/wallee-sdk/lib/Model/TokenizationMode.php @@ -0,0 +1,58 @@ + 'string', - 'acceptLanguageHeader' => 'string', - 'allowedPaymentMethodBrands' => '\Wallee\Sdk\Model\PaymentMethodBrand[]', - 'allowedPaymentMethodConfigurations' => 'int[]', - 'authorizationAmount' => 'float', - 'authorizationEnvironment' => '\Wallee\Sdk\Model\ChargeAttemptEnvironment', - 'authorizationTimeoutOn' => '\DateTime', - 'authorizedOn' => '\DateTime', - 'autoConfirmationEnabled' => 'bool', - 'billingAddress' => '\Wallee\Sdk\Model\Address', - 'chargeRetryEnabled' => 'bool', - 'completedAmount' => 'float', - 'completedOn' => '\DateTime', - 'completionTimeoutOn' => '\DateTime', - 'confirmedBy' => 'int', - 'confirmedOn' => '\DateTime', - 'createdBy' => 'int', - 'createdOn' => '\DateTime', - 'currency' => 'string', - 'customerEmailAddress' => 'string', - 'customerId' => 'string', - 'customersPresence' => '\Wallee\Sdk\Model\CustomersPresence', - 'deliveryDecisionMadeOn' => '\DateTime', - 'deviceSessionIdentifier' => 'string', - 'endOfLife' => '\DateTime', - 'environment' => '\Wallee\Sdk\Model\Environment', - 'environmentSelectionStrategy' => '\Wallee\Sdk\Model\TransactionEnvironmentSelectionStrategy', - 'failedOn' => '\DateTime', - 'failedUrl' => 'string', - 'failureReason' => '\Wallee\Sdk\Model\FailureReason', - 'group' => '\Wallee\Sdk\Model\TransactionGroup', - 'id' => 'int', - 'internetProtocolAddress' => 'string', - 'internetProtocolAddressCountry' => 'string', - 'invoiceMerchantReference' => 'string', - 'language' => 'string', - 'lineItems' => '\Wallee\Sdk\Model\LineItem[]', - 'linkedSpaceId' => 'int', - 'merchantReference' => 'string', - 'metaData' => 'map[string,string]', - 'paymentConnectorConfiguration' => '\Wallee\Sdk\Model\PaymentConnectorConfiguration', - 'plannedPurgeDate' => '\DateTime', - 'processingOn' => '\DateTime', - 'refundedAmount' => 'float', - 'shippingAddress' => '\Wallee\Sdk\Model\Address', - 'shippingMethod' => 'string', - 'spaceViewId' => 'int', - 'state' => '\Wallee\Sdk\Model\TransactionState', - 'successUrl' => 'string', - 'timeZone' => 'string', - 'token' => '\Wallee\Sdk\Model\Token', - 'tokenizationMode' => '\Wallee\Sdk\Model\TokenizationnMode', - 'userAgentHeader' => 'string', - 'userFailureMessage' => 'string', - 'userInterfaceType' => '\Wallee\Sdk\Model\TransactionUserInterfaceType', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var string - */ - private $acceptHeader; - - /** - * The accept language contains the header which indicates the language preferences of the buyer. - * - * @var string - */ - private $acceptLanguageHeader; - - /** - * - * - * @var \Wallee\Sdk\Model\PaymentMethodBrand[] - */ - private $allowedPaymentMethodBrands; - - /** - * - * - * @var int[] - */ - private $allowedPaymentMethodConfigurations; - - /** - * - * - * @var float - */ - private $authorizationAmount; - - /** - * The environment in which this transaction was successfully authorized. - * - * @var \Wallee\Sdk\Model\ChargeAttemptEnvironment - */ - private $authorizationEnvironment; - - /** - * This is the time on which the transaction will be timed out when it is not at least authorized. The timeout time may change over time. - * - * @var \DateTime - */ - private $authorizationTimeoutOn; - - /** - * - * - * @var \DateTime - */ - private $authorizedOn; - - /** - * When auto confirmation is enabled the transaction can be confirmed by the user and does not require an explicit confirmation through the web service API. - * - * @var bool - */ - private $autoConfirmationEnabled; - - /** - * - * - * @var \Wallee\Sdk\Model\Address - */ - private $billingAddress; - - /** - * When the charging of the customer fails we can retry the charging. This implies that we redirect the user back to the payment page which allows the customer to retry. By default we will retry. - * - * @var bool - */ - private $chargeRetryEnabled; - - /** - * The completed amount is the amount which of the succesful completion. - * - * @var float - */ - private $completedAmount; - - /** - * - * - * @var \DateTime - */ - private $completedOn; - - /** - * - * - * @var \DateTime - */ - private $completionTimeoutOn; - - /** - * - * - * @var int - */ - private $confirmedBy; - - /** - * - * - * @var \DateTime - */ - private $confirmedOn; - - /** - * - * - * @var int - */ - private $createdBy; - - /** - * The created on date indicates the date on which the entity was stored into the database. - * - * @var \DateTime - */ - private $createdOn; - - /** - * - * - * @var string - */ - private $currency; - - /** - * The customer email address is the email address of the customer. If no email address is provided on the shipping or billing address this address is used. - * - * @var string - */ - private $customerEmailAddress; - - /** - * - * - * @var string - */ - private $customerId; - - /** - * The customer's presence indicates what kind of authentication methods can be used during the authorization of the transaction. If no value is provided, 'Virtually Present' is used by default. - * - * @var \Wallee\Sdk\Model\CustomersPresence - */ - private $customersPresence; - - /** - * This date indicates when the decision has been made if a transaction should be delivered or not. - * - * @var \DateTime - */ - private $deliveryDecisionMadeOn; - - /** - * The device session identifier links the transaction with the session identifier provided in the URL of the device data JavaScript. This allows to link the transaction with the collected device data of the buyer. - * - * @var string - */ - private $deviceSessionIdentifier; - - /** - * The transaction's end of life indicates the date from which on no operation can be carried out anymore. - * - * @var \DateTime - */ - private $endOfLife; - - /** - * - * - * @var \Wallee\Sdk\Model\Environment - */ - private $environment; - - /** - * The environment selection strategy determines how the environment (test or production) for processing the transaction is selected. - * - * @var \Wallee\Sdk\Model\TransactionEnvironmentSelectionStrategy - */ - private $environmentSelectionStrategy; - - /** - * - * - * @var \DateTime - */ - private $failedOn; - - /** - * The user will be redirected to failed URL when the transaction could not be authorized or completed. In case no failed URL is specified a default failed page will be displayed. - * - * @var string - */ - private $failedUrl; - - /** - * The failure reason describes why the transaction failed. This is only provided when the transaction is marked as failed. - * - * @var \Wallee\Sdk\Model\FailureReason - */ - private $failureReason; - - /** - * - * - * @var \Wallee\Sdk\Model\TransactionGroup - */ - private $group; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The Internet Protocol (IP) address identifies the device of the buyer. - * - * @var string - */ - private $internetProtocolAddress; - - /** - * - * - * @var string - */ - private $internetProtocolAddressCountry; - - /** - * - * - * @var string - */ - private $invoiceMerchantReference; - - /** - * - * - * @var string - */ - private $language; - - /** - * - * - * @var \Wallee\Sdk\Model\LineItem[] - */ - private $lineItems; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * - * - * @var string - */ - private $merchantReference; - - /** - * Meta data allow to store additional data along the object. - * - * @var map[string,string] - */ - private $metaData; - - /** - * - * - * @var \Wallee\Sdk\Model\PaymentConnectorConfiguration - */ - private $paymentConnectorConfiguration; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var \DateTime - */ - private $processingOn; - - /** - * The refunded amount is the total amount which has been refunded so far. - * - * @var float - */ - private $refundedAmount; - - /** - * - * - * @var \Wallee\Sdk\Model\Address - */ - private $shippingAddress; - - /** - * - * - * @var string - */ - private $shippingMethod; - - /** - * - * - * @var int - */ - private $spaceViewId; - - /** - * - * - * @var \Wallee\Sdk\Model\TransactionState - */ - private $state; - - /** - * The user will be redirected to success URL when the transaction could be authorized or completed. In case no success URL is specified a default success page will be displayed. - * - * @var string - */ - private $successUrl; - - /** - * The time zone defines in which time zone the customer is located in. The time zone may affects how dates are formatted when interacting with the customer. - * - * @var string - */ - private $timeZone; - - /** - * - * - * @var \Wallee\Sdk\Model\Token - */ - private $token; - - /** - * The tokenization mode controls if and how the tokenization of payment information is applied to the transaction. - * - * @var \Wallee\Sdk\Model\TokenizationnMode - */ - private $tokenizationMode; - - /** - * The user agent header provides the exact string which contains the user agent of the buyer. - * - * @var string - */ - private $userAgentHeader; - - /** - * The failure message describes for an end user why the transaction is failed in the language of the user. This is only provided when the transaction is marked as failed. - * - * @var string - */ - private $userFailureMessage; - - /** - * The user interface type defines through which user interface the transaction has been processed resp. created. - * - * @var \Wallee\Sdk\Model\TransactionUserInterfaceType - */ - private $userInterfaceType; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['allowedPaymentMethodBrands'])) { - $this->setAllowedPaymentMethodBrands($data['allowedPaymentMethodBrands']); - } - if (isset($data['allowedPaymentMethodConfigurations'])) { - $this->setAllowedPaymentMethodConfigurations($data['allowedPaymentMethodConfigurations']); - } - if (isset($data['authorizationEnvironment'])) { - $this->setAuthorizationEnvironment($data['authorizationEnvironment']); - } - if (isset($data['billingAddress'])) { - $this->setBillingAddress($data['billingAddress']); - } - if (isset($data['customersPresence'])) { - $this->setCustomersPresence($data['customersPresence']); - } - if (isset($data['environment'])) { - $this->setEnvironment($data['environment']); - } - if (isset($data['environmentSelectionStrategy'])) { - $this->setEnvironmentSelectionStrategy($data['environmentSelectionStrategy']); - } - if (isset($data['failureReason'])) { - $this->setFailureReason($data['failureReason']); - } - if (isset($data['group'])) { - $this->setGroup($data['group']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['lineItems'])) { - $this->setLineItems($data['lineItems']); - } - if (isset($data['metaData'])) { - $this->setMetaData($data['metaData']); - } - if (isset($data['paymentConnectorConfiguration'])) { - $this->setPaymentConnectorConfiguration($data['paymentConnectorConfiguration']); - } - if (isset($data['shippingAddress'])) { - $this->setShippingAddress($data['shippingAddress']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['token'])) { - $this->setToken($data['token']); - } - if (isset($data['tokenizationMode'])) { - $this->setTokenizationMode($data['tokenizationMode']); - } - if (isset($data['userInterfaceType'])) { - $this->setUserInterfaceType($data['userInterfaceType']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns acceptHeader. - * - * - * - * @return string - */ - public function getAcceptHeader() { - return $this->acceptHeader; - } - - /** - * Sets acceptHeader. - * - * @param string $acceptHeader - * @return Transaction - */ - protected function setAcceptHeader($acceptHeader) { - $this->acceptHeader = $acceptHeader; - - return $this; - } - - /** - * Returns acceptLanguageHeader. - * - * The accept language contains the header which indicates the language preferences of the buyer. - * - * @return string - */ - public function getAcceptLanguageHeader() { - return $this->acceptLanguageHeader; - } - - /** - * Sets acceptLanguageHeader. - * - * @param string $acceptLanguageHeader - * @return Transaction - */ - protected function setAcceptLanguageHeader($acceptLanguageHeader) { - $this->acceptLanguageHeader = $acceptLanguageHeader; - - return $this; - } - - /** - * Returns allowedPaymentMethodBrands. - * - * - * - * @return \Wallee\Sdk\Model\PaymentMethodBrand[] - */ - public function getAllowedPaymentMethodBrands() { - return $this->allowedPaymentMethodBrands; - } - - /** - * Sets allowedPaymentMethodBrands. - * - * @param \Wallee\Sdk\Model\PaymentMethodBrand[] $allowedPaymentMethodBrands - * @return Transaction - */ - public function setAllowedPaymentMethodBrands($allowedPaymentMethodBrands) { - $this->allowedPaymentMethodBrands = $allowedPaymentMethodBrands; - - return $this; - } - - /** - * Returns allowedPaymentMethodConfigurations. - * - * - * - * @return int[] - */ - public function getAllowedPaymentMethodConfigurations() { - return $this->allowedPaymentMethodConfigurations; - } - - /** - * Sets allowedPaymentMethodConfigurations. - * - * @param int[] $allowedPaymentMethodConfigurations - * @return Transaction - */ - public function setAllowedPaymentMethodConfigurations($allowedPaymentMethodConfigurations) { - $this->allowedPaymentMethodConfigurations = $allowedPaymentMethodConfigurations; - - return $this; - } - - /** - * Returns authorizationAmount. - * - * - * - * @return float - */ - public function getAuthorizationAmount() { - return $this->authorizationAmount; - } - - /** - * Sets authorizationAmount. - * - * @param float $authorizationAmount - * @return Transaction - */ - protected function setAuthorizationAmount($authorizationAmount) { - $this->authorizationAmount = $authorizationAmount; - - return $this; - } - - /** - * Returns authorizationEnvironment. - * - * The environment in which this transaction was successfully authorized. - * - * @return \Wallee\Sdk\Model\ChargeAttemptEnvironment - */ - public function getAuthorizationEnvironment() { - return $this->authorizationEnvironment; - } - - /** - * Sets authorizationEnvironment. - * - * @param \Wallee\Sdk\Model\ChargeAttemptEnvironment $authorizationEnvironment - * @return Transaction - */ - public function setAuthorizationEnvironment($authorizationEnvironment) { - $this->authorizationEnvironment = $authorizationEnvironment; - - return $this; - } - - /** - * Returns authorizationTimeoutOn. - * - * This is the time on which the transaction will be timed out when it is not at least authorized. The timeout time may change over time. - * - * @return \DateTime - */ - public function getAuthorizationTimeoutOn() { - return $this->authorizationTimeoutOn; - } - - /** - * Sets authorizationTimeoutOn. - * - * @param \DateTime $authorizationTimeoutOn - * @return Transaction - */ - protected function setAuthorizationTimeoutOn($authorizationTimeoutOn) { - $this->authorizationTimeoutOn = $authorizationTimeoutOn; - - return $this; - } - - /** - * Returns authorizedOn. - * - * - * - * @return \DateTime - */ - public function getAuthorizedOn() { - return $this->authorizedOn; - } - - /** - * Sets authorizedOn. - * - * @param \DateTime $authorizedOn - * @return Transaction - */ - protected function setAuthorizedOn($authorizedOn) { - $this->authorizedOn = $authorizedOn; - - return $this; - } - - /** - * Returns autoConfirmationEnabled. - * - * When auto confirmation is enabled the transaction can be confirmed by the user and does not require an explicit confirmation through the web service API. - * - * @return bool - */ - public function getAutoConfirmationEnabled() { - return $this->autoConfirmationEnabled; - } - - /** - * Sets autoConfirmationEnabled. - * - * @param bool $autoConfirmationEnabled - * @return Transaction - */ - protected function setAutoConfirmationEnabled($autoConfirmationEnabled) { - $this->autoConfirmationEnabled = $autoConfirmationEnabled; - - return $this; - } - - /** - * Returns billingAddress. - * - * - * - * @return \Wallee\Sdk\Model\Address - */ - public function getBillingAddress() { - return $this->billingAddress; - } - - /** - * Sets billingAddress. - * - * @param \Wallee\Sdk\Model\Address $billingAddress - * @return Transaction - */ - public function setBillingAddress($billingAddress) { - $this->billingAddress = $billingAddress; - - return $this; - } - - /** - * Returns chargeRetryEnabled. - * - * When the charging of the customer fails we can retry the charging. This implies that we redirect the user back to the payment page which allows the customer to retry. By default we will retry. - * - * @return bool - */ - public function getChargeRetryEnabled() { - return $this->chargeRetryEnabled; - } - - /** - * Sets chargeRetryEnabled. - * - * @param bool $chargeRetryEnabled - * @return Transaction - */ - protected function setChargeRetryEnabled($chargeRetryEnabled) { - $this->chargeRetryEnabled = $chargeRetryEnabled; - - return $this; - } - - /** - * Returns completedAmount. - * - * The completed amount is the amount which of the succesful completion. - * - * @return float - */ - public function getCompletedAmount() { - return $this->completedAmount; - } - - /** - * Sets completedAmount. - * - * @param float $completedAmount - * @return Transaction - */ - protected function setCompletedAmount($completedAmount) { - $this->completedAmount = $completedAmount; - - return $this; - } - - /** - * Returns completedOn. - * - * - * - * @return \DateTime - */ - public function getCompletedOn() { - return $this->completedOn; - } - - /** - * Sets completedOn. - * - * @param \DateTime $completedOn - * @return Transaction - */ - protected function setCompletedOn($completedOn) { - $this->completedOn = $completedOn; - - return $this; - } - - /** - * Returns completionTimeoutOn. - * - * - * - * @return \DateTime - */ - public function getCompletionTimeoutOn() { - return $this->completionTimeoutOn; - } - - /** - * Sets completionTimeoutOn. - * - * @param \DateTime $completionTimeoutOn - * @return Transaction - */ - protected function setCompletionTimeoutOn($completionTimeoutOn) { - $this->completionTimeoutOn = $completionTimeoutOn; - - return $this; - } - - /** - * Returns confirmedBy. - * - * - * - * @return int - */ - public function getConfirmedBy() { - return $this->confirmedBy; - } - - /** - * Sets confirmedBy. - * - * @param int $confirmedBy - * @return Transaction - */ - protected function setConfirmedBy($confirmedBy) { - $this->confirmedBy = $confirmedBy; - - return $this; - } - - /** - * Returns confirmedOn. - * - * - * - * @return \DateTime - */ - public function getConfirmedOn() { - return $this->confirmedOn; - } - - /** - * Sets confirmedOn. - * - * @param \DateTime $confirmedOn - * @return Transaction - */ - protected function setConfirmedOn($confirmedOn) { - $this->confirmedOn = $confirmedOn; - - return $this; - } - - /** - * Returns createdBy. - * - * - * - * @return int - */ - public function getCreatedBy() { - return $this->createdBy; - } - - /** - * Sets createdBy. - * - * @param int $createdBy - * @return Transaction - */ - protected function setCreatedBy($createdBy) { - $this->createdBy = $createdBy; - - return $this; - } - - /** - * Returns createdOn. - * - * The created on date indicates the date on which the entity was stored into the database. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return Transaction - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns currency. - * - * - * - * @return string - */ - public function getCurrency() { - return $this->currency; - } - - /** - * Sets currency. - * - * @param string $currency - * @return Transaction - */ - protected function setCurrency($currency) { - $this->currency = $currency; - - return $this; - } - - /** - * Returns customerEmailAddress. - * - * The customer email address is the email address of the customer. If no email address is provided on the shipping or billing address this address is used. - * - * @return string - */ - public function getCustomerEmailAddress() { - return $this->customerEmailAddress; - } - - /** - * Sets customerEmailAddress. - * - * @param string $customerEmailAddress - * @return Transaction - */ - protected function setCustomerEmailAddress($customerEmailAddress) { - $this->customerEmailAddress = $customerEmailAddress; - - return $this; - } - - /** - * Returns customerId. - * - * - * - * @return string - */ - public function getCustomerId() { - return $this->customerId; - } - - /** - * Sets customerId. - * - * @param string $customerId - * @return Transaction - */ - protected function setCustomerId($customerId) { - $this->customerId = $customerId; - - return $this; - } - - /** - * Returns customersPresence. - * - * The customer's presence indicates what kind of authentication methods can be used during the authorization of the transaction. If no value is provided, 'Virtually Present' is used by default. - * - * @return \Wallee\Sdk\Model\CustomersPresence - */ - public function getCustomersPresence() { - return $this->customersPresence; - } - - /** - * Sets customersPresence. - * - * @param \Wallee\Sdk\Model\CustomersPresence $customersPresence - * @return Transaction - */ - public function setCustomersPresence($customersPresence) { - $this->customersPresence = $customersPresence; - - return $this; - } - - /** - * Returns deliveryDecisionMadeOn. - * - * This date indicates when the decision has been made if a transaction should be delivered or not. - * - * @return \DateTime - */ - public function getDeliveryDecisionMadeOn() { - return $this->deliveryDecisionMadeOn; - } - - /** - * Sets deliveryDecisionMadeOn. - * - * @param \DateTime $deliveryDecisionMadeOn - * @return Transaction - */ - protected function setDeliveryDecisionMadeOn($deliveryDecisionMadeOn) { - $this->deliveryDecisionMadeOn = $deliveryDecisionMadeOn; - - return $this; - } - - /** - * Returns deviceSessionIdentifier. - * - * The device session identifier links the transaction with the session identifier provided in the URL of the device data JavaScript. This allows to link the transaction with the collected device data of the buyer. - * - * @return string - */ - public function getDeviceSessionIdentifier() { - return $this->deviceSessionIdentifier; - } - - /** - * Sets deviceSessionIdentifier. - * - * @param string $deviceSessionIdentifier - * @return Transaction - */ - protected function setDeviceSessionIdentifier($deviceSessionIdentifier) { - $this->deviceSessionIdentifier = $deviceSessionIdentifier; - - return $this; - } - - /** - * Returns endOfLife. - * - * The transaction's end of life indicates the date from which on no operation can be carried out anymore. - * - * @return \DateTime - */ - public function getEndOfLife() { - return $this->endOfLife; - } - - /** - * Sets endOfLife. - * - * @param \DateTime $endOfLife - * @return Transaction - */ - protected function setEndOfLife($endOfLife) { - $this->endOfLife = $endOfLife; - - return $this; - } - - /** - * Returns environment. - * - * - * - * @return \Wallee\Sdk\Model\Environment - */ - public function getEnvironment() { - return $this->environment; - } - - /** - * Sets environment. - * - * @param \Wallee\Sdk\Model\Environment $environment - * @return Transaction - */ - public function setEnvironment($environment) { - $this->environment = $environment; - - return $this; - } - - /** - * Returns environmentSelectionStrategy. - * - * The environment selection strategy determines how the environment (test or production) for processing the transaction is selected. - * - * @return \Wallee\Sdk\Model\TransactionEnvironmentSelectionStrategy - */ - public function getEnvironmentSelectionStrategy() { - return $this->environmentSelectionStrategy; - } - - /** - * Sets environmentSelectionStrategy. - * - * @param \Wallee\Sdk\Model\TransactionEnvironmentSelectionStrategy $environmentSelectionStrategy - * @return Transaction - */ - public function setEnvironmentSelectionStrategy($environmentSelectionStrategy) { - $this->environmentSelectionStrategy = $environmentSelectionStrategy; - - return $this; - } - - /** - * Returns failedOn. - * - * - * - * @return \DateTime - */ - public function getFailedOn() { - return $this->failedOn; - } - - /** - * Sets failedOn. - * - * @param \DateTime $failedOn - * @return Transaction - */ - protected function setFailedOn($failedOn) { - $this->failedOn = $failedOn; - - return $this; - } - - /** - * Returns failedUrl. - * - * The user will be redirected to failed URL when the transaction could not be authorized or completed. In case no failed URL is specified a default failed page will be displayed. - * - * @return string - */ - public function getFailedUrl() { - return $this->failedUrl; - } - - /** - * Sets failedUrl. - * - * @param string $failedUrl - * @return Transaction - */ - protected function setFailedUrl($failedUrl) { - $this->failedUrl = $failedUrl; - - return $this; - } - - /** - * Returns failureReason. - * - * The failure reason describes why the transaction failed. This is only provided when the transaction is marked as failed. - * - * @return \Wallee\Sdk\Model\FailureReason - */ - public function getFailureReason() { - return $this->failureReason; - } - - /** - * Sets failureReason. - * - * @param \Wallee\Sdk\Model\FailureReason $failureReason - * @return Transaction - */ - public function setFailureReason($failureReason) { - $this->failureReason = $failureReason; - - return $this; - } - - /** - * Returns group. - * - * - * - * @return \Wallee\Sdk\Model\TransactionGroup - */ - public function getGroup() { - return $this->group; - } - - /** - * Sets group. - * - * @param \Wallee\Sdk\Model\TransactionGroup $group - * @return Transaction - */ - public function setGroup($group) { - $this->group = $group; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return Transaction - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns internetProtocolAddress. - * - * The Internet Protocol (IP) address identifies the device of the buyer. - * - * @return string - */ - public function getInternetProtocolAddress() { - return $this->internetProtocolAddress; - } - - /** - * Sets internetProtocolAddress. - * - * @param string $internetProtocolAddress - * @return Transaction - */ - protected function setInternetProtocolAddress($internetProtocolAddress) { - $this->internetProtocolAddress = $internetProtocolAddress; - - return $this; - } - - /** - * Returns internetProtocolAddressCountry. - * - * - * - * @return string - */ - public function getInternetProtocolAddressCountry() { - return $this->internetProtocolAddressCountry; - } - - /** - * Sets internetProtocolAddressCountry. - * - * @param string $internetProtocolAddressCountry - * @return Transaction - */ - protected function setInternetProtocolAddressCountry($internetProtocolAddressCountry) { - $this->internetProtocolAddressCountry = $internetProtocolAddressCountry; - - return $this; - } - - /** - * Returns invoiceMerchantReference. - * - * - * - * @return string - */ - public function getInvoiceMerchantReference() { - return $this->invoiceMerchantReference; - } - - /** - * Sets invoiceMerchantReference. - * - * @param string $invoiceMerchantReference - * @return Transaction - */ - protected function setInvoiceMerchantReference($invoiceMerchantReference) { - $this->invoiceMerchantReference = $invoiceMerchantReference; - - return $this; - } - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return Transaction - */ - protected function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns lineItems. - * - * - * - * @return \Wallee\Sdk\Model\LineItem[] - */ - public function getLineItems() { - return $this->lineItems; - } - - /** - * Sets lineItems. - * - * @param \Wallee\Sdk\Model\LineItem[] $lineItems - * @return Transaction - */ - public function setLineItems($lineItems) { - $this->lineItems = $lineItems; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return Transaction - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns merchantReference. - * - * - * - * @return string - */ - public function getMerchantReference() { - return $this->merchantReference; - } - - /** - * Sets merchantReference. - * - * @param string $merchantReference - * @return Transaction - */ - protected function setMerchantReference($merchantReference) { - $this->merchantReference = $merchantReference; - - return $this; - } - - /** - * Returns metaData. - * - * Meta data allow to store additional data along the object. - * - * @return map[string,string] - */ - public function getMetaData() { - return $this->metaData; - } - - /** - * Sets metaData. - * - * @param map[string,string] $metaData - * @return Transaction - */ - public function setMetaData($metaData) { - if (is_array($metaData) && empty($metaData)) { - $this->metaData = new \stdClass; - } else { - $this->metaData = $metaData; - } - - return $this; - } - - /** - * Returns paymentConnectorConfiguration. - * - * - * - * @return \Wallee\Sdk\Model\PaymentConnectorConfiguration - */ - public function getPaymentConnectorConfiguration() { - return $this->paymentConnectorConfiguration; - } - - /** - * Sets paymentConnectorConfiguration. - * - * @param \Wallee\Sdk\Model\PaymentConnectorConfiguration $paymentConnectorConfiguration - * @return Transaction - */ - public function setPaymentConnectorConfiguration($paymentConnectorConfiguration) { - $this->paymentConnectorConfiguration = $paymentConnectorConfiguration; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return Transaction - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns processingOn. - * - * - * - * @return \DateTime - */ - public function getProcessingOn() { - return $this->processingOn; - } - - /** - * Sets processingOn. - * - * @param \DateTime $processingOn - * @return Transaction - */ - protected function setProcessingOn($processingOn) { - $this->processingOn = $processingOn; - - return $this; - } - - /** - * Returns refundedAmount. - * - * The refunded amount is the total amount which has been refunded so far. - * - * @return float - */ - public function getRefundedAmount() { - return $this->refundedAmount; - } - - /** - * Sets refundedAmount. - * - * @param float $refundedAmount - * @return Transaction - */ - protected function setRefundedAmount($refundedAmount) { - $this->refundedAmount = $refundedAmount; - - return $this; - } - - /** - * Returns shippingAddress. - * - * - * - * @return \Wallee\Sdk\Model\Address - */ - public function getShippingAddress() { - return $this->shippingAddress; - } - - /** - * Sets shippingAddress. - * - * @param \Wallee\Sdk\Model\Address $shippingAddress - * @return Transaction - */ - public function setShippingAddress($shippingAddress) { - $this->shippingAddress = $shippingAddress; - - return $this; - } - - /** - * Returns shippingMethod. - * - * - * - * @return string - */ - public function getShippingMethod() { - return $this->shippingMethod; - } - - /** - * Sets shippingMethod. - * - * @param string $shippingMethod - * @return Transaction - */ - protected function setShippingMethod($shippingMethod) { - $this->shippingMethod = $shippingMethod; - - return $this; - } - - /** - * Returns spaceViewId. - * - * - * - * @return int - */ - public function getSpaceViewId() { - return $this->spaceViewId; - } - - /** - * Sets spaceViewId. - * - * @param int $spaceViewId - * @return Transaction - */ - protected function setSpaceViewId($spaceViewId) { - $this->spaceViewId = $spaceViewId; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\TransactionState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\TransactionState $state - * @return Transaction - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns successUrl. - * - * The user will be redirected to success URL when the transaction could be authorized or completed. In case no success URL is specified a default success page will be displayed. - * - * @return string - */ - public function getSuccessUrl() { - return $this->successUrl; - } - - /** - * Sets successUrl. - * - * @param string $successUrl - * @return Transaction - */ - protected function setSuccessUrl($successUrl) { - $this->successUrl = $successUrl; - - return $this; - } - - /** - * Returns timeZone. - * - * The time zone defines in which time zone the customer is located in. The time zone may affects how dates are formatted when interacting with the customer. - * - * @return string - */ - public function getTimeZone() { - return $this->timeZone; - } - - /** - * Sets timeZone. - * - * @param string $timeZone - * @return Transaction - */ - protected function setTimeZone($timeZone) { - $this->timeZone = $timeZone; - - return $this; - } - - /** - * Returns token. - * - * - * - * @return \Wallee\Sdk\Model\Token - */ - public function getToken() { - return $this->token; - } - - /** - * Sets token. - * - * @param \Wallee\Sdk\Model\Token $token - * @return Transaction - */ - public function setToken($token) { - $this->token = $token; - - return $this; - } - - /** - * Returns tokenizationMode. - * - * The tokenization mode controls if and how the tokenization of payment information is applied to the transaction. - * - * @return \Wallee\Sdk\Model\TokenizationnMode - */ - public function getTokenizationMode() { - return $this->tokenizationMode; - } - - /** - * Sets tokenizationMode. - * - * @param \Wallee\Sdk\Model\TokenizationnMode $tokenizationMode - * @return Transaction - */ - public function setTokenizationMode($tokenizationMode) { - $this->tokenizationMode = $tokenizationMode; - - return $this; - } - - /** - * Returns userAgentHeader. - * - * The user agent header provides the exact string which contains the user agent of the buyer. - * - * @return string - */ - public function getUserAgentHeader() { - return $this->userAgentHeader; - } - - /** - * Sets userAgentHeader. - * - * @param string $userAgentHeader - * @return Transaction - */ - protected function setUserAgentHeader($userAgentHeader) { - $this->userAgentHeader = $userAgentHeader; - - return $this; - } - - /** - * Returns userFailureMessage. - * - * The failure message describes for an end user why the transaction is failed in the language of the user. This is only provided when the transaction is marked as failed. - * - * @return string - */ - public function getUserFailureMessage() { - return $this->userFailureMessage; - } - - /** - * Sets userFailureMessage. - * - * @param string $userFailureMessage - * @return Transaction - */ - protected function setUserFailureMessage($userFailureMessage) { - $this->userFailureMessage = $userFailureMessage; - - return $this; - } - - /** - * Returns userInterfaceType. - * - * The user interface type defines through which user interface the transaction has been processed resp. created. - * - * @return \Wallee\Sdk\Model\TransactionUserInterfaceType - */ - public function getUserInterfaceType() { - return $this->userInterfaceType; - } - - /** - * Sets userInterfaceType. - * - * @param \Wallee\Sdk\Model\TransactionUserInterfaceType $userInterfaceType - * @return Transaction - */ - public function setUserInterfaceType($userInterfaceType) { - $this->userInterfaceType = $userInterfaceType; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return Transaction - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class Transaction implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Transaction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'accept_header' => 'string', + 'accept_language_header' => 'string', + 'allowed_payment_method_brands' => '\Wallee\Sdk\Model\PaymentMethodBrand[]', + 'allowed_payment_method_configurations' => 'int[]', + 'authorization_amount' => 'float', + 'authorization_environment' => '\Wallee\Sdk\Model\ChargeAttemptEnvironment', + 'authorization_timeout_on' => '\DateTime', + 'authorized_on' => '\DateTime', + 'auto_confirmation_enabled' => 'bool', + 'billing_address' => '\Wallee\Sdk\Model\Address', + 'charge_retry_enabled' => 'bool', + 'completed_amount' => 'float', + 'completed_on' => '\DateTime', + 'completion_timeout_on' => '\DateTime', + 'confirmed_by' => 'int', + 'confirmed_on' => '\DateTime', + 'created_by' => 'int', + 'created_on' => '\DateTime', + 'currency' => 'string', + 'customer_email_address' => 'string', + 'customer_id' => 'string', + 'customers_presence' => '\Wallee\Sdk\Model\CustomersPresence', + 'delivery_decision_made_on' => '\DateTime', + 'device_session_identifier' => 'string', + 'end_of_life' => '\DateTime', + 'environment' => '\Wallee\Sdk\Model\Environment', + 'environment_selection_strategy' => '\Wallee\Sdk\Model\TransactionEnvironmentSelectionStrategy', + 'failed_on' => '\DateTime', + 'failed_url' => 'string', + 'failure_reason' => '\Wallee\Sdk\Model\FailureReason', + 'group' => '\Wallee\Sdk\Model\TransactionGroup', + 'id' => 'int', + 'internet_protocol_address' => 'string', + 'internet_protocol_address_country' => 'string', + 'invoice_merchant_reference' => 'string', + 'language' => 'string', + 'line_items' => '\Wallee\Sdk\Model\LineItem[]', + 'linked_space_id' => 'int', + 'merchant_reference' => 'string', + 'meta_data' => 'map[string,string]', + 'parent' => 'int', + 'payment_connector_configuration' => '\Wallee\Sdk\Model\PaymentConnectorConfiguration', + 'planned_purge_date' => '\DateTime', + 'processing_on' => '\DateTime', + 'refunded_amount' => 'float', + 'shipping_address' => '\Wallee\Sdk\Model\Address', + 'shipping_method' => 'string', + 'space_view_id' => 'int', + 'state' => '\Wallee\Sdk\Model\TransactionState', + 'success_url' => 'string', + 'time_zone' => 'string', + 'token' => '\Wallee\Sdk\Model\Token', + 'tokenization_mode' => '\Wallee\Sdk\Model\TokenizationMode', + 'user_agent_header' => 'string', + 'user_failure_message' => 'string', + 'user_interface_type' => '\Wallee\Sdk\Model\TransactionUserInterfaceType', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'accept_header' => null, + 'accept_language_header' => null, + 'allowed_payment_method_brands' => null, + 'allowed_payment_method_configurations' => 'int64', + 'authorization_amount' => null, + 'authorization_environment' => null, + 'authorization_timeout_on' => 'date-time', + 'authorized_on' => 'date-time', + 'auto_confirmation_enabled' => null, + 'billing_address' => null, + 'charge_retry_enabled' => null, + 'completed_amount' => null, + 'completed_on' => 'date-time', + 'completion_timeout_on' => 'date-time', + 'confirmed_by' => 'int64', + 'confirmed_on' => 'date-time', + 'created_by' => 'int64', + 'created_on' => 'date-time', + 'currency' => null, + 'customer_email_address' => null, + 'customer_id' => null, + 'customers_presence' => null, + 'delivery_decision_made_on' => 'date-time', + 'device_session_identifier' => null, + 'end_of_life' => 'date-time', + 'environment' => null, + 'environment_selection_strategy' => null, + 'failed_on' => 'date-time', + 'failed_url' => null, + 'failure_reason' => null, + 'group' => null, + 'id' => 'int64', + 'internet_protocol_address' => null, + 'internet_protocol_address_country' => null, + 'invoice_merchant_reference' => null, + 'language' => null, + 'line_items' => null, + 'linked_space_id' => 'int64', + 'merchant_reference' => null, + 'meta_data' => null, + 'parent' => 'int64', + 'payment_connector_configuration' => null, + 'planned_purge_date' => 'date-time', + 'processing_on' => 'date-time', + 'refunded_amount' => null, + 'shipping_address' => null, + 'shipping_method' => null, + 'space_view_id' => 'int64', + 'state' => null, + 'success_url' => null, + 'time_zone' => null, + 'token' => null, + 'tokenization_mode' => null, + 'user_agent_header' => null, + 'user_failure_message' => null, + 'user_interface_type' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'accept_header' => 'acceptHeader', + 'accept_language_header' => 'acceptLanguageHeader', + 'allowed_payment_method_brands' => 'allowedPaymentMethodBrands', + 'allowed_payment_method_configurations' => 'allowedPaymentMethodConfigurations', + 'authorization_amount' => 'authorizationAmount', + 'authorization_environment' => 'authorizationEnvironment', + 'authorization_timeout_on' => 'authorizationTimeoutOn', + 'authorized_on' => 'authorizedOn', + 'auto_confirmation_enabled' => 'autoConfirmationEnabled', + 'billing_address' => 'billingAddress', + 'charge_retry_enabled' => 'chargeRetryEnabled', + 'completed_amount' => 'completedAmount', + 'completed_on' => 'completedOn', + 'completion_timeout_on' => 'completionTimeoutOn', + 'confirmed_by' => 'confirmedBy', + 'confirmed_on' => 'confirmedOn', + 'created_by' => 'createdBy', + 'created_on' => 'createdOn', + 'currency' => 'currency', + 'customer_email_address' => 'customerEmailAddress', + 'customer_id' => 'customerId', + 'customers_presence' => 'customersPresence', + 'delivery_decision_made_on' => 'deliveryDecisionMadeOn', + 'device_session_identifier' => 'deviceSessionIdentifier', + 'end_of_life' => 'endOfLife', + 'environment' => 'environment', + 'environment_selection_strategy' => 'environmentSelectionStrategy', + 'failed_on' => 'failedOn', + 'failed_url' => 'failedUrl', + 'failure_reason' => 'failureReason', + 'group' => 'group', + 'id' => 'id', + 'internet_protocol_address' => 'internetProtocolAddress', + 'internet_protocol_address_country' => 'internetProtocolAddressCountry', + 'invoice_merchant_reference' => 'invoiceMerchantReference', + 'language' => 'language', + 'line_items' => 'lineItems', + 'linked_space_id' => 'linkedSpaceId', + 'merchant_reference' => 'merchantReference', + 'meta_data' => 'metaData', + 'parent' => 'parent', + 'payment_connector_configuration' => 'paymentConnectorConfiguration', + 'planned_purge_date' => 'plannedPurgeDate', + 'processing_on' => 'processingOn', + 'refunded_amount' => 'refundedAmount', + 'shipping_address' => 'shippingAddress', + 'shipping_method' => 'shippingMethod', + 'space_view_id' => 'spaceViewId', + 'state' => 'state', + 'success_url' => 'successUrl', + 'time_zone' => 'timeZone', + 'token' => 'token', + 'tokenization_mode' => 'tokenizationMode', + 'user_agent_header' => 'userAgentHeader', + 'user_failure_message' => 'userFailureMessage', + 'user_interface_type' => 'userInterfaceType', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accept_header' => 'setAcceptHeader', + 'accept_language_header' => 'setAcceptLanguageHeader', + 'allowed_payment_method_brands' => 'setAllowedPaymentMethodBrands', + 'allowed_payment_method_configurations' => 'setAllowedPaymentMethodConfigurations', + 'authorization_amount' => 'setAuthorizationAmount', + 'authorization_environment' => 'setAuthorizationEnvironment', + 'authorization_timeout_on' => 'setAuthorizationTimeoutOn', + 'authorized_on' => 'setAuthorizedOn', + 'auto_confirmation_enabled' => 'setAutoConfirmationEnabled', + 'billing_address' => 'setBillingAddress', + 'charge_retry_enabled' => 'setChargeRetryEnabled', + 'completed_amount' => 'setCompletedAmount', + 'completed_on' => 'setCompletedOn', + 'completion_timeout_on' => 'setCompletionTimeoutOn', + 'confirmed_by' => 'setConfirmedBy', + 'confirmed_on' => 'setConfirmedOn', + 'created_by' => 'setCreatedBy', + 'created_on' => 'setCreatedOn', + 'currency' => 'setCurrency', + 'customer_email_address' => 'setCustomerEmailAddress', + 'customer_id' => 'setCustomerId', + 'customers_presence' => 'setCustomersPresence', + 'delivery_decision_made_on' => 'setDeliveryDecisionMadeOn', + 'device_session_identifier' => 'setDeviceSessionIdentifier', + 'end_of_life' => 'setEndOfLife', + 'environment' => 'setEnvironment', + 'environment_selection_strategy' => 'setEnvironmentSelectionStrategy', + 'failed_on' => 'setFailedOn', + 'failed_url' => 'setFailedUrl', + 'failure_reason' => 'setFailureReason', + 'group' => 'setGroup', + 'id' => 'setId', + 'internet_protocol_address' => 'setInternetProtocolAddress', + 'internet_protocol_address_country' => 'setInternetProtocolAddressCountry', + 'invoice_merchant_reference' => 'setInvoiceMerchantReference', + 'language' => 'setLanguage', + 'line_items' => 'setLineItems', + 'linked_space_id' => 'setLinkedSpaceId', + 'merchant_reference' => 'setMerchantReference', + 'meta_data' => 'setMetaData', + 'parent' => 'setParent', + 'payment_connector_configuration' => 'setPaymentConnectorConfiguration', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'processing_on' => 'setProcessingOn', + 'refunded_amount' => 'setRefundedAmount', + 'shipping_address' => 'setShippingAddress', + 'shipping_method' => 'setShippingMethod', + 'space_view_id' => 'setSpaceViewId', + 'state' => 'setState', + 'success_url' => 'setSuccessUrl', + 'time_zone' => 'setTimeZone', + 'token' => 'setToken', + 'tokenization_mode' => 'setTokenizationMode', + 'user_agent_header' => 'setUserAgentHeader', + 'user_failure_message' => 'setUserFailureMessage', + 'user_interface_type' => 'setUserInterfaceType', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accept_header' => 'getAcceptHeader', + 'accept_language_header' => 'getAcceptLanguageHeader', + 'allowed_payment_method_brands' => 'getAllowedPaymentMethodBrands', + 'allowed_payment_method_configurations' => 'getAllowedPaymentMethodConfigurations', + 'authorization_amount' => 'getAuthorizationAmount', + 'authorization_environment' => 'getAuthorizationEnvironment', + 'authorization_timeout_on' => 'getAuthorizationTimeoutOn', + 'authorized_on' => 'getAuthorizedOn', + 'auto_confirmation_enabled' => 'getAutoConfirmationEnabled', + 'billing_address' => 'getBillingAddress', + 'charge_retry_enabled' => 'getChargeRetryEnabled', + 'completed_amount' => 'getCompletedAmount', + 'completed_on' => 'getCompletedOn', + 'completion_timeout_on' => 'getCompletionTimeoutOn', + 'confirmed_by' => 'getConfirmedBy', + 'confirmed_on' => 'getConfirmedOn', + 'created_by' => 'getCreatedBy', + 'created_on' => 'getCreatedOn', + 'currency' => 'getCurrency', + 'customer_email_address' => 'getCustomerEmailAddress', + 'customer_id' => 'getCustomerId', + 'customers_presence' => 'getCustomersPresence', + 'delivery_decision_made_on' => 'getDeliveryDecisionMadeOn', + 'device_session_identifier' => 'getDeviceSessionIdentifier', + 'end_of_life' => 'getEndOfLife', + 'environment' => 'getEnvironment', + 'environment_selection_strategy' => 'getEnvironmentSelectionStrategy', + 'failed_on' => 'getFailedOn', + 'failed_url' => 'getFailedUrl', + 'failure_reason' => 'getFailureReason', + 'group' => 'getGroup', + 'id' => 'getId', + 'internet_protocol_address' => 'getInternetProtocolAddress', + 'internet_protocol_address_country' => 'getInternetProtocolAddressCountry', + 'invoice_merchant_reference' => 'getInvoiceMerchantReference', + 'language' => 'getLanguage', + 'line_items' => 'getLineItems', + 'linked_space_id' => 'getLinkedSpaceId', + 'merchant_reference' => 'getMerchantReference', + 'meta_data' => 'getMetaData', + 'parent' => 'getParent', + 'payment_connector_configuration' => 'getPaymentConnectorConfiguration', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'processing_on' => 'getProcessingOn', + 'refunded_amount' => 'getRefundedAmount', + 'shipping_address' => 'getShippingAddress', + 'shipping_method' => 'getShippingMethod', + 'space_view_id' => 'getSpaceViewId', + 'state' => 'getState', + 'success_url' => 'getSuccessUrl', + 'time_zone' => 'getTimeZone', + 'token' => 'getToken', + 'tokenization_mode' => 'getTokenizationMode', + 'user_agent_header' => 'getUserAgentHeader', + 'user_failure_message' => 'getUserFailureMessage', + 'user_interface_type' => 'getUserInterfaceType', + 'version' => 'getVersion' + ]; + + + + /** + * 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['accept_header'] = isset($data['accept_header']) ? $data['accept_header'] : null; + + $this->container['accept_language_header'] = isset($data['accept_language_header']) ? $data['accept_language_header'] : null; + + $this->container['allowed_payment_method_brands'] = isset($data['allowed_payment_method_brands']) ? $data['allowed_payment_method_brands'] : null; + + $this->container['allowed_payment_method_configurations'] = isset($data['allowed_payment_method_configurations']) ? $data['allowed_payment_method_configurations'] : null; + + $this->container['authorization_amount'] = isset($data['authorization_amount']) ? $data['authorization_amount'] : null; + + $this->container['authorization_environment'] = isset($data['authorization_environment']) ? $data['authorization_environment'] : null; + + $this->container['authorization_timeout_on'] = isset($data['authorization_timeout_on']) ? $data['authorization_timeout_on'] : null; + + $this->container['authorized_on'] = isset($data['authorized_on']) ? $data['authorized_on'] : null; + + $this->container['auto_confirmation_enabled'] = isset($data['auto_confirmation_enabled']) ? $data['auto_confirmation_enabled'] : null; + + $this->container['billing_address'] = isset($data['billing_address']) ? $data['billing_address'] : null; + + $this->container['charge_retry_enabled'] = isset($data['charge_retry_enabled']) ? $data['charge_retry_enabled'] : null; + + $this->container['completed_amount'] = isset($data['completed_amount']) ? $data['completed_amount'] : null; + + $this->container['completed_on'] = isset($data['completed_on']) ? $data['completed_on'] : null; + + $this->container['completion_timeout_on'] = isset($data['completion_timeout_on']) ? $data['completion_timeout_on'] : null; + + $this->container['confirmed_by'] = isset($data['confirmed_by']) ? $data['confirmed_by'] : null; + + $this->container['confirmed_on'] = isset($data['confirmed_on']) ? $data['confirmed_on'] : null; + + $this->container['created_by'] = isset($data['created_by']) ? $data['created_by'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + + $this->container['customer_email_address'] = isset($data['customer_email_address']) ? $data['customer_email_address'] : null; + + $this->container['customer_id'] = isset($data['customer_id']) ? $data['customer_id'] : null; + + $this->container['customers_presence'] = isset($data['customers_presence']) ? $data['customers_presence'] : null; + + $this->container['delivery_decision_made_on'] = isset($data['delivery_decision_made_on']) ? $data['delivery_decision_made_on'] : null; + + $this->container['device_session_identifier'] = isset($data['device_session_identifier']) ? $data['device_session_identifier'] : null; + + $this->container['end_of_life'] = isset($data['end_of_life']) ? $data['end_of_life'] : null; + + $this->container['environment'] = isset($data['environment']) ? $data['environment'] : null; + + $this->container['environment_selection_strategy'] = isset($data['environment_selection_strategy']) ? $data['environment_selection_strategy'] : null; + + $this->container['failed_on'] = isset($data['failed_on']) ? $data['failed_on'] : null; + + $this->container['failed_url'] = isset($data['failed_url']) ? $data['failed_url'] : null; + + $this->container['failure_reason'] = isset($data['failure_reason']) ? $data['failure_reason'] : null; + + $this->container['group'] = isset($data['group']) ? $data['group'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['internet_protocol_address'] = isset($data['internet_protocol_address']) ? $data['internet_protocol_address'] : null; + + $this->container['internet_protocol_address_country'] = isset($data['internet_protocol_address_country']) ? $data['internet_protocol_address_country'] : null; + + $this->container['invoice_merchant_reference'] = isset($data['invoice_merchant_reference']) ? $data['invoice_merchant_reference'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['line_items'] = isset($data['line_items']) ? $data['line_items'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['merchant_reference'] = isset($data['merchant_reference']) ? $data['merchant_reference'] : null; + + $this->container['meta_data'] = isset($data['meta_data']) ? $data['meta_data'] : null; + + $this->container['parent'] = isset($data['parent']) ? $data['parent'] : null; + + $this->container['payment_connector_configuration'] = isset($data['payment_connector_configuration']) ? $data['payment_connector_configuration'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['processing_on'] = isset($data['processing_on']) ? $data['processing_on'] : null; + + $this->container['refunded_amount'] = isset($data['refunded_amount']) ? $data['refunded_amount'] : null; + + $this->container['shipping_address'] = isset($data['shipping_address']) ? $data['shipping_address'] : null; + + $this->container['shipping_method'] = isset($data['shipping_method']) ? $data['shipping_method'] : null; + + $this->container['space_view_id'] = isset($data['space_view_id']) ? $data['space_view_id'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['success_url'] = isset($data['success_url']) ? $data['success_url'] : null; + + $this->container['time_zone'] = isset($data['time_zone']) ? $data['time_zone'] : null; + + $this->container['token'] = isset($data['token']) ? $data['token'] : null; + + $this->container['tokenization_mode'] = isset($data['tokenization_mode']) ? $data['tokenization_mode'] : null; + + $this->container['user_agent_header'] = isset($data['user_agent_header']) ? $data['user_agent_header'] : null; + + $this->container['user_failure_message'] = isset($data['user_failure_message']) ? $data['user_failure_message'] : null; + + $this->container['user_interface_type'] = isset($data['user_interface_type']) ? $data['user_interface_type'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 accept_header + * + * @return string + */ + public function getAcceptHeader() + { + return $this->container['accept_header']; + } + + /** + * Sets accept_header + * + * @param string $accept_header + * + * @return $this + */ + public function setAcceptHeader($accept_header) + { + $this->container['accept_header'] = $accept_header; + + return $this; + } + + + /** + * Gets accept_language_header + * + * @return string + */ + public function getAcceptLanguageHeader() + { + return $this->container['accept_language_header']; + } + + /** + * Sets accept_language_header + * + * @param string $accept_language_header The accept language contains the header which indicates the language preferences of the buyer. + * + * @return $this + */ + public function setAcceptLanguageHeader($accept_language_header) + { + $this->container['accept_language_header'] = $accept_language_header; + + return $this; + } + + + /** + * Gets allowed_payment_method_brands + * + * @return \Wallee\Sdk\Model\PaymentMethodBrand[] + */ + public function getAllowedPaymentMethodBrands() + { + return $this->container['allowed_payment_method_brands']; + } + + /** + * Sets allowed_payment_method_brands + * + * @param \Wallee\Sdk\Model\PaymentMethodBrand[] $allowed_payment_method_brands + * + * @return $this + */ + public function setAllowedPaymentMethodBrands($allowed_payment_method_brands) + { + $this->container['allowed_payment_method_brands'] = $allowed_payment_method_brands; + + return $this; + } + + + /** + * Gets allowed_payment_method_configurations + * + * @return int[] + */ + public function getAllowedPaymentMethodConfigurations() + { + return $this->container['allowed_payment_method_configurations']; + } + + /** + * Sets allowed_payment_method_configurations + * + * @param int[] $allowed_payment_method_configurations + * + * @return $this + */ + public function setAllowedPaymentMethodConfigurations($allowed_payment_method_configurations) + { + $this->container['allowed_payment_method_configurations'] = $allowed_payment_method_configurations; + + return $this; + } + + + /** + * Gets authorization_amount + * + * @return float + */ + public function getAuthorizationAmount() + { + return $this->container['authorization_amount']; + } + + /** + * Sets authorization_amount + * + * @param float $authorization_amount + * + * @return $this + */ + public function setAuthorizationAmount($authorization_amount) + { + $this->container['authorization_amount'] = $authorization_amount; + + return $this; + } + + + /** + * Gets authorization_environment + * + * @return \Wallee\Sdk\Model\ChargeAttemptEnvironment + */ + public function getAuthorizationEnvironment() + { + return $this->container['authorization_environment']; + } + + /** + * Sets authorization_environment + * + * @param \Wallee\Sdk\Model\ChargeAttemptEnvironment $authorization_environment The environment in which this transaction was successfully authorized. + * + * @return $this + */ + public function setAuthorizationEnvironment($authorization_environment) + { + $this->container['authorization_environment'] = $authorization_environment; + + return $this; + } + + + /** + * Gets authorization_timeout_on + * + * @return \DateTime + */ + public function getAuthorizationTimeoutOn() + { + return $this->container['authorization_timeout_on']; + } + + /** + * Sets authorization_timeout_on + * + * @param \DateTime $authorization_timeout_on This is the time on which the transaction will be timed out when it is not at least authorized. The timeout time may change over time. + * + * @return $this + */ + public function setAuthorizationTimeoutOn($authorization_timeout_on) + { + $this->container['authorization_timeout_on'] = $authorization_timeout_on; + + return $this; + } + + + /** + * Gets authorized_on + * + * @return \DateTime + */ + public function getAuthorizedOn() + { + return $this->container['authorized_on']; + } + + /** + * Sets authorized_on + * + * @param \DateTime $authorized_on + * + * @return $this + */ + public function setAuthorizedOn($authorized_on) + { + $this->container['authorized_on'] = $authorized_on; + + return $this; + } + + + /** + * Gets auto_confirmation_enabled + * + * @return bool + */ + public function getAutoConfirmationEnabled() + { + return $this->container['auto_confirmation_enabled']; + } + + /** + * Sets auto_confirmation_enabled + * + * @param bool $auto_confirmation_enabled When auto confirmation is enabled the transaction can be confirmed by the user and does not require an explicit confirmation through the web service API. + * + * @return $this + */ + public function setAutoConfirmationEnabled($auto_confirmation_enabled) + { + $this->container['auto_confirmation_enabled'] = $auto_confirmation_enabled; + + return $this; + } + + + /** + * Gets billing_address + * + * @return \Wallee\Sdk\Model\Address + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Wallee\Sdk\Model\Address $billing_address + * + * @return $this + */ + public function setBillingAddress($billing_address) + { + $this->container['billing_address'] = $billing_address; + + return $this; + } + + + /** + * Gets charge_retry_enabled + * + * @return bool + */ + public function getChargeRetryEnabled() + { + return $this->container['charge_retry_enabled']; + } + + /** + * Sets charge_retry_enabled + * + * @param bool $charge_retry_enabled When the charging of the customer fails we can retry the charging. This implies that we redirect the user back to the payment page which allows the customer to retry. By default we will retry. + * + * @return $this + */ + public function setChargeRetryEnabled($charge_retry_enabled) + { + $this->container['charge_retry_enabled'] = $charge_retry_enabled; + + return $this; + } + + + /** + * Gets completed_amount + * + * @return float + */ + public function getCompletedAmount() + { + return $this->container['completed_amount']; + } + + /** + * Sets completed_amount + * + * @param float $completed_amount The completed amount is the total amount which has been captured so far. + * + * @return $this + */ + public function setCompletedAmount($completed_amount) + { + $this->container['completed_amount'] = $completed_amount; + + return $this; + } + + + /** + * Gets completed_on + * + * @return \DateTime + */ + public function getCompletedOn() + { + return $this->container['completed_on']; + } + + /** + * Sets completed_on + * + * @param \DateTime $completed_on + * + * @return $this + */ + public function setCompletedOn($completed_on) + { + $this->container['completed_on'] = $completed_on; + + return $this; + } + + + /** + * Gets completion_timeout_on + * + * @return \DateTime + */ + public function getCompletionTimeoutOn() + { + return $this->container['completion_timeout_on']; + } + + /** + * Sets completion_timeout_on + * + * @param \DateTime $completion_timeout_on + * + * @return $this + */ + public function setCompletionTimeoutOn($completion_timeout_on) + { + $this->container['completion_timeout_on'] = $completion_timeout_on; + + return $this; + } + + + /** + * Gets confirmed_by + * + * @return int + */ + public function getConfirmedBy() + { + return $this->container['confirmed_by']; + } + + /** + * Sets confirmed_by + * + * @param int $confirmed_by + * + * @return $this + */ + public function setConfirmedBy($confirmed_by) + { + $this->container['confirmed_by'] = $confirmed_by; + + return $this; + } + + + /** + * Gets confirmed_on + * + * @return \DateTime + */ + public function getConfirmedOn() + { + return $this->container['confirmed_on']; + } + + /** + * Sets confirmed_on + * + * @param \DateTime $confirmed_on + * + * @return $this + */ + public function setConfirmedOn($confirmed_on) + { + $this->container['confirmed_on'] = $confirmed_on; + + return $this; + } + + + /** + * Gets created_by + * + * @return int + */ + public function getCreatedBy() + { + return $this->container['created_by']; + } + + /** + * Sets created_by + * + * @param int $created_by + * + * @return $this + */ + public function setCreatedBy($created_by) + { + $this->container['created_by'] = $created_by; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + + /** + * Gets customer_email_address + * + * @return string + */ + public function getCustomerEmailAddress() + { + return $this->container['customer_email_address']; + } + + /** + * Sets customer_email_address + * + * @param string $customer_email_address The customer email address is the email address of the customer. If no email address is provided on the shipping or billing address this address is used. + * + * @return $this + */ + public function setCustomerEmailAddress($customer_email_address) + { + $this->container['customer_email_address'] = $customer_email_address; + + return $this; + } + + + /** + * Gets customer_id + * + * @return string + */ + public function getCustomerId() + { + return $this->container['customer_id']; + } + + /** + * Sets customer_id + * + * @param string $customer_id + * + * @return $this + */ + public function setCustomerId($customer_id) + { + $this->container['customer_id'] = $customer_id; + + return $this; + } + + + /** + * Gets customers_presence + * + * @return \Wallee\Sdk\Model\CustomersPresence + */ + public function getCustomersPresence() + { + return $this->container['customers_presence']; + } + + /** + * Sets customers_presence + * + * @param \Wallee\Sdk\Model\CustomersPresence $customers_presence The customer's presence indicates what kind of authentication methods can be used during the authorization of the transaction. If no value is provided, 'Virtually Present' is used by default. + * + * @return $this + */ + public function setCustomersPresence($customers_presence) + { + $this->container['customers_presence'] = $customers_presence; + + return $this; + } + + + /** + * Gets delivery_decision_made_on + * + * @return \DateTime + */ + public function getDeliveryDecisionMadeOn() + { + return $this->container['delivery_decision_made_on']; + } + + /** + * Sets delivery_decision_made_on + * + * @param \DateTime $delivery_decision_made_on This date indicates when the decision has been made if a transaction should be delivered or not. + * + * @return $this + */ + public function setDeliveryDecisionMadeOn($delivery_decision_made_on) + { + $this->container['delivery_decision_made_on'] = $delivery_decision_made_on; + + return $this; + } + + + /** + * Gets device_session_identifier + * + * @return string + */ + public function getDeviceSessionIdentifier() + { + return $this->container['device_session_identifier']; + } + + /** + * Sets device_session_identifier + * + * @param string $device_session_identifier The device session identifier links the transaction with the session identifier provided in the URL of the device data JavaScript. This allows to link the transaction with the collected device data of the buyer. + * + * @return $this + */ + public function setDeviceSessionIdentifier($device_session_identifier) + { + $this->container['device_session_identifier'] = $device_session_identifier; + + return $this; + } + + + /** + * Gets end_of_life + * + * @return \DateTime + */ + public function getEndOfLife() + { + return $this->container['end_of_life']; + } + + /** + * Sets end_of_life + * + * @param \DateTime $end_of_life The transaction's end of life indicates the date from which on no operation can be carried out anymore. + * + * @return $this + */ + public function setEndOfLife($end_of_life) + { + $this->container['end_of_life'] = $end_of_life; + + return $this; + } + + + /** + * Gets environment + * + * @return \Wallee\Sdk\Model\Environment + */ + public function getEnvironment() + { + return $this->container['environment']; + } + + /** + * Sets environment + * + * @param \Wallee\Sdk\Model\Environment $environment + * + * @return $this + */ + public function setEnvironment($environment) + { + $this->container['environment'] = $environment; + + return $this; + } + + + /** + * Gets environment_selection_strategy + * + * @return \Wallee\Sdk\Model\TransactionEnvironmentSelectionStrategy + */ + public function getEnvironmentSelectionStrategy() + { + return $this->container['environment_selection_strategy']; + } + + /** + * Sets environment_selection_strategy + * + * @param \Wallee\Sdk\Model\TransactionEnvironmentSelectionStrategy $environment_selection_strategy The environment selection strategy determines how the environment (test or production) for processing the transaction is selected. + * + * @return $this + */ + public function setEnvironmentSelectionStrategy($environment_selection_strategy) + { + $this->container['environment_selection_strategy'] = $environment_selection_strategy; + + return $this; + } + + + /** + * Gets failed_on + * + * @return \DateTime + */ + public function getFailedOn() + { + return $this->container['failed_on']; + } + + /** + * Sets failed_on + * + * @param \DateTime $failed_on + * + * @return $this + */ + public function setFailedOn($failed_on) + { + $this->container['failed_on'] = $failed_on; + + return $this; + } + + + /** + * Gets failed_url + * + * @return string + */ + public function getFailedUrl() + { + return $this->container['failed_url']; + } + + /** + * Sets failed_url + * + * @param string $failed_url The user will be redirected to failed URL when the transaction could not be authorized or completed. In case no failed URL is specified a default failed page will be displayed. + * + * @return $this + */ + public function setFailedUrl($failed_url) + { + $this->container['failed_url'] = $failed_url; + + return $this; + } + + + /** + * Gets failure_reason + * + * @return \Wallee\Sdk\Model\FailureReason + */ + public function getFailureReason() + { + return $this->container['failure_reason']; + } + + /** + * Sets failure_reason + * + * @param \Wallee\Sdk\Model\FailureReason $failure_reason The failure reason describes why the transaction failed. This is only provided when the transaction is marked as failed. + * + * @return $this + */ + public function setFailureReason($failure_reason) + { + $this->container['failure_reason'] = $failure_reason; + + return $this; + } + + + /** + * Gets group + * + * @return \Wallee\Sdk\Model\TransactionGroup + */ + public function getGroup() + { + return $this->container['group']; + } + + /** + * Sets group + * + * @param \Wallee\Sdk\Model\TransactionGroup $group + * + * @return $this + */ + public function setGroup($group) + { + $this->container['group'] = $group; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets internet_protocol_address + * + * @return string + */ + public function getInternetProtocolAddress() + { + return $this->container['internet_protocol_address']; + } + + /** + * Sets internet_protocol_address + * + * @param string $internet_protocol_address The Internet Protocol (IP) address identifies the device of the buyer. + * + * @return $this + */ + public function setInternetProtocolAddress($internet_protocol_address) + { + $this->container['internet_protocol_address'] = $internet_protocol_address; + + return $this; + } + + + /** + * Gets internet_protocol_address_country + * + * @return string + */ + public function getInternetProtocolAddressCountry() + { + return $this->container['internet_protocol_address_country']; + } + + /** + * Sets internet_protocol_address_country + * + * @param string $internet_protocol_address_country + * + * @return $this + */ + public function setInternetProtocolAddressCountry($internet_protocol_address_country) + { + $this->container['internet_protocol_address_country'] = $internet_protocol_address_country; + + return $this; + } + + + /** + * Gets invoice_merchant_reference + * + * @return string + */ + public function getInvoiceMerchantReference() + { + return $this->container['invoice_merchant_reference']; + } + + /** + * Sets invoice_merchant_reference + * + * @param string $invoice_merchant_reference + * + * @return $this + */ + public function setInvoiceMerchantReference($invoice_merchant_reference) + { + $this->container['invoice_merchant_reference'] = $invoice_merchant_reference; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets line_items + * + * @return \Wallee\Sdk\Model\LineItem[] + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Wallee\Sdk\Model\LineItem[] $line_items + * + * @return $this + */ + public function setLineItems($line_items) + { + $this->container['line_items'] = $line_items; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets merchant_reference + * + * @return string + */ + public function getMerchantReference() + { + return $this->container['merchant_reference']; + } + + /** + * Sets merchant_reference + * + * @param string $merchant_reference + * + * @return $this + */ + public function setMerchantReference($merchant_reference) + { + $this->container['merchant_reference'] = $merchant_reference; + + return $this; + } + + + /** + * Gets meta_data + * + * @return map[string,string] + */ + public function getMetaData() + { + return $this->container['meta_data']; + } + + /** + * Sets meta_data + * + * @param map[string,string] $meta_data Meta data allow to store additional data along the object. + * + * @return $this + */ + public function setMetaData($meta_data) + { + $this->container['meta_data'] = $meta_data; + + return $this; + } + + + /** + * Gets parent + * + * @return int + */ + public function getParent() + { + return $this->container['parent']; + } + + /** + * Sets parent + * + * @param int $parent + * + * @return $this + */ + public function setParent($parent) + { + $this->container['parent'] = $parent; + + return $this; + } + + + /** + * Gets payment_connector_configuration + * + * @return \Wallee\Sdk\Model\PaymentConnectorConfiguration + */ + public function getPaymentConnectorConfiguration() + { + return $this->container['payment_connector_configuration']; + } + + /** + * Sets payment_connector_configuration + * + * @param \Wallee\Sdk\Model\PaymentConnectorConfiguration $payment_connector_configuration + * + * @return $this + */ + public function setPaymentConnectorConfiguration($payment_connector_configuration) + { + $this->container['payment_connector_configuration'] = $payment_connector_configuration; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets processing_on + * + * @return \DateTime + */ + public function getProcessingOn() + { + return $this->container['processing_on']; + } + + /** + * Sets processing_on + * + * @param \DateTime $processing_on + * + * @return $this + */ + public function setProcessingOn($processing_on) + { + $this->container['processing_on'] = $processing_on; + + return $this; + } + + + /** + * Gets refunded_amount + * + * @return float + */ + public function getRefundedAmount() + { + return $this->container['refunded_amount']; + } + + /** + * Sets refunded_amount + * + * @param float $refunded_amount The refunded amount is the total amount which has been refunded so far. + * + * @return $this + */ + public function setRefundedAmount($refunded_amount) + { + $this->container['refunded_amount'] = $refunded_amount; + + return $this; + } + + + /** + * Gets shipping_address + * + * @return \Wallee\Sdk\Model\Address + */ + public function getShippingAddress() + { + return $this->container['shipping_address']; + } + + /** + * Sets shipping_address + * + * @param \Wallee\Sdk\Model\Address $shipping_address + * + * @return $this + */ + public function setShippingAddress($shipping_address) + { + $this->container['shipping_address'] = $shipping_address; + + return $this; + } + + + /** + * Gets shipping_method + * + * @return string + */ + public function getShippingMethod() + { + return $this->container['shipping_method']; + } + + /** + * Sets shipping_method + * + * @param string $shipping_method + * + * @return $this + */ + public function setShippingMethod($shipping_method) + { + $this->container['shipping_method'] = $shipping_method; + + return $this; + } + + + /** + * Gets space_view_id + * + * @return int + */ + public function getSpaceViewId() + { + return $this->container['space_view_id']; + } + + /** + * Sets space_view_id + * + * @param int $space_view_id + * + * @return $this + */ + public function setSpaceViewId($space_view_id) + { + $this->container['space_view_id'] = $space_view_id; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\TransactionState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\TransactionState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets success_url + * + * @return string + */ + public function getSuccessUrl() + { + return $this->container['success_url']; + } + + /** + * Sets success_url + * + * @param string $success_url The user will be redirected to success URL when the transaction could be authorized or completed. In case no success URL is specified a default success page will be displayed. + * + * @return $this + */ + public function setSuccessUrl($success_url) + { + $this->container['success_url'] = $success_url; + + return $this; + } + + + /** + * Gets time_zone + * + * @return string + */ + public function getTimeZone() + { + return $this->container['time_zone']; + } + + /** + * Sets time_zone + * + * @param string $time_zone The time zone defines in which time zone the customer is located in. The time zone may affects how dates are formatted when interacting with the customer. + * + * @return $this + */ + public function setTimeZone($time_zone) + { + $this->container['time_zone'] = $time_zone; + + return $this; + } + + + /** + * Gets token + * + * @return \Wallee\Sdk\Model\Token + */ + public function getToken() + { + return $this->container['token']; + } + + /** + * Sets token + * + * @param \Wallee\Sdk\Model\Token $token + * + * @return $this + */ + public function setToken($token) + { + $this->container['token'] = $token; + + return $this; + } + + + /** + * Gets tokenization_mode + * + * @return \Wallee\Sdk\Model\TokenizationMode + */ + public function getTokenizationMode() + { + return $this->container['tokenization_mode']; + } + + /** + * Sets tokenization_mode + * + * @param \Wallee\Sdk\Model\TokenizationMode $tokenization_mode The tokenization mode controls if and how the tokenization of payment information is applied to the transaction. + * + * @return $this + */ + public function setTokenizationMode($tokenization_mode) + { + $this->container['tokenization_mode'] = $tokenization_mode; + + return $this; + } + + + /** + * Gets user_agent_header + * + * @return string + */ + public function getUserAgentHeader() + { + return $this->container['user_agent_header']; + } + + /** + * Sets user_agent_header + * + * @param string $user_agent_header The user agent header provides the exact string which contains the user agent of the buyer. + * + * @return $this + */ + public function setUserAgentHeader($user_agent_header) + { + $this->container['user_agent_header'] = $user_agent_header; + + return $this; + } + + + /** + * Gets user_failure_message + * + * @return string + */ + public function getUserFailureMessage() + { + return $this->container['user_failure_message']; + } + + /** + * Sets user_failure_message + * + * @param string $user_failure_message The failure message describes for an end user why the transaction is failed in the language of the user. This is only provided when the transaction is marked as failed. + * + * @return $this + */ + public function setUserFailureMessage($user_failure_message) + { + $this->container['user_failure_message'] = $user_failure_message; + + return $this; + } + + + /** + * Gets user_interface_type + * + * @return \Wallee\Sdk\Model\TransactionUserInterfaceType + */ + public function getUserInterfaceType() + { + return $this->container['user_interface_type']; + } + + /** + * Sets user_interface_type + * + * @param \Wallee\Sdk\Model\TransactionUserInterfaceType $user_interface_type The user interface type defines through which user interface the transaction has been processed resp. created. + * + * @return $this + */ + public function setUserInterfaceType($user_interface_type) + { + $this->container['user_interface_type'] = $user_interface_type; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/TransactionAwareEntity.php b/wallee-sdk/lib/Model/TransactionAwareEntity.php index 3420cc8..5070428 100644 --- a/wallee-sdk/lib/Model/TransactionAwareEntity.php +++ b/wallee-sdk/lib/Model/TransactionAwareEntity.php @@ -1,10 +1,8 @@ 'int', - 'linkedSpaceId' => 'int', - 'linkedTransaction' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * - * - * @var int - */ - private $linkedTransaction; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return TransactionAwareEntity - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return TransactionAwareEntity - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns linkedTransaction. - * - * - * - * @return int - */ - public function getLinkedTransaction() { - return $this->linkedTransaction; - } - - /** - * Sets linkedTransaction. - * - * @param int $linkedTransaction - * @return TransactionAwareEntity - */ - protected function setLinkedTransaction($linkedTransaction) { - $this->linkedTransaction = $linkedTransaction; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class TransactionAwareEntity implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'TransactionAwareEntity'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'linked_space_id' => 'int', + 'linked_transaction' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'linked_transaction' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'linked_transaction' => 'linkedTransaction' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'linked_transaction' => 'setLinkedTransaction' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'linked_transaction' => 'getLinkedTransaction' + ]; + + + + /** + * 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['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['linked_transaction'] = isset($data['linked_transaction']) ? $data['linked_transaction'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets linked_transaction + * + * @return int + */ + public function getLinkedTransaction() + { + return $this->container['linked_transaction']; + } + + /** + * Sets linked_transaction + * + * @param int $linked_transaction + * + * @return $this + */ + public function setLinkedTransaction($linked_transaction) + { + $this->container['linked_transaction'] = $linked_transaction; + + 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/wallee-sdk/lib/Model/TransactionComment.php b/wallee-sdk/lib/Model/TransactionComment.php new file mode 100644 index 0000000..e1e88eb --- /dev/null +++ b/wallee-sdk/lib/Model/TransactionComment.php @@ -0,0 +1,586 @@ + 'string', + 'created_by' => 'int', + 'created_on' => '\DateTime', + 'edited_by' => 'int', + 'edited_on' => '\DateTime', + 'id' => 'int', + 'linked_space_id' => 'int', + 'pinned' => 'bool', + 'transaction' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'content' => null, + 'created_by' => 'int64', + 'created_on' => 'date-time', + 'edited_by' => 'int64', + 'edited_on' => 'date-time', + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'pinned' => null, + 'transaction' => 'int64', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'content' => 'content', + 'created_by' => 'createdBy', + 'created_on' => 'createdOn', + 'edited_by' => 'editedBy', + 'edited_on' => 'editedOn', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'pinned' => 'pinned', + 'transaction' => 'transaction', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent', + 'created_by' => 'setCreatedBy', + 'created_on' => 'setCreatedOn', + 'edited_by' => 'setEditedBy', + 'edited_on' => 'setEditedOn', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'pinned' => 'setPinned', + 'transaction' => 'setTransaction', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent', + 'created_by' => 'getCreatedBy', + 'created_on' => 'getCreatedOn', + 'edited_by' => 'getEditedBy', + 'edited_on' => 'getEditedOn', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'pinned' => 'getPinned', + 'transaction' => 'getTransaction', + 'version' => 'getVersion' + ]; + + + + /** + * 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['created_by'] = isset($data['created_by']) ? $data['created_by'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['edited_by'] = isset($data['edited_by']) ? $data['edited_by'] : null; + + $this->container['edited_on'] = isset($data['edited_on']) ? $data['edited_on'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['pinned'] = isset($data['pinned']) ? $data['pinned'] : null; + + $this->container['transaction'] = isset($data['transaction']) ? $data['transaction'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content + * + * @return $this + */ + public function setContent($content) + { + $this->container['content'] = $content; + + return $this; + } + + + /** + * Gets created_by + * + * @return int + */ + public function getCreatedBy() + { + return $this->container['created_by']; + } + + /** + * Sets created_by + * + * @param int $created_by + * + * @return $this + */ + public function setCreatedBy($created_by) + { + $this->container['created_by'] = $created_by; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets edited_by + * + * @return int + */ + public function getEditedBy() + { + return $this->container['edited_by']; + } + + /** + * Sets edited_by + * + * @param int $edited_by + * + * @return $this + */ + public function setEditedBy($edited_by) + { + $this->container['edited_by'] = $edited_by; + + return $this; + } + + + /** + * Gets edited_on + * + * @return \DateTime + */ + public function getEditedOn() + { + return $this->container['edited_on']; + } + + /** + * Sets edited_on + * + * @param \DateTime $edited_on The date on which the comment was last edited. + * + * @return $this + */ + public function setEditedOn($edited_on) + { + $this->container['edited_on'] = $edited_on; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets pinned + * + * @return bool + */ + public function getPinned() + { + return $this->container['pinned']; + } + + /** + * Sets pinned + * + * @param bool $pinned + * + * @return $this + */ + public function setPinned($pinned) + { + $this->container['pinned'] = $pinned; + + return $this; + } + + + /** + * Gets transaction + * + * @return int + */ + public function getTransaction() + { + return $this->container['transaction']; + } + + /** + * Sets transaction + * + * @param int $transaction + * + * @return $this + */ + public function setTransaction($transaction) + { + $this->container['transaction'] = $transaction; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/TransactionCommentActive.php b/wallee-sdk/lib/Model/TransactionCommentActive.php new file mode 100644 index 0000000..f9a5f27 --- /dev/null +++ b/wallee-sdk/lib/Model/TransactionCommentActive.php @@ -0,0 +1,330 @@ + 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/TransactionCommentCreate.php b/wallee-sdk/lib/Model/TransactionCommentCreate.php new file mode 100644 index 0000000..3a505a6 --- /dev/null +++ b/wallee-sdk/lib/Model/TransactionCommentCreate.php @@ -0,0 +1,295 @@ + 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'transaction' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'transaction' => 'transaction' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'transaction' => 'setTransaction' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'transaction' => 'getTransaction' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['transaction'] = isset($data['transaction']) ? $data['transaction'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['transaction'] === null) { + $invalidProperties[] = "'transaction' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 transaction + * + * @return int + */ + public function getTransaction() + { + return $this->container['transaction']; + } + + /** + * Sets transaction + * + * @param int $transaction + * + * @return $this + */ + public function setTransaction($transaction) + { + $this->container['transaction'] = $transaction; + + 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/wallee-sdk/lib/Model/TransactionCompletion.php b/wallee-sdk/lib/Model/TransactionCompletion.php index c5957a4..8eac277 100644 --- a/wallee-sdk/lib/Model/TransactionCompletion.php +++ b/wallee-sdk/lib/Model/TransactionCompletion.php @@ -1,10 +1,8 @@ 'int', - 'createdOn' => '\DateTime', - 'failedOn' => '\DateTime', - 'failureReason' => '\Wallee\Sdk\Model\FailureReason', - 'labels' => '\Wallee\Sdk\Model\Label[]', - 'language' => 'string', - 'lineItemVersion' => '\Wallee\Sdk\Model\TransactionLineItemVersion', - 'mode' => '\Wallee\Sdk\Model\TransactionCompletionMode', - 'nextUpdateOn' => '\DateTime', - 'paymentInformation' => 'string', - 'plannedPurgeDate' => '\DateTime', - 'processorReference' => 'string', - 'spaceViewId' => 'int', - 'state' => '\Wallee\Sdk\Model\TransactionCompletionState', - 'succeededOn' => '\DateTime', - 'timeoutOn' => '\DateTime', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * - * - * @var int - */ - private $createdBy; - - /** - * The created on date indicates the date on which the entity was stored into the database. - * - * @var \DateTime - */ - private $createdOn; - - /** - * - * - * @var \DateTime - */ - private $failedOn; - - /** - * - * - * @var \Wallee\Sdk\Model\FailureReason - */ - private $failureReason; - - /** - * - * - * @var \Wallee\Sdk\Model\Label[] - */ - private $labels; - - /** - * - * - * @var string - */ - private $language; - - /** - * - * - * @var \Wallee\Sdk\Model\TransactionLineItemVersion - */ - private $lineItemVersion; - - /** - * - * - * @var \Wallee\Sdk\Model\TransactionCompletionMode - */ - private $mode; - - /** - * - * - * @var \DateTime - */ - private $nextUpdateOn; - - /** - * - * - * @var string - */ - private $paymentInformation; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var string - */ - private $processorReference; - - /** - * - * - * @var int - */ - private $spaceViewId; - - /** - * - * - * @var \Wallee\Sdk\Model\TransactionCompletionState - */ - private $state; - - /** - * - * - * @var \DateTime - */ - private $succeededOn; - - /** - * - * - * @var \DateTime - */ - private $timeoutOn; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['failureReason'])) { - $this->setFailureReason($data['failureReason']); - } - if (isset($data['labels'])) { - $this->setLabels($data['labels']); - } - if (isset($data['lineItemVersion'])) { - $this->setLineItemVersion($data['lineItemVersion']); - } - if (isset($data['mode'])) { - $this->setMode($data['mode']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - } - - - /** - * Returns createdBy. - * - * - * - * @return int - */ - public function getCreatedBy() { - return $this->createdBy; - } - - /** - * Sets createdBy. - * - * @param int $createdBy - * @return TransactionCompletion - */ - protected function setCreatedBy($createdBy) { - $this->createdBy = $createdBy; - - return $this; - } - - /** - * Returns createdOn. - * - * The created on date indicates the date on which the entity was stored into the database. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return TransactionCompletion - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns failedOn. - * - * - * - * @return \DateTime - */ - public function getFailedOn() { - return $this->failedOn; - } - - /** - * Sets failedOn. - * - * @param \DateTime $failedOn - * @return TransactionCompletion - */ - protected function setFailedOn($failedOn) { - $this->failedOn = $failedOn; - - return $this; - } - - /** - * Returns failureReason. - * - * - * - * @return \Wallee\Sdk\Model\FailureReason - */ - public function getFailureReason() { - return $this->failureReason; - } - - /** - * Sets failureReason. - * - * @param \Wallee\Sdk\Model\FailureReason $failureReason - * @return TransactionCompletion - */ - public function setFailureReason($failureReason) { - $this->failureReason = $failureReason; - - return $this; - } - - /** - * Returns labels. - * - * - * - * @return \Wallee\Sdk\Model\Label[] - */ - public function getLabels() { - return $this->labels; - } - - /** - * Sets labels. - * - * @param \Wallee\Sdk\Model\Label[] $labels - * @return TransactionCompletion - */ - public function setLabels($labels) { - $this->labels = $labels; - - return $this; - } - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return TransactionCompletion - */ - protected function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns lineItemVersion. - * - * - * - * @return \Wallee\Sdk\Model\TransactionLineItemVersion - */ - public function getLineItemVersion() { - return $this->lineItemVersion; - } - - /** - * Sets lineItemVersion. - * - * @param \Wallee\Sdk\Model\TransactionLineItemVersion $lineItemVersion - * @return TransactionCompletion - */ - public function setLineItemVersion($lineItemVersion) { - $this->lineItemVersion = $lineItemVersion; - - return $this; - } - - /** - * Returns mode. - * - * - * - * @return \Wallee\Sdk\Model\TransactionCompletionMode - */ - public function getMode() { - return $this->mode; - } - - /** - * Sets mode. - * - * @param \Wallee\Sdk\Model\TransactionCompletionMode $mode - * @return TransactionCompletion - */ - public function setMode($mode) { - $this->mode = $mode; - - return $this; - } - - /** - * Returns nextUpdateOn. - * - * - * - * @return \DateTime - */ - public function getNextUpdateOn() { - return $this->nextUpdateOn; - } - - /** - * Sets nextUpdateOn. - * - * @param \DateTime $nextUpdateOn - * @return TransactionCompletion - */ - protected function setNextUpdateOn($nextUpdateOn) { - $this->nextUpdateOn = $nextUpdateOn; - - return $this; - } - - /** - * Returns paymentInformation. - * - * - * - * @return string - */ - public function getPaymentInformation() { - return $this->paymentInformation; - } - - /** - * Sets paymentInformation. - * - * @param string $paymentInformation - * @return TransactionCompletion - */ - protected function setPaymentInformation($paymentInformation) { - $this->paymentInformation = $paymentInformation; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return TransactionCompletion - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns processorReference. - * - * - * - * @return string - */ - public function getProcessorReference() { - return $this->processorReference; - } - - /** - * Sets processorReference. - * - * @param string $processorReference - * @return TransactionCompletion - */ - protected function setProcessorReference($processorReference) { - $this->processorReference = $processorReference; - - return $this; - } - - /** - * Returns spaceViewId. - * - * - * - * @return int - */ - public function getSpaceViewId() { - return $this->spaceViewId; - } - - /** - * Sets spaceViewId. - * - * @param int $spaceViewId - * @return TransactionCompletion - */ - protected function setSpaceViewId($spaceViewId) { - $this->spaceViewId = $spaceViewId; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\TransactionCompletionState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\TransactionCompletionState $state - * @return TransactionCompletion - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns succeededOn. - * - * - * - * @return \DateTime - */ - public function getSucceededOn() { - return $this->succeededOn; - } - - /** - * Sets succeededOn. - * - * @param \DateTime $succeededOn - * @return TransactionCompletion - */ - protected function setSucceededOn($succeededOn) { - $this->succeededOn = $succeededOn; - - return $this; - } - - /** - * Returns timeoutOn. - * - * - * - * @return \DateTime - */ - public function getTimeoutOn() { - return $this->timeoutOn; - } - - /** - * Sets timeoutOn. - * - * @param \DateTime $timeoutOn - * @return TransactionCompletion - */ - protected function setTimeoutOn($timeoutOn) { - $this->timeoutOn = $timeoutOn; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return TransactionCompletion - */ - protected function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class TransactionCompletion extends TransactionAwareEntity +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'TransactionCompletion'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'amount' => 'float', + 'base_line_items' => '\Wallee\Sdk\Model\LineItem[]', + 'created_by' => 'int', + 'created_on' => '\DateTime', + 'external_id' => 'string', + 'failed_on' => '\DateTime', + 'failure_reason' => '\Wallee\Sdk\Model\FailureReason', + 'labels' => '\Wallee\Sdk\Model\Label[]', + 'language' => 'string', + 'last_completion' => 'bool', + 'line_item_version' => '\Wallee\Sdk\Model\TransactionLineItemVersion', + 'line_items' => '\Wallee\Sdk\Model\LineItem[]', + 'mode' => '\Wallee\Sdk\Model\TransactionCompletionMode', + 'next_update_on' => '\DateTime', + 'payment_information' => 'string', + 'planned_purge_date' => '\DateTime', + 'processing_on' => '\DateTime', + 'processor_reference' => 'string', + 'remaining_line_items' => '\Wallee\Sdk\Model\LineItem[]', + 'space_view_id' => 'int', + 'state' => '\Wallee\Sdk\Model\TransactionCompletionState', + 'succeeded_on' => '\DateTime', + 'tax_amount' => 'float', + 'time_zone' => 'string', + 'timeout_on' => '\DateTime', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'amount' => null, + 'base_line_items' => null, + 'created_by' => 'int64', + 'created_on' => 'date-time', + 'external_id' => null, + 'failed_on' => 'date-time', + 'failure_reason' => null, + 'labels' => null, + 'language' => null, + 'last_completion' => null, + 'line_item_version' => null, + 'line_items' => null, + 'mode' => null, + 'next_update_on' => 'date-time', + 'payment_information' => null, + 'planned_purge_date' => 'date-time', + 'processing_on' => 'date-time', + 'processor_reference' => null, + 'remaining_line_items' => null, + 'space_view_id' => 'int64', + 'state' => null, + 'succeeded_on' => 'date-time', + 'tax_amount' => null, + 'time_zone' => null, + 'timeout_on' => 'date-time', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'base_line_items' => 'baseLineItems', + 'created_by' => 'createdBy', + 'created_on' => 'createdOn', + 'external_id' => 'externalId', + 'failed_on' => 'failedOn', + 'failure_reason' => 'failureReason', + 'labels' => 'labels', + 'language' => 'language', + 'last_completion' => 'lastCompletion', + 'line_item_version' => 'lineItemVersion', + 'line_items' => 'lineItems', + 'mode' => 'mode', + 'next_update_on' => 'nextUpdateOn', + 'payment_information' => 'paymentInformation', + 'planned_purge_date' => 'plannedPurgeDate', + 'processing_on' => 'processingOn', + 'processor_reference' => 'processorReference', + 'remaining_line_items' => 'remainingLineItems', + 'space_view_id' => 'spaceViewId', + 'state' => 'state', + 'succeeded_on' => 'succeededOn', + 'tax_amount' => 'taxAmount', + 'time_zone' => 'timeZone', + 'timeout_on' => 'timeoutOn', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'base_line_items' => 'setBaseLineItems', + 'created_by' => 'setCreatedBy', + 'created_on' => 'setCreatedOn', + 'external_id' => 'setExternalId', + 'failed_on' => 'setFailedOn', + 'failure_reason' => 'setFailureReason', + 'labels' => 'setLabels', + 'language' => 'setLanguage', + 'last_completion' => 'setLastCompletion', + 'line_item_version' => 'setLineItemVersion', + 'line_items' => 'setLineItems', + 'mode' => 'setMode', + 'next_update_on' => 'setNextUpdateOn', + 'payment_information' => 'setPaymentInformation', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'processing_on' => 'setProcessingOn', + 'processor_reference' => 'setProcessorReference', + 'remaining_line_items' => 'setRemainingLineItems', + 'space_view_id' => 'setSpaceViewId', + 'state' => 'setState', + 'succeeded_on' => 'setSucceededOn', + 'tax_amount' => 'setTaxAmount', + 'time_zone' => 'setTimeZone', + 'timeout_on' => 'setTimeoutOn', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'base_line_items' => 'getBaseLineItems', + 'created_by' => 'getCreatedBy', + 'created_on' => 'getCreatedOn', + 'external_id' => 'getExternalId', + 'failed_on' => 'getFailedOn', + 'failure_reason' => 'getFailureReason', + 'labels' => 'getLabels', + 'language' => 'getLanguage', + 'last_completion' => 'getLastCompletion', + 'line_item_version' => 'getLineItemVersion', + 'line_items' => 'getLineItems', + 'mode' => 'getMode', + 'next_update_on' => 'getNextUpdateOn', + 'payment_information' => 'getPaymentInformation', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'processing_on' => 'getProcessingOn', + 'processor_reference' => 'getProcessorReference', + 'remaining_line_items' => 'getRemainingLineItems', + 'space_view_id' => 'getSpaceViewId', + 'state' => 'getState', + 'succeeded_on' => 'getSucceededOn', + 'tax_amount' => 'getTaxAmount', + 'time_zone' => 'getTimeZone', + 'timeout_on' => 'getTimeoutOn', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + + $this->container['base_line_items'] = isset($data['base_line_items']) ? $data['base_line_items'] : null; + + $this->container['created_by'] = isset($data['created_by']) ? $data['created_by'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['failed_on'] = isset($data['failed_on']) ? $data['failed_on'] : null; + + $this->container['failure_reason'] = isset($data['failure_reason']) ? $data['failure_reason'] : null; + + $this->container['labels'] = isset($data['labels']) ? $data['labels'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['last_completion'] = isset($data['last_completion']) ? $data['last_completion'] : null; + + $this->container['line_item_version'] = isset($data['line_item_version']) ? $data['line_item_version'] : null; + + $this->container['line_items'] = isset($data['line_items']) ? $data['line_items'] : null; + + $this->container['mode'] = isset($data['mode']) ? $data['mode'] : null; + + $this->container['next_update_on'] = isset($data['next_update_on']) ? $data['next_update_on'] : null; + + $this->container['payment_information'] = isset($data['payment_information']) ? $data['payment_information'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['processing_on'] = isset($data['processing_on']) ? $data['processing_on'] : null; + + $this->container['processor_reference'] = isset($data['processor_reference']) ? $data['processor_reference'] : null; + + $this->container['remaining_line_items'] = isset($data['remaining_line_items']) ? $data['remaining_line_items'] : null; + + $this->container['space_view_id'] = isset($data['space_view_id']) ? $data['space_view_id'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['succeeded_on'] = isset($data['succeeded_on']) ? $data['succeeded_on'] : null; + + $this->container['tax_amount'] = isset($data['tax_amount']) ? $data['tax_amount'] : null; + + $this->container['time_zone'] = isset($data['time_zone']) ? $data['time_zone'] : null; + + $this->container['timeout_on'] = isset($data['timeout_on']) ? $data['timeout_on'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 amount + * + * @return float + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param float $amount The amount which is captured. The amount represents sum of line items including taxes. + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + + /** + * Gets base_line_items + * + * @return \Wallee\Sdk\Model\LineItem[] + */ + public function getBaseLineItems() + { + return $this->container['base_line_items']; + } + + /** + * Sets base_line_items + * + * @param \Wallee\Sdk\Model\LineItem[] $base_line_items The base line items on which the completion is applied on. + * + * @return $this + */ + public function setBaseLineItems($base_line_items) + { + $this->container['base_line_items'] = $base_line_items; + + return $this; + } + + + /** + * Gets created_by + * + * @return int + */ + public function getCreatedBy() + { + return $this->container['created_by']; + } + + /** + * Sets created_by + * + * @param int $created_by + * + * @return $this + */ + public function setCreatedBy($created_by) + { + $this->container['created_by'] = $created_by; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external ID helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets failed_on + * + * @return \DateTime + */ + public function getFailedOn() + { + return $this->container['failed_on']; + } + + /** + * Sets failed_on + * + * @param \DateTime $failed_on + * + * @return $this + */ + public function setFailedOn($failed_on) + { + $this->container['failed_on'] = $failed_on; + + return $this; + } + + + /** + * Gets failure_reason + * + * @return \Wallee\Sdk\Model\FailureReason + */ + public function getFailureReason() + { + return $this->container['failure_reason']; + } + + /** + * Sets failure_reason + * + * @param \Wallee\Sdk\Model\FailureReason $failure_reason + * + * @return $this + */ + public function setFailureReason($failure_reason) + { + $this->container['failure_reason'] = $failure_reason; + + return $this; + } + + + /** + * Gets labels + * + * @return \Wallee\Sdk\Model\Label[] + */ + public function getLabels() + { + return $this->container['labels']; + } + + /** + * Sets labels + * + * @param \Wallee\Sdk\Model\Label[] $labels + * + * @return $this + */ + public function setLabels($labels) + { + $this->container['labels'] = $labels; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets last_completion + * + * @return bool + */ + public function getLastCompletion() + { + return $this->container['last_completion']; + } + + /** + * Sets last_completion + * + * @param bool $last_completion Indicates if this is the last completion. After the last completion is created the transaction cannot be completed anymore. + * + * @return $this + */ + public function setLastCompletion($last_completion) + { + $this->container['last_completion'] = $last_completion; + + return $this; + } + + + /** + * Gets line_item_version + * + * @return \Wallee\Sdk\Model\TransactionLineItemVersion + */ + public function getLineItemVersion() + { + return $this->container['line_item_version']; + } + + /** + * Sets line_item_version + * + * @param \Wallee\Sdk\Model\TransactionLineItemVersion $line_item_version + * + * @return $this + */ + public function setLineItemVersion($line_item_version) + { + $this->container['line_item_version'] = $line_item_version; + + return $this; + } + + + /** + * Gets line_items + * + * @return \Wallee\Sdk\Model\LineItem[] + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Wallee\Sdk\Model\LineItem[] $line_items The line items which are captured. + * + * @return $this + */ + public function setLineItems($line_items) + { + $this->container['line_items'] = $line_items; + + return $this; + } + + + /** + * Gets mode + * + * @return \Wallee\Sdk\Model\TransactionCompletionMode + */ + public function getMode() + { + return $this->container['mode']; + } + + /** + * Sets mode + * + * @param \Wallee\Sdk\Model\TransactionCompletionMode $mode + * + * @return $this + */ + public function setMode($mode) + { + $this->container['mode'] = $mode; + + return $this; + } + + + /** + * Gets next_update_on + * + * @return \DateTime + */ + public function getNextUpdateOn() + { + return $this->container['next_update_on']; + } + + /** + * Sets next_update_on + * + * @param \DateTime $next_update_on + * + * @return $this + */ + public function setNextUpdateOn($next_update_on) + { + $this->container['next_update_on'] = $next_update_on; + + return $this; + } + + + /** + * Gets payment_information + * + * @return string + */ + public function getPaymentInformation() + { + return $this->container['payment_information']; + } + + /** + * Sets payment_information + * + * @param string $payment_information + * + * @return $this + */ + public function setPaymentInformation($payment_information) + { + $this->container['payment_information'] = $payment_information; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets processing_on + * + * @return \DateTime + */ + public function getProcessingOn() + { + return $this->container['processing_on']; + } + + /** + * Sets processing_on + * + * @param \DateTime $processing_on + * + * @return $this + */ + public function setProcessingOn($processing_on) + { + $this->container['processing_on'] = $processing_on; + + return $this; + } + + + /** + * Gets processor_reference + * + * @return string + */ + public function getProcessorReference() + { + return $this->container['processor_reference']; + } + + /** + * Sets processor_reference + * + * @param string $processor_reference + * + * @return $this + */ + public function setProcessorReference($processor_reference) + { + $this->container['processor_reference'] = $processor_reference; + + return $this; + } + + + /** + * Gets remaining_line_items + * + * @return \Wallee\Sdk\Model\LineItem[] + */ + public function getRemainingLineItems() + { + return $this->container['remaining_line_items']; + } + + /** + * Sets remaining_line_items + * + * @param \Wallee\Sdk\Model\LineItem[] $remaining_line_items + * + * @return $this + */ + public function setRemainingLineItems($remaining_line_items) + { + $this->container['remaining_line_items'] = $remaining_line_items; + + return $this; + } + + + /** + * Gets space_view_id + * + * @return int + */ + public function getSpaceViewId() + { + return $this->container['space_view_id']; + } + + /** + * Sets space_view_id + * + * @param int $space_view_id + * + * @return $this + */ + public function setSpaceViewId($space_view_id) + { + $this->container['space_view_id'] = $space_view_id; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\TransactionCompletionState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\TransactionCompletionState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets succeeded_on + * + * @return \DateTime + */ + public function getSucceededOn() + { + return $this->container['succeeded_on']; + } + + /** + * Sets succeeded_on + * + * @param \DateTime $succeeded_on + * + * @return $this + */ + public function setSucceededOn($succeeded_on) + { + $this->container['succeeded_on'] = $succeeded_on; + + return $this; + } + + + /** + * Gets tax_amount + * + * @return float + */ + public function getTaxAmount() + { + return $this->container['tax_amount']; + } + + /** + * Sets tax_amount + * + * @param float $tax_amount The total sum of all taxes of line items. + * + * @return $this + */ + public function setTaxAmount($tax_amount) + { + $this->container['tax_amount'] = $tax_amount; + + return $this; + } + + + /** + * Gets time_zone + * + * @return string + */ + public function getTimeZone() + { + return $this->container['time_zone']; + } + + /** + * Sets time_zone + * + * @param string $time_zone + * + * @return $this + */ + public function setTimeZone($time_zone) + { + $this->container['time_zone'] = $time_zone; + + return $this; + } + + + /** + * Gets timeout_on + * + * @return \DateTime + */ + public function getTimeoutOn() + { + return $this->container['timeout_on']; + } + + /** + * Sets timeout_on + * + * @param \DateTime $timeout_on + * + * @return $this + */ + public function setTimeoutOn($timeout_on) + { + $this->container['timeout_on'] = $timeout_on; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/TransactionCompletionMode.php b/wallee-sdk/lib/Model/TransactionCompletionMode.php index 919a0ad..14847a8 100644 --- a/wallee-sdk/lib/Model/TransactionCompletionMode.php +++ b/wallee-sdk/lib/Model/TransactionCompletionMode.php @@ -1,10 +1,8 @@ 'string', + 'last_completion' => 'bool', + 'line_items' => '\Wallee\Sdk\Model\CompletionLineItemCreate[]', + 'transaction_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'external_id' => null, + 'last_completion' => null, + 'line_items' => null, + 'transaction_id' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'external_id' => 'externalId', + 'last_completion' => 'lastCompletion', + 'line_items' => 'lineItems', + 'transaction_id' => 'transactionId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'external_id' => 'setExternalId', + 'last_completion' => 'setLastCompletion', + 'line_items' => 'setLineItems', + 'transaction_id' => 'setTransactionId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'external_id' => 'getExternalId', + 'last_completion' => 'getLastCompletion', + 'line_items' => 'getLineItems', + 'transaction_id' => 'getTransactionId' + ]; + + + + /** + * 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['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['last_completion'] = isset($data['last_completion']) ? $data['last_completion'] : null; + + $this->container['line_items'] = isset($data['line_items']) ? $data['line_items'] : null; + + $this->container['transaction_id'] = isset($data['transaction_id']) ? $data['transaction_id'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['external_id'] === null) { + $invalidProperties[] = "'external_id' can't be null"; + } + if ($this->container['last_completion'] === null) { + $invalidProperties[] = "'last_completion' can't be null"; + } + if ($this->container['transaction_id'] === null) { + $invalidProperties[] = "'transaction_id' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external ID helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets last_completion + * + * @return bool + */ + public function getLastCompletion() + { + return $this->container['last_completion']; + } + + /** + * Sets last_completion + * + * @param bool $last_completion The last completion flag indicates if this is the last completion. After the last completion is created no further completions can be issued. + * + * @return $this + */ + public function setLastCompletion($last_completion) + { + $this->container['last_completion'] = $last_completion; + + return $this; + } + + + /** + * Gets line_items + * + * @return \Wallee\Sdk\Model\CompletionLineItemCreate[] + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Wallee\Sdk\Model\CompletionLineItemCreate[] $line_items The line items which will be used to complete the transaction. + * + * @return $this + */ + public function setLineItems($line_items) + { + $this->container['line_items'] = $line_items; + + return $this; + } + + + /** + * Gets transaction_id + * + * @return int + */ + public function getTransactionId() + { + return $this->container['transaction_id']; + } + + /** + * Sets transaction_id + * + * @param int $transaction_id The ID of the transaction which should be completed. + * + * @return $this + */ + public function setTransactionId($transaction_id) + { + $this->container['transaction_id'] = $transaction_id; + + 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/wallee-sdk/lib/Model/TransactionCompletionState.php b/wallee-sdk/lib/Model/TransactionCompletionState.php index 53eecee..76957b4 100644 --- a/wallee-sdk/lib/Model/TransactionCompletionState.php +++ b/wallee-sdk/lib/Model/TransactionCompletionState.php @@ -1,10 +1,8 @@ 'bool', - 'chargeRetryEnabled' => 'bool', - 'customersPresence' => '\Wallee\Sdk\Model\CustomersPresence', - 'deviceSessionIdentifier' => 'string', - 'environment' => '\Wallee\Sdk\Model\Environment', - 'environmentSelectionStrategy' => '\Wallee\Sdk\Model\TransactionEnvironmentSelectionStrategy', - 'spaceViewId' => 'int', - ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * When auto confirmation is enabled the transaction can be confirmed by the user and does not require an explicit confirmation through the web service API. - * - * @var bool - */ - private $autoConfirmationEnabled; - - /** - * When the charging of the customer fails we can retry the charging. This implies that we redirect the user back to the payment page which allows the customer to retry. By default we will retry. - * - * @var bool - */ - private $chargeRetryEnabled; - - /** - * The customer's presence indicates what kind of authentication methods can be used during the authorization of the transaction. If no value is provided, 'Virtually Present' is used by default. - * - * @var \Wallee\Sdk\Model\CustomersPresence - */ - private $customersPresence; - - /** - * The device session identifier links the transaction with the session identifier provided in the URL of the device data JavaScript. This allows to link the transaction with the collected device data of the buyer. - * - * @var string - */ - private $deviceSessionIdentifier; - - /** - * - * - * @var \Wallee\Sdk\Model\Environment - */ - private $environment; - - /** - * The environment selection strategy determines how the environment (test or production) for processing the transaction is selected. - * - * @var \Wallee\Sdk\Model\TransactionEnvironmentSelectionStrategy - */ - private $environmentSelectionStrategy; - - /** - * - * - * @var int - */ - private $spaceViewId; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['autoConfirmationEnabled'])) { - $this->setAutoConfirmationEnabled($data['autoConfirmationEnabled']); - } - if (isset($data['billingAddress'])) { - $this->setBillingAddress($data['billingAddress']); - } - if (isset($data['chargeRetryEnabled'])) { - $this->setChargeRetryEnabled($data['chargeRetryEnabled']); - } - if (isset($data['customersPresence'])) { - $this->setCustomersPresence($data['customersPresence']); - } - if (isset($data['deviceSessionIdentifier'])) { - $this->setDeviceSessionIdentifier($data['deviceSessionIdentifier']); - } - if (isset($data['environment'])) { - $this->setEnvironment($data['environment']); - } - if (isset($data['environmentSelectionStrategy'])) { - $this->setEnvironmentSelectionStrategy($data['environmentSelectionStrategy']); - } - if (isset($data['lineItems'])) { - $this->setLineItems($data['lineItems']); - } - if (isset($data['shippingAddress'])) { - $this->setShippingAddress($data['shippingAddress']); - } - if (isset($data['spaceViewId'])) { - $this->setSpaceViewId($data['spaceViewId']); - } - if (isset($data['token'])) { - $this->setToken($data['token']); - } - } - - - /** - * Returns autoConfirmationEnabled. - * - * When auto confirmation is enabled the transaction can be confirmed by the user and does not require an explicit confirmation through the web service API. - * - * @return bool - */ - public function getAutoConfirmationEnabled() { - return $this->autoConfirmationEnabled; - } - - /** - * Sets autoConfirmationEnabled. - * - * @param bool $autoConfirmationEnabled - * @return TransactionCreate - */ - public function setAutoConfirmationEnabled($autoConfirmationEnabled) { - $this->autoConfirmationEnabled = $autoConfirmationEnabled; - - return $this; - } - - /** - * Returns billingAddress. - * - * - * - * @return \Wallee\Sdk\Model\AddressCreate - */ - public function getBillingAddress() { - return parent::getBillingAddress(); - } - - /** - * Sets billingAddress. - * - * @param \Wallee\Sdk\Model\AddressCreate $billingAddress - * @return TransactionCreate - */ - public function setBillingAddress($billingAddress) { - return parent::setBillingAddress($billingAddress); - } - - /** - * Returns chargeRetryEnabled. - * - * When the charging of the customer fails we can retry the charging. This implies that we redirect the user back to the payment page which allows the customer to retry. By default we will retry. - * - * @return bool - */ - public function getChargeRetryEnabled() { - return $this->chargeRetryEnabled; - } - - /** - * Sets chargeRetryEnabled. - * - * @param bool $chargeRetryEnabled - * @return TransactionCreate - */ - public function setChargeRetryEnabled($chargeRetryEnabled) { - $this->chargeRetryEnabled = $chargeRetryEnabled; - - return $this; - } - - /** - * Returns customersPresence. - * - * The customer's presence indicates what kind of authentication methods can be used during the authorization of the transaction. If no value is provided, 'Virtually Present' is used by default. - * - * @return \Wallee\Sdk\Model\CustomersPresence - */ - public function getCustomersPresence() { - return $this->customersPresence; - } - - /** - * Sets customersPresence. - * - * @param \Wallee\Sdk\Model\CustomersPresence $customersPresence - * @return TransactionCreate - */ - public function setCustomersPresence($customersPresence) { - $this->customersPresence = $customersPresence; - - return $this; - } - - /** - * Returns deviceSessionIdentifier. - * - * The device session identifier links the transaction with the session identifier provided in the URL of the device data JavaScript. This allows to link the transaction with the collected device data of the buyer. - * - * @return string - */ - public function getDeviceSessionIdentifier() { - return $this->deviceSessionIdentifier; - } - - /** - * Sets deviceSessionIdentifier. - * - * @param string $deviceSessionIdentifier - * @return TransactionCreate - */ - public function setDeviceSessionIdentifier($deviceSessionIdentifier) { - $this->deviceSessionIdentifier = $deviceSessionIdentifier; - - return $this; - } - - /** - * Returns environment. - * - * - * - * @return \Wallee\Sdk\Model\Environment - */ - public function getEnvironment() { - return $this->environment; - } - - /** - * Sets environment. - * - * @param \Wallee\Sdk\Model\Environment $environment - * @return TransactionCreate - */ - public function setEnvironment($environment) { - $this->environment = $environment; - - return $this; - } - - /** - * Returns environmentSelectionStrategy. - * - * The environment selection strategy determines how the environment (test or production) for processing the transaction is selected. - * - * @return \Wallee\Sdk\Model\TransactionEnvironmentSelectionStrategy - */ - public function getEnvironmentSelectionStrategy() { - return $this->environmentSelectionStrategy; - } - - /** - * Sets environmentSelectionStrategy. - * - * @param \Wallee\Sdk\Model\TransactionEnvironmentSelectionStrategy $environmentSelectionStrategy - * @return TransactionCreate - */ - public function setEnvironmentSelectionStrategy($environmentSelectionStrategy) { - $this->environmentSelectionStrategy = $environmentSelectionStrategy; - - return $this; - } - - /** - * Returns lineItems. - * - * - * - * @return \Wallee\Sdk\Model\LineItemCreate[] - */ - public function getLineItems() { - return parent::getLineItems(); - } - - /** - * Sets lineItems. - * - * @param \Wallee\Sdk\Model\LineItemCreate[] $lineItems - * @return TransactionCreate - */ - public function setLineItems($lineItems) { - return parent::setLineItems($lineItems); - } - - /** - * Returns shippingAddress. - * - * - * - * @return \Wallee\Sdk\Model\AddressCreate - */ - public function getShippingAddress() { - return parent::getShippingAddress(); - } - - /** - * Sets shippingAddress. - * - * @param \Wallee\Sdk\Model\AddressCreate $shippingAddress - * @return TransactionCreate - */ - public function setShippingAddress($shippingAddress) { - return parent::setShippingAddress($shippingAddress); - } - - /** - * Returns spaceViewId. - * - * - * - * @return int - */ - public function getSpaceViewId() { - return $this->spaceViewId; - } - - /** - * Sets spaceViewId. - * - * @param int $spaceViewId - * @return TransactionCreate - */ - public function setSpaceViewId($spaceViewId) { - $this->spaceViewId = $spaceViewId; - - return $this; - } - - /** - * Returns token. - * - * - * - * @return int - */ - public function getToken() { - return parent::getToken(); - } - - /** - * Sets token. - * - * @param int $token - * @return TransactionCreate - */ - public function setToken($token) { - return parent::setToken($token); - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - if ($this->getLineItems() === null) { - throw new ValidationException("'lineItems' can't be null", 'lineItems', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class TransactionCreate extends AbstractTransactionPending +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Transaction.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'auto_confirmation_enabled' => 'bool', + 'charge_retry_enabled' => 'bool', + 'customers_presence' => '\Wallee\Sdk\Model\CustomersPresence', + 'device_session_identifier' => 'string', + 'environment' => '\Wallee\Sdk\Model\Environment', + 'environment_selection_strategy' => '\Wallee\Sdk\Model\TransactionEnvironmentSelectionStrategy', + 'space_view_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'auto_confirmation_enabled' => null, + 'charge_retry_enabled' => null, + 'customers_presence' => null, + 'device_session_identifier' => null, + 'environment' => null, + 'environment_selection_strategy' => null, + 'space_view_id' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'auto_confirmation_enabled' => 'autoConfirmationEnabled', + 'charge_retry_enabled' => 'chargeRetryEnabled', + 'customers_presence' => 'customersPresence', + 'device_session_identifier' => 'deviceSessionIdentifier', + 'environment' => 'environment', + 'environment_selection_strategy' => 'environmentSelectionStrategy', + 'space_view_id' => 'spaceViewId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'auto_confirmation_enabled' => 'setAutoConfirmationEnabled', + 'charge_retry_enabled' => 'setChargeRetryEnabled', + 'customers_presence' => 'setCustomersPresence', + 'device_session_identifier' => 'setDeviceSessionIdentifier', + 'environment' => 'setEnvironment', + 'environment_selection_strategy' => 'setEnvironmentSelectionStrategy', + 'space_view_id' => 'setSpaceViewId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'auto_confirmation_enabled' => 'getAutoConfirmationEnabled', + 'charge_retry_enabled' => 'getChargeRetryEnabled', + 'customers_presence' => 'getCustomersPresence', + 'device_session_identifier' => 'getDeviceSessionIdentifier', + 'environment' => 'getEnvironment', + 'environment_selection_strategy' => 'getEnvironmentSelectionStrategy', + 'space_view_id' => 'getSpaceViewId' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['auto_confirmation_enabled'] = isset($data['auto_confirmation_enabled']) ? $data['auto_confirmation_enabled'] : null; + + $this->container['charge_retry_enabled'] = isset($data['charge_retry_enabled']) ? $data['charge_retry_enabled'] : null; + + $this->container['customers_presence'] = isset($data['customers_presence']) ? $data['customers_presence'] : null; + + $this->container['device_session_identifier'] = isset($data['device_session_identifier']) ? $data['device_session_identifier'] : null; + + $this->container['environment'] = isset($data['environment']) ? $data['environment'] : null; + + $this->container['environment_selection_strategy'] = isset($data['environment_selection_strategy']) ? $data['environment_selection_strategy'] : null; + + $this->container['space_view_id'] = isset($data['space_view_id']) ? $data['space_view_id'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['line_items'] === null) { + $invalidProperties[] = "'line_items' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 auto_confirmation_enabled + * + * @return bool + */ + public function getAutoConfirmationEnabled() + { + return $this->container['auto_confirmation_enabled']; + } + + /** + * Sets auto_confirmation_enabled + * + * @param bool $auto_confirmation_enabled When auto confirmation is enabled the transaction can be confirmed by the user and does not require an explicit confirmation through the web service API. + * + * @return $this + */ + public function setAutoConfirmationEnabled($auto_confirmation_enabled) + { + $this->container['auto_confirmation_enabled'] = $auto_confirmation_enabled; + + return $this; + } + + + /** + * Gets charge_retry_enabled + * + * @return bool + */ + public function getChargeRetryEnabled() + { + return $this->container['charge_retry_enabled']; + } + + /** + * Sets charge_retry_enabled + * + * @param bool $charge_retry_enabled When the charging of the customer fails we can retry the charging. This implies that we redirect the user back to the payment page which allows the customer to retry. By default we will retry. + * + * @return $this + */ + public function setChargeRetryEnabled($charge_retry_enabled) + { + $this->container['charge_retry_enabled'] = $charge_retry_enabled; + + return $this; + } + + + /** + * Gets customers_presence + * + * @return \Wallee\Sdk\Model\CustomersPresence + */ + public function getCustomersPresence() + { + return $this->container['customers_presence']; + } + + /** + * Sets customers_presence + * + * @param \Wallee\Sdk\Model\CustomersPresence $customers_presence The customer's presence indicates what kind of authentication methods can be used during the authorization of the transaction. If no value is provided, 'Virtually Present' is used by default. + * + * @return $this + */ + public function setCustomersPresence($customers_presence) + { + $this->container['customers_presence'] = $customers_presence; + + return $this; + } + + + /** + * Gets device_session_identifier + * + * @return string + */ + public function getDeviceSessionIdentifier() + { + return $this->container['device_session_identifier']; + } + + /** + * Sets device_session_identifier + * + * @param string $device_session_identifier The device session identifier links the transaction with the session identifier provided in the URL of the device data JavaScript. This allows to link the transaction with the collected device data of the buyer. + * + * @return $this + */ + public function setDeviceSessionIdentifier($device_session_identifier) + { + $this->container['device_session_identifier'] = $device_session_identifier; + + return $this; + } + + + /** + * Gets environment + * + * @return \Wallee\Sdk\Model\Environment + */ + public function getEnvironment() + { + return $this->container['environment']; + } + + /** + * Sets environment + * + * @param \Wallee\Sdk\Model\Environment $environment + * + * @return $this + */ + public function setEnvironment($environment) + { + $this->container['environment'] = $environment; + + return $this; + } + + + /** + * Gets environment_selection_strategy + * + * @return \Wallee\Sdk\Model\TransactionEnvironmentSelectionStrategy + */ + public function getEnvironmentSelectionStrategy() + { + return $this->container['environment_selection_strategy']; + } + + /** + * Sets environment_selection_strategy + * + * @param \Wallee\Sdk\Model\TransactionEnvironmentSelectionStrategy $environment_selection_strategy The environment selection strategy determines how the environment (test or production) for processing the transaction is selected. + * + * @return $this + */ + public function setEnvironmentSelectionStrategy($environment_selection_strategy) + { + $this->container['environment_selection_strategy'] = $environment_selection_strategy; + + return $this; + } + + + /** + * Gets space_view_id + * + * @return int + */ + public function getSpaceViewId() + { + return $this->container['space_view_id']; + } + + /** + * Sets space_view_id + * + * @param int $space_view_id + * + * @return $this + */ + public function setSpaceViewId($space_view_id) + { + $this->container['space_view_id'] = $space_view_id; + + 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/wallee-sdk/lib/Model/TransactionEnvironmentSelectionStrategy.php b/wallee-sdk/lib/Model/TransactionEnvironmentSelectionStrategy.php index ade7df6..efa3d7c 100644 --- a/wallee-sdk/lib/Model/TransactionEnvironmentSelectionStrategy.php +++ b/wallee-sdk/lib/Model/TransactionEnvironmentSelectionStrategy.php @@ -1,10 +1,8 @@ '\DateTime', - 'customerId' => 'string', - 'endDate' => '\DateTime', - 'id' => 'int', - 'linkedSpaceId' => 'int', - 'plannedPurgeDate' => '\DateTime', - 'state' => '\Wallee\Sdk\Model\TransactionGroupState', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \DateTime - */ - private $beginDate; - - /** - * - * - * @var string - */ - private $customerId; - - /** - * - * - * @var \DateTime - */ - private $endDate; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var \Wallee\Sdk\Model\TransactionGroupState - */ - private $state; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns beginDate. - * - * - * - * @return \DateTime - */ - public function getBeginDate() { - return $this->beginDate; - } - - /** - * Sets beginDate. - * - * @param \DateTime $beginDate - * @return TransactionGroup - */ - protected function setBeginDate($beginDate) { - $this->beginDate = $beginDate; - - return $this; - } - - /** - * Returns customerId. - * - * - * - * @return string - */ - public function getCustomerId() { - return $this->customerId; - } - - /** - * Sets customerId. - * - * @param string $customerId - * @return TransactionGroup - */ - protected function setCustomerId($customerId) { - $this->customerId = $customerId; - - return $this; - } - - /** - * Returns endDate. - * - * - * - * @return \DateTime - */ - public function getEndDate() { - return $this->endDate; - } - - /** - * Sets endDate. - * - * @param \DateTime $endDate - * @return TransactionGroup - */ - protected function setEndDate($endDate) { - $this->endDate = $endDate; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return TransactionGroup - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return TransactionGroup - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return TransactionGroup - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\TransactionGroupState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\TransactionGroupState $state - * @return TransactionGroup - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return TransactionGroup - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class TransactionGroup implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'TransactionGroup'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'begin_date' => '\DateTime', + 'customer_id' => 'string', + 'end_date' => '\DateTime', + 'id' => 'int', + 'linked_space_id' => 'int', + 'planned_purge_date' => '\DateTime', + 'state' => '\Wallee\Sdk\Model\TransactionGroupState', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'begin_date' => 'date-time', + 'customer_id' => null, + 'end_date' => 'date-time', + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'planned_purge_date' => 'date-time', + 'state' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'begin_date' => 'beginDate', + 'customer_id' => 'customerId', + 'end_date' => 'endDate', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'planned_purge_date' => 'plannedPurgeDate', + 'state' => 'state', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'begin_date' => 'setBeginDate', + 'customer_id' => 'setCustomerId', + 'end_date' => 'setEndDate', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'state' => 'setState', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'begin_date' => 'getBeginDate', + 'customer_id' => 'getCustomerId', + 'end_date' => 'getEndDate', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'state' => 'getState', + 'version' => 'getVersion' + ]; + + + + /** + * 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['begin_date'] = isset($data['begin_date']) ? $data['begin_date'] : null; + + $this->container['customer_id'] = isset($data['customer_id']) ? $data['customer_id'] : null; + + $this->container['end_date'] = isset($data['end_date']) ? $data['end_date'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 begin_date + * + * @return \DateTime + */ + public function getBeginDate() + { + return $this->container['begin_date']; + } + + /** + * Sets begin_date + * + * @param \DateTime $begin_date + * + * @return $this + */ + public function setBeginDate($begin_date) + { + $this->container['begin_date'] = $begin_date; + + return $this; + } + + + /** + * Gets customer_id + * + * @return string + */ + public function getCustomerId() + { + return $this->container['customer_id']; + } + + /** + * Sets customer_id + * + * @param string $customer_id + * + * @return $this + */ + public function setCustomerId($customer_id) + { + $this->container['customer_id'] = $customer_id; + + return $this; + } + + + /** + * Gets end_date + * + * @return \DateTime + */ + public function getEndDate() + { + return $this->container['end_date']; + } + + /** + * Sets end_date + * + * @param \DateTime $end_date + * + * @return $this + */ + public function setEndDate($end_date) + { + $this->container['end_date'] = $end_date; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\TransactionGroupState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\TransactionGroupState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/TransactionGroupState.php b/wallee-sdk/lib/Model/TransactionGroupState.php index a7675ac..26c35c9 100644 --- a/wallee-sdk/lib/Model/TransactionGroupState.php +++ b/wallee-sdk/lib/Model/TransactionGroupState.php @@ -1,10 +1,8 @@ 'float', - 'billingAddress' => '\Wallee\Sdk\Model\Address', - 'completion' => '\Wallee\Sdk\Model\TransactionCompletion', - 'createdOn' => '\DateTime', - 'derecognizedOn' => '\DateTime', - 'dueOn' => '\DateTime', - 'environment' => '\Wallee\Sdk\Model\Environment', - 'externalId' => 'string', - 'language' => 'string', - 'lineItems' => '\Wallee\Sdk\Model\LineItem[]', - 'merchantReference' => 'string', - 'outstandingAmount' => 'float', - 'paidOn' => '\DateTime', - 'plannedPurgeDate' => '\DateTime', - 'spaceViewId' => 'int', - 'state' => '\Wallee\Sdk\Model\TransactionInvoiceState', - 'taxAmount' => 'float', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * - * - * @var float - */ - private $amount; - - /** - * - * - * @var \Wallee\Sdk\Model\Address - */ - private $billingAddress; - - /** - * - * - * @var \Wallee\Sdk\Model\TransactionCompletion - */ - private $completion; - - /** - * The date on which the invoice is created on. - * - * @var \DateTime - */ - private $createdOn; - - /** - * The date on which the invoice is marked as derecognized. - * - * @var \DateTime - */ - private $derecognizedOn; - - /** - * The date on which the invoice should be paid on. - * - * @var \DateTime - */ - private $dueOn; - - /** - * - * - * @var \Wallee\Sdk\Model\Environment - */ - private $environment; - - /** - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @var string - */ - private $externalId; - - /** - * - * - * @var string - */ - private $language; - - /** - * - * - * @var \Wallee\Sdk\Model\LineItem[] - */ - private $lineItems; - - /** - * - * - * @var string - */ - private $merchantReference; - - /** - * The outstanding amount indicates how much the buyer owes the merchant. A negative amount indicates that the invoice is overpaid. - * - * @var float - */ - private $outstandingAmount; - - /** - * The date on which the invoice is marked as paid. Eventually this date lags behind of the actual paid date. - * - * @var \DateTime - */ - private $paidOn; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var int - */ - private $spaceViewId; - - /** - * - * - * @var \Wallee\Sdk\Model\TransactionInvoiceState - */ - private $state; - - /** - * - * - * @var float - */ - private $taxAmount; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['billingAddress'])) { - $this->setBillingAddress($data['billingAddress']); - } - if (isset($data['completion'])) { - $this->setCompletion($data['completion']); - } - if (isset($data['environment'])) { - $this->setEnvironment($data['environment']); - } - if (isset($data['lineItems'])) { - $this->setLineItems($data['lineItems']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - } - - - /** - * Returns amount. - * - * - * - * @return float - */ - public function getAmount() { - return $this->amount; - } - - /** - * Sets amount. - * - * @param float $amount - * @return TransactionInvoice - */ - protected function setAmount($amount) { - $this->amount = $amount; - - return $this; - } - - /** - * Returns billingAddress. - * - * - * - * @return \Wallee\Sdk\Model\Address - */ - public function getBillingAddress() { - return $this->billingAddress; - } - - /** - * Sets billingAddress. - * - * @param \Wallee\Sdk\Model\Address $billingAddress - * @return TransactionInvoice - */ - public function setBillingAddress($billingAddress) { - $this->billingAddress = $billingAddress; - - return $this; - } - - /** - * Returns completion. - * - * - * - * @return \Wallee\Sdk\Model\TransactionCompletion - */ - public function getCompletion() { - return $this->completion; - } - - /** - * Sets completion. - * - * @param \Wallee\Sdk\Model\TransactionCompletion $completion - * @return TransactionInvoice - */ - public function setCompletion($completion) { - $this->completion = $completion; - - return $this; - } - - /** - * Returns createdOn. - * - * The date on which the invoice is created on. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return TransactionInvoice - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns derecognizedOn. - * - * The date on which the invoice is marked as derecognized. - * - * @return \DateTime - */ - public function getDerecognizedOn() { - return $this->derecognizedOn; - } - - /** - * Sets derecognizedOn. - * - * @param \DateTime $derecognizedOn - * @return TransactionInvoice - */ - protected function setDerecognizedOn($derecognizedOn) { - $this->derecognizedOn = $derecognizedOn; - - return $this; - } - - /** - * Returns dueOn. - * - * The date on which the invoice should be paid on. - * - * @return \DateTime - */ - public function getDueOn() { - return $this->dueOn; - } - - /** - * Sets dueOn. - * - * @param \DateTime $dueOn - * @return TransactionInvoice - */ - protected function setDueOn($dueOn) { - $this->dueOn = $dueOn; - - return $this; - } - - /** - * Returns environment. - * - * - * - * @return \Wallee\Sdk\Model\Environment - */ - public function getEnvironment() { - return $this->environment; - } - - /** - * Sets environment. - * - * @param \Wallee\Sdk\Model\Environment $environment - * @return TransactionInvoice - */ - public function setEnvironment($environment) { - $this->environment = $environment; - - return $this; - } - - /** - * Returns externalId. - * - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @return string - */ - public function getExternalId() { - return $this->externalId; - } - - /** - * Sets externalId. - * - * @param string $externalId - * @return TransactionInvoice - */ - protected function setExternalId($externalId) { - $this->externalId = $externalId; - - return $this; - } - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return TransactionInvoice - */ - protected function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns lineItems. - * - * - * - * @return \Wallee\Sdk\Model\LineItem[] - */ - public function getLineItems() { - return $this->lineItems; - } - - /** - * Sets lineItems. - * - * @param \Wallee\Sdk\Model\LineItem[] $lineItems - * @return TransactionInvoice - */ - public function setLineItems($lineItems) { - $this->lineItems = $lineItems; - - return $this; - } - - /** - * Returns merchantReference. - * - * - * - * @return string - */ - public function getMerchantReference() { - return $this->merchantReference; - } - - /** - * Sets merchantReference. - * - * @param string $merchantReference - * @return TransactionInvoice - */ - protected function setMerchantReference($merchantReference) { - $this->merchantReference = $merchantReference; - - return $this; - } - - /** - * Returns outstandingAmount. - * - * The outstanding amount indicates how much the buyer owes the merchant. A negative amount indicates that the invoice is overpaid. - * - * @return float - */ - public function getOutstandingAmount() { - return $this->outstandingAmount; - } - - /** - * Sets outstandingAmount. - * - * @param float $outstandingAmount - * @return TransactionInvoice - */ - protected function setOutstandingAmount($outstandingAmount) { - $this->outstandingAmount = $outstandingAmount; - - return $this; - } - - /** - * Returns paidOn. - * - * The date on which the invoice is marked as paid. Eventually this date lags behind of the actual paid date. - * - * @return \DateTime - */ - public function getPaidOn() { - return $this->paidOn; - } - - /** - * Sets paidOn. - * - * @param \DateTime $paidOn - * @return TransactionInvoice - */ - protected function setPaidOn($paidOn) { - $this->paidOn = $paidOn; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return TransactionInvoice - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns spaceViewId. - * - * - * - * @return int - */ - public function getSpaceViewId() { - return $this->spaceViewId; - } - - /** - * Sets spaceViewId. - * - * @param int $spaceViewId - * @return TransactionInvoice - */ - protected function setSpaceViewId($spaceViewId) { - $this->spaceViewId = $spaceViewId; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\TransactionInvoiceState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\TransactionInvoiceState $state - * @return TransactionInvoice - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns taxAmount. - * - * - * - * @return float - */ - public function getTaxAmount() { - return $this->taxAmount; - } - - /** - * Sets taxAmount. - * - * @param float $taxAmount - * @return TransactionInvoice - */ - protected function setTaxAmount($taxAmount) { - $this->taxAmount = $taxAmount; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return TransactionInvoice - */ - protected function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class TransactionInvoice extends TransactionAwareEntity +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'TransactionInvoice'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'amount' => 'float', + 'billing_address' => '\Wallee\Sdk\Model\Address', + 'completion' => '\Wallee\Sdk\Model\TransactionCompletion', + 'created_on' => '\DateTime', + 'derecognized_on' => '\DateTime', + 'due_on' => '\DateTime', + 'environment' => '\Wallee\Sdk\Model\Environment', + 'external_id' => 'string', + 'language' => 'string', + 'line_items' => '\Wallee\Sdk\Model\LineItem[]', + 'merchant_reference' => 'string', + 'outstanding_amount' => 'float', + 'paid_on' => '\DateTime', + 'planned_purge_date' => '\DateTime', + 'space_view_id' => 'int', + 'state' => '\Wallee\Sdk\Model\TransactionInvoiceState', + 'tax_amount' => 'float', + 'time_zone' => 'string', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'amount' => null, + 'billing_address' => null, + 'completion' => null, + 'created_on' => 'date-time', + 'derecognized_on' => 'date-time', + 'due_on' => 'date-time', + 'environment' => null, + 'external_id' => null, + 'language' => null, + 'line_items' => null, + 'merchant_reference' => null, + 'outstanding_amount' => null, + 'paid_on' => 'date-time', + 'planned_purge_date' => 'date-time', + 'space_view_id' => 'int64', + 'state' => null, + 'tax_amount' => null, + 'time_zone' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'billing_address' => 'billingAddress', + 'completion' => 'completion', + 'created_on' => 'createdOn', + 'derecognized_on' => 'derecognizedOn', + 'due_on' => 'dueOn', + 'environment' => 'environment', + 'external_id' => 'externalId', + 'language' => 'language', + 'line_items' => 'lineItems', + 'merchant_reference' => 'merchantReference', + 'outstanding_amount' => 'outstandingAmount', + 'paid_on' => 'paidOn', + 'planned_purge_date' => 'plannedPurgeDate', + 'space_view_id' => 'spaceViewId', + 'state' => 'state', + 'tax_amount' => 'taxAmount', + 'time_zone' => 'timeZone', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'billing_address' => 'setBillingAddress', + 'completion' => 'setCompletion', + 'created_on' => 'setCreatedOn', + 'derecognized_on' => 'setDerecognizedOn', + 'due_on' => 'setDueOn', + 'environment' => 'setEnvironment', + 'external_id' => 'setExternalId', + 'language' => 'setLanguage', + 'line_items' => 'setLineItems', + 'merchant_reference' => 'setMerchantReference', + 'outstanding_amount' => 'setOutstandingAmount', + 'paid_on' => 'setPaidOn', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'space_view_id' => 'setSpaceViewId', + 'state' => 'setState', + 'tax_amount' => 'setTaxAmount', + 'time_zone' => 'setTimeZone', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'billing_address' => 'getBillingAddress', + 'completion' => 'getCompletion', + 'created_on' => 'getCreatedOn', + 'derecognized_on' => 'getDerecognizedOn', + 'due_on' => 'getDueOn', + 'environment' => 'getEnvironment', + 'external_id' => 'getExternalId', + 'language' => 'getLanguage', + 'line_items' => 'getLineItems', + 'merchant_reference' => 'getMerchantReference', + 'outstanding_amount' => 'getOutstandingAmount', + 'paid_on' => 'getPaidOn', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'space_view_id' => 'getSpaceViewId', + 'state' => 'getState', + 'tax_amount' => 'getTaxAmount', + 'time_zone' => 'getTimeZone', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + + $this->container['billing_address'] = isset($data['billing_address']) ? $data['billing_address'] : null; + + $this->container['completion'] = isset($data['completion']) ? $data['completion'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['derecognized_on'] = isset($data['derecognized_on']) ? $data['derecognized_on'] : null; + + $this->container['due_on'] = isset($data['due_on']) ? $data['due_on'] : null; + + $this->container['environment'] = isset($data['environment']) ? $data['environment'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['line_items'] = isset($data['line_items']) ? $data['line_items'] : null; + + $this->container['merchant_reference'] = isset($data['merchant_reference']) ? $data['merchant_reference'] : null; + + $this->container['outstanding_amount'] = isset($data['outstanding_amount']) ? $data['outstanding_amount'] : null; + + $this->container['paid_on'] = isset($data['paid_on']) ? $data['paid_on'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['space_view_id'] = isset($data['space_view_id']) ? $data['space_view_id'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['tax_amount'] = isset($data['tax_amount']) ? $data['tax_amount'] : null; + + $this->container['time_zone'] = isset($data['time_zone']) ? $data['time_zone'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 amount + * + * @return float + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param float $amount + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + + /** + * Gets billing_address + * + * @return \Wallee\Sdk\Model\Address + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Wallee\Sdk\Model\Address $billing_address + * + * @return $this + */ + public function setBillingAddress($billing_address) + { + $this->container['billing_address'] = $billing_address; + + return $this; + } + + + /** + * Gets completion + * + * @return \Wallee\Sdk\Model\TransactionCompletion + */ + public function getCompletion() + { + return $this->container['completion']; + } + + /** + * Sets completion + * + * @param \Wallee\Sdk\Model\TransactionCompletion $completion + * + * @return $this + */ + public function setCompletion($completion) + { + $this->container['completion'] = $completion; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The date on which the invoice is created on. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets derecognized_on + * + * @return \DateTime + */ + public function getDerecognizedOn() + { + return $this->container['derecognized_on']; + } + + /** + * Sets derecognized_on + * + * @param \DateTime $derecognized_on The date on which the invoice is marked as derecognized. + * + * @return $this + */ + public function setDerecognizedOn($derecognized_on) + { + $this->container['derecognized_on'] = $derecognized_on; + + return $this; + } + + + /** + * Gets due_on + * + * @return \DateTime + */ + public function getDueOn() + { + return $this->container['due_on']; + } + + /** + * Sets due_on + * + * @param \DateTime $due_on The date on which the invoice should be paid on. + * + * @return $this + */ + public function setDueOn($due_on) + { + $this->container['due_on'] = $due_on; + + return $this; + } + + + /** + * Gets environment + * + * @return \Wallee\Sdk\Model\Environment + */ + public function getEnvironment() + { + return $this->container['environment']; + } + + /** + * Sets environment + * + * @param \Wallee\Sdk\Model\Environment $environment + * + * @return $this + */ + public function setEnvironment($environment) + { + $this->container['environment'] = $environment; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets line_items + * + * @return \Wallee\Sdk\Model\LineItem[] + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Wallee\Sdk\Model\LineItem[] $line_items + * + * @return $this + */ + public function setLineItems($line_items) + { + $this->container['line_items'] = $line_items; + + return $this; + } + + + /** + * Gets merchant_reference + * + * @return string + */ + public function getMerchantReference() + { + return $this->container['merchant_reference']; + } + + /** + * Sets merchant_reference + * + * @param string $merchant_reference + * + * @return $this + */ + public function setMerchantReference($merchant_reference) + { + $this->container['merchant_reference'] = $merchant_reference; + + return $this; + } + + + /** + * Gets outstanding_amount + * + * @return float + */ + public function getOutstandingAmount() + { + return $this->container['outstanding_amount']; + } + + /** + * Sets outstanding_amount + * + * @param float $outstanding_amount The outstanding amount indicates how much the buyer owes the merchant. A negative amount indicates that the invoice is overpaid. + * + * @return $this + */ + public function setOutstandingAmount($outstanding_amount) + { + $this->container['outstanding_amount'] = $outstanding_amount; + + return $this; + } + + + /** + * Gets paid_on + * + * @return \DateTime + */ + public function getPaidOn() + { + return $this->container['paid_on']; + } + + /** + * Sets paid_on + * + * @param \DateTime $paid_on The date on which the invoice is marked as paid. Eventually this date lags behind of the actual paid date. + * + * @return $this + */ + public function setPaidOn($paid_on) + { + $this->container['paid_on'] = $paid_on; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets space_view_id + * + * @return int + */ + public function getSpaceViewId() + { + return $this->container['space_view_id']; + } + + /** + * Sets space_view_id + * + * @param int $space_view_id + * + * @return $this + */ + public function setSpaceViewId($space_view_id) + { + $this->container['space_view_id'] = $space_view_id; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\TransactionInvoiceState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\TransactionInvoiceState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets tax_amount + * + * @return float + */ + public function getTaxAmount() + { + return $this->container['tax_amount']; + } + + /** + * Sets tax_amount + * + * @param float $tax_amount + * + * @return $this + */ + public function setTaxAmount($tax_amount) + { + $this->container['tax_amount'] = $tax_amount; + + return $this; + } + + + /** + * Gets time_zone + * + * @return string + */ + public function getTimeZone() + { + return $this->container['time_zone']; + } + + /** + * Sets time_zone + * + * @param string $time_zone + * + * @return $this + */ + public function setTimeZone($time_zone) + { + $this->container['time_zone'] = $time_zone; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/TransactionInvoiceComment.php b/wallee-sdk/lib/Model/TransactionInvoiceComment.php new file mode 100644 index 0000000..82d0d61 --- /dev/null +++ b/wallee-sdk/lib/Model/TransactionInvoiceComment.php @@ -0,0 +1,586 @@ + 'string', + 'created_by' => 'int', + 'created_on' => '\DateTime', + 'edited_by' => 'int', + 'edited_on' => '\DateTime', + 'id' => 'int', + 'linked_space_id' => 'int', + 'pinned' => 'bool', + 'transaction_invoice' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'content' => null, + 'created_by' => 'int64', + 'created_on' => 'date-time', + 'edited_by' => 'int64', + 'edited_on' => 'date-time', + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'pinned' => null, + 'transaction_invoice' => 'int64', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'content' => 'content', + 'created_by' => 'createdBy', + 'created_on' => 'createdOn', + 'edited_by' => 'editedBy', + 'edited_on' => 'editedOn', + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'pinned' => 'pinned', + 'transaction_invoice' => 'transactionInvoice', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent', + 'created_by' => 'setCreatedBy', + 'created_on' => 'setCreatedOn', + 'edited_by' => 'setEditedBy', + 'edited_on' => 'setEditedOn', + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'pinned' => 'setPinned', + 'transaction_invoice' => 'setTransactionInvoice', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent', + 'created_by' => 'getCreatedBy', + 'created_on' => 'getCreatedOn', + 'edited_by' => 'getEditedBy', + 'edited_on' => 'getEditedOn', + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'pinned' => 'getPinned', + 'transaction_invoice' => 'getTransactionInvoice', + 'version' => 'getVersion' + ]; + + + + /** + * 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['created_by'] = isset($data['created_by']) ? $data['created_by'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['edited_by'] = isset($data['edited_by']) ? $data['edited_by'] : null; + + $this->container['edited_on'] = isset($data['edited_on']) ? $data['edited_on'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['pinned'] = isset($data['pinned']) ? $data['pinned'] : null; + + $this->container['transaction_invoice'] = isset($data['transaction_invoice']) ? $data['transaction_invoice'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content + * + * @return $this + */ + public function setContent($content) + { + $this->container['content'] = $content; + + return $this; + } + + + /** + * Gets created_by + * + * @return int + */ + public function getCreatedBy() + { + return $this->container['created_by']; + } + + /** + * Sets created_by + * + * @param int $created_by + * + * @return $this + */ + public function setCreatedBy($created_by) + { + $this->container['created_by'] = $created_by; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets edited_by + * + * @return int + */ + public function getEditedBy() + { + return $this->container['edited_by']; + } + + /** + * Sets edited_by + * + * @param int $edited_by + * + * @return $this + */ + public function setEditedBy($edited_by) + { + $this->container['edited_by'] = $edited_by; + + return $this; + } + + + /** + * Gets edited_on + * + * @return \DateTime + */ + public function getEditedOn() + { + return $this->container['edited_on']; + } + + /** + * Sets edited_on + * + * @param \DateTime $edited_on The date on which the comment was last edited. + * + * @return $this + */ + public function setEditedOn($edited_on) + { + $this->container['edited_on'] = $edited_on; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets pinned + * + * @return bool + */ + public function getPinned() + { + return $this->container['pinned']; + } + + /** + * Sets pinned + * + * @param bool $pinned + * + * @return $this + */ + public function setPinned($pinned) + { + $this->container['pinned'] = $pinned; + + return $this; + } + + + /** + * Gets transaction_invoice + * + * @return int + */ + public function getTransactionInvoice() + { + return $this->container['transaction_invoice']; + } + + /** + * Sets transaction_invoice + * + * @param int $transaction_invoice + * + * @return $this + */ + public function setTransactionInvoice($transaction_invoice) + { + $this->container['transaction_invoice'] = $transaction_invoice; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/TransactionInvoiceCommentActive.php b/wallee-sdk/lib/Model/TransactionInvoiceCommentActive.php new file mode 100644 index 0000000..3f1f704 --- /dev/null +++ b/wallee-sdk/lib/Model/TransactionInvoiceCommentActive.php @@ -0,0 +1,330 @@ + 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/TransactionInvoiceCommentCreate.php b/wallee-sdk/lib/Model/TransactionInvoiceCommentCreate.php new file mode 100644 index 0000000..c4b4358 --- /dev/null +++ b/wallee-sdk/lib/Model/TransactionInvoiceCommentCreate.php @@ -0,0 +1,295 @@ + 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'transaction_invoice' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'transaction_invoice' => 'transactionInvoice' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'transaction_invoice' => 'setTransactionInvoice' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'transaction_invoice' => 'getTransactionInvoice' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['transaction_invoice'] = isset($data['transaction_invoice']) ? $data['transaction_invoice'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['transaction_invoice'] === null) { + $invalidProperties[] = "'transaction_invoice' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 transaction_invoice + * + * @return int + */ + public function getTransactionInvoice() + { + return $this->container['transaction_invoice']; + } + + /** + * Sets transaction_invoice + * + * @param int $transaction_invoice + * + * @return $this + */ + public function setTransactionInvoice($transaction_invoice) + { + $this->container['transaction_invoice'] = $transaction_invoice; + + 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/wallee-sdk/lib/Model/TransactionInvoiceReplacement.php b/wallee-sdk/lib/Model/TransactionInvoiceReplacement.php index bad559d..eceab2e 100644 --- a/wallee-sdk/lib/Model/TransactionInvoiceReplacement.php +++ b/wallee-sdk/lib/Model/TransactionInvoiceReplacement.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\AddressCreate', - 'dueOn' => '\DateTime', - 'externalId' => 'string', - 'lineItems' => '\Wallee\Sdk\Model\LineItemCreate[]', - 'merchantReference' => 'string', - 'sentToCustomer' => 'bool' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\AddressCreate - */ - private $billingAddress; - - /** - * The date on which the invoice should be paid on. - * - * @var \DateTime - */ - private $dueOn; - - /** - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @var string - */ - private $externalId; - - /** - * - * - * @var \Wallee\Sdk\Model\LineItemCreate[] - */ - private $lineItems; - - /** - * - * - * @var string - */ - private $merchantReference; - - /** - * When the connector is configured to send the invoice to the customer and this property is true the customer will receive an email with the updated invoice. When this property is false no invoice is sent. - * - * @var bool - */ - private $sentToCustomer; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['billingAddress'])) { - $this->setBillingAddress($data['billingAddress']); - } - if (isset($data['dueOn'])) { - $this->setDueOn($data['dueOn']); - } - if (isset($data['externalId'])) { - $this->setExternalId($data['externalId']); - } - if (isset($data['lineItems'])) { - $this->setLineItems($data['lineItems']); - } - if (isset($data['merchantReference'])) { - $this->setMerchantReference($data['merchantReference']); - } - if (isset($data['sentToCustomer'])) { - $this->setSentToCustomer($data['sentToCustomer']); - } - } - - - /** - * Returns billingAddress. - * - * - * - * @return \Wallee\Sdk\Model\AddressCreate - */ - public function getBillingAddress() { - return $this->billingAddress; - } - - /** - * Sets billingAddress. - * - * @param \Wallee\Sdk\Model\AddressCreate $billingAddress - * @return TransactionInvoiceReplacement - */ - public function setBillingAddress($billingAddress) { - $this->billingAddress = $billingAddress; - - return $this; - } - - /** - * Returns dueOn. - * - * The date on which the invoice should be paid on. - * - * @return \DateTime - */ - public function getDueOn() { - return $this->dueOn; - } - - /** - * Sets dueOn. - * - * @param \DateTime $dueOn - * @return TransactionInvoiceReplacement - */ - public function setDueOn($dueOn) { - $this->dueOn = $dueOn; - - return $this; - } - - /** - * Returns externalId. - * - * The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. - * - * @return string - */ - public function getExternalId() { - return $this->externalId; - } - - /** - * Sets externalId. - * - * @param string $externalId - * @return TransactionInvoiceReplacement - */ - public function setExternalId($externalId) { - $this->externalId = $externalId; - - return $this; - } - - /** - * Returns lineItems. - * - * - * - * @return \Wallee\Sdk\Model\LineItemCreate[] - */ - public function getLineItems() { - return $this->lineItems; - } - - /** - * Sets lineItems. - * - * @param \Wallee\Sdk\Model\LineItemCreate[] $lineItems - * @return TransactionInvoiceReplacement - */ - public function setLineItems($lineItems) { - $this->lineItems = $lineItems; - - return $this; - } - - /** - * Returns merchantReference. - * - * - * - * @return string - */ - public function getMerchantReference() { - return $this->merchantReference; - } - - /** - * Sets merchantReference. - * - * @param string $merchantReference - * @return TransactionInvoiceReplacement - */ - public function setMerchantReference($merchantReference) { - $this->merchantReference = $merchantReference; - - return $this; - } - - /** - * Returns sentToCustomer. - * - * When the connector is configured to send the invoice to the customer and this property is true the customer will receive an email with the updated invoice. When this property is false no invoice is sent. - * - * @return bool - */ - public function getSentToCustomer() { - return $this->sentToCustomer; - } - - /** - * Sets sentToCustomer. - * - * @param bool $sentToCustomer - * @return TransactionInvoiceReplacement - */ - public function setSentToCustomer($sentToCustomer) { - $this->sentToCustomer = $sentToCustomer; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getExternalId() === null) { - throw new ValidationException("'externalId' can't be null", 'externalId', $this); - } - if ($this->getLineItems() === null) { - throw new ValidationException("'lineItems' can't be null", 'lineItems', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class TransactionInvoiceReplacement implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'TransactionInvoiceReplacement'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'billing_address' => '\Wallee\Sdk\Model\AddressCreate', + 'due_on' => '\DateTime', + 'external_id' => 'string', + 'line_items' => '\Wallee\Sdk\Model\LineItemCreate[]', + 'merchant_reference' => 'string', + 'sent_to_customer' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'billing_address' => null, + 'due_on' => 'date-time', + 'external_id' => null, + 'line_items' => null, + 'merchant_reference' => null, + 'sent_to_customer' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'billing_address' => 'billingAddress', + 'due_on' => 'dueOn', + 'external_id' => 'externalId', + 'line_items' => 'lineItems', + 'merchant_reference' => 'merchantReference', + 'sent_to_customer' => 'sentToCustomer' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'billing_address' => 'setBillingAddress', + 'due_on' => 'setDueOn', + 'external_id' => 'setExternalId', + 'line_items' => 'setLineItems', + 'merchant_reference' => 'setMerchantReference', + 'sent_to_customer' => 'setSentToCustomer' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'billing_address' => 'getBillingAddress', + 'due_on' => 'getDueOn', + 'external_id' => 'getExternalId', + 'line_items' => 'getLineItems', + 'merchant_reference' => 'getMerchantReference', + 'sent_to_customer' => 'getSentToCustomer' + ]; + + + + /** + * 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['billing_address'] = isset($data['billing_address']) ? $data['billing_address'] : null; + + $this->container['due_on'] = isset($data['due_on']) ? $data['due_on'] : null; + + $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null; + + $this->container['line_items'] = isset($data['line_items']) ? $data['line_items'] : null; + + $this->container['merchant_reference'] = isset($data['merchant_reference']) ? $data['merchant_reference'] : null; + + $this->container['sent_to_customer'] = isset($data['sent_to_customer']) ? $data['sent_to_customer'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['external_id'] === null) { + $invalidProperties[] = "'external_id' can't be null"; + } + if ($this->container['line_items'] === null) { + $invalidProperties[] = "'line_items' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 billing_address + * + * @return \Wallee\Sdk\Model\AddressCreate + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Wallee\Sdk\Model\AddressCreate $billing_address + * + * @return $this + */ + public function setBillingAddress($billing_address) + { + $this->container['billing_address'] = $billing_address; + + return $this; + } + + + /** + * Gets due_on + * + * @return \DateTime + */ + public function getDueOn() + { + return $this->container['due_on']; + } + + /** + * Sets due_on + * + * @param \DateTime $due_on The date on which the invoice should be paid on. + * + * @return $this + */ + public function setDueOn($due_on) + { + $this->container['due_on'] = $due_on; + + return $this; + } + + + /** + * Gets external_id + * + * @return string + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string $external_id The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + * + * @return $this + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + + /** + * Gets line_items + * + * @return \Wallee\Sdk\Model\LineItemCreate[] + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Wallee\Sdk\Model\LineItemCreate[] $line_items + * + * @return $this + */ + public function setLineItems($line_items) + { + $this->container['line_items'] = $line_items; + + return $this; + } + + + /** + * Gets merchant_reference + * + * @return string + */ + public function getMerchantReference() + { + return $this->container['merchant_reference']; + } + + /** + * Sets merchant_reference + * + * @param string $merchant_reference + * + * @return $this + */ + public function setMerchantReference($merchant_reference) + { + $this->container['merchant_reference'] = $merchant_reference; + + return $this; + } + + + /** + * Gets sent_to_customer + * + * @return bool + */ + public function getSentToCustomer() + { + return $this->container['sent_to_customer']; + } + + /** + * Sets sent_to_customer + * + * @param bool $sent_to_customer When the connector is configured to send the invoice to the customer and this property is true the customer will receive an email with the updated invoice. When this property is false no invoice is sent. + * + * @return $this + */ + public function setSentToCustomer($sent_to_customer) + { + $this->container['sent_to_customer'] = $sent_to_customer; + + 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/wallee-sdk/lib/Model/TransactionInvoiceState.php b/wallee-sdk/lib/Model/TransactionInvoiceState.php index 82050ac..f240a14 100644 --- a/wallee-sdk/lib/Model/TransactionInvoiceState.php +++ b/wallee-sdk/lib/Model/TransactionInvoiceState.php @@ -1,10 +1,8 @@ '\Wallee\Sdk\Model\LineItemCreate[]', - 'transactionId' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var \Wallee\Sdk\Model\LineItemCreate[] - */ - private $newLineItems; - - /** - * - * - * @var int - */ - private $transactionId; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['newLineItems'])) { - $this->setNewLineItems($data['newLineItems']); - } - if (isset($data['transactionId'])) { - $this->setTransactionId($data['transactionId']); - } - } - - - /** - * Returns newLineItems. - * - * - * - * @return \Wallee\Sdk\Model\LineItemCreate[] - */ - public function getNewLineItems() { - return $this->newLineItems; - } - - /** - * Sets newLineItems. - * - * @param \Wallee\Sdk\Model\LineItemCreate[] $newLineItems - * @return TransactionLineItemUpdateRequest - */ - public function setNewLineItems($newLineItems) { - $this->newLineItems = $newLineItems; - - return $this; - } - - /** - * Returns transactionId. - * - * - * - * @return int - */ - public function getTransactionId() { - return $this->transactionId; - } - - /** - * Sets transactionId. - * - * @param int $transactionId - * @return TransactionLineItemUpdateRequest - */ - public function setTransactionId($transactionId) { - $this->transactionId = $transactionId; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getTransactionId() === null) { - throw new ValidationException("'transactionId' can't be null", 'transactionId', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class TransactionLineItemUpdateRequest implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'TransactionLineItemUpdateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'new_line_items' => '\Wallee\Sdk\Model\LineItemCreate[]', + 'transaction_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'new_line_items' => null, + 'transaction_id' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'new_line_items' => 'newLineItems', + 'transaction_id' => 'transactionId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'new_line_items' => 'setNewLineItems', + 'transaction_id' => 'setTransactionId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'new_line_items' => 'getNewLineItems', + 'transaction_id' => 'getTransactionId' + ]; + + + + /** + * 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['new_line_items'] = isset($data['new_line_items']) ? $data['new_line_items'] : null; + + $this->container['transaction_id'] = isset($data['transaction_id']) ? $data['transaction_id'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['transaction_id'] === null) { + $invalidProperties[] = "'transaction_id' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 new_line_items + * + * @return \Wallee\Sdk\Model\LineItemCreate[] + */ + public function getNewLineItems() + { + return $this->container['new_line_items']; + } + + /** + * Sets new_line_items + * + * @param \Wallee\Sdk\Model\LineItemCreate[] $new_line_items + * + * @return $this + */ + public function setNewLineItems($new_line_items) + { + $this->container['new_line_items'] = $new_line_items; + + return $this; + } + + + /** + * Gets transaction_id + * + * @return int + */ + public function getTransactionId() + { + return $this->container['transaction_id']; + } + + /** + * Sets transaction_id + * + * @param int $transaction_id + * + * @return $this + */ + public function setTransactionId($transaction_id) + { + $this->container['transaction_id'] = $transaction_id; + + 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/wallee-sdk/lib/Model/TransactionLineItemVersion.php b/wallee-sdk/lib/Model/TransactionLineItemVersion.php index d2d3d13..436cfd8 100644 --- a/wallee-sdk/lib/Model/TransactionLineItemVersion.php +++ b/wallee-sdk/lib/Model/TransactionLineItemVersion.php @@ -1,10 +1,8 @@ 'float', - 'createdBy' => 'int', - 'createdOn' => '\DateTime', - 'language' => 'string', - 'lineItems' => '\Wallee\Sdk\Model\LineItem[]', - 'plannedPurgeDate' => '\DateTime', - 'spaceViewId' => 'int', - 'taxAmount' => 'float', - 'transaction' => '\Wallee\Sdk\Model\Transaction', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * - * - * @var float - */ - private $amount; - - /** - * - * - * @var int - */ - private $createdBy; - - /** - * The created on date indicates the date on which the entity was stored into the database. - * - * @var \DateTime - */ - private $createdOn; - - /** - * - * - * @var string - */ - private $language; - - /** - * - * - * @var \Wallee\Sdk\Model\LineItem[] - */ - private $lineItems; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var int - */ - private $spaceViewId; - - /** - * - * - * @var float - */ - private $taxAmount; - - /** - * - * - * @var \Wallee\Sdk\Model\Transaction - */ - private $transaction; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['lineItems'])) { - $this->setLineItems($data['lineItems']); - } - if (isset($data['transaction'])) { - $this->setTransaction($data['transaction']); - } - } - - - /** - * Returns amount. - * - * - * - * @return float - */ - public function getAmount() { - return $this->amount; - } - - /** - * Sets amount. - * - * @param float $amount - * @return TransactionLineItemVersion - */ - protected function setAmount($amount) { - $this->amount = $amount; - - return $this; - } - - /** - * Returns createdBy. - * - * - * - * @return int - */ - public function getCreatedBy() { - return $this->createdBy; - } - - /** - * Sets createdBy. - * - * @param int $createdBy - * @return TransactionLineItemVersion - */ - protected function setCreatedBy($createdBy) { - $this->createdBy = $createdBy; - - return $this; - } - - /** - * Returns createdOn. - * - * The created on date indicates the date on which the entity was stored into the database. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return TransactionLineItemVersion - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return TransactionLineItemVersion - */ - protected function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns lineItems. - * - * - * - * @return \Wallee\Sdk\Model\LineItem[] - */ - public function getLineItems() { - return $this->lineItems; - } - - /** - * Sets lineItems. - * - * @param \Wallee\Sdk\Model\LineItem[] $lineItems - * @return TransactionLineItemVersion - */ - public function setLineItems($lineItems) { - $this->lineItems = $lineItems; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return TransactionLineItemVersion - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns spaceViewId. - * - * - * - * @return int - */ - public function getSpaceViewId() { - return $this->spaceViewId; - } - - /** - * Sets spaceViewId. - * - * @param int $spaceViewId - * @return TransactionLineItemVersion - */ - protected function setSpaceViewId($spaceViewId) { - $this->spaceViewId = $spaceViewId; - - return $this; - } - - /** - * Returns taxAmount. - * - * - * - * @return float - */ - public function getTaxAmount() { - return $this->taxAmount; - } - - /** - * Sets taxAmount. - * - * @param float $taxAmount - * @return TransactionLineItemVersion - */ - protected function setTaxAmount($taxAmount) { - $this->taxAmount = $taxAmount; - - return $this; - } - - /** - * Returns transaction. - * - * - * - * @return \Wallee\Sdk\Model\Transaction - */ - public function getTransaction() { - return $this->transaction; - } - - /** - * Sets transaction. - * - * @param \Wallee\Sdk\Model\Transaction $transaction - * @return TransactionLineItemVersion - */ - public function setTransaction($transaction) { - $this->transaction = $transaction; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return TransactionLineItemVersion - */ - protected function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class TransactionLineItemVersion extends TransactionAwareEntity +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'TransactionLineItemVersion'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'amount' => 'float', + 'created_by' => 'int', + 'created_on' => '\DateTime', + 'language' => 'string', + 'line_items' => '\Wallee\Sdk\Model\LineItem[]', + 'planned_purge_date' => '\DateTime', + 'space_view_id' => 'int', + 'tax_amount' => 'float', + 'transaction' => '\Wallee\Sdk\Model\Transaction', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'amount' => null, + 'created_by' => 'int64', + 'created_on' => 'date-time', + 'language' => null, + 'line_items' => null, + 'planned_purge_date' => 'date-time', + 'space_view_id' => 'int64', + 'tax_amount' => null, + 'transaction' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'created_by' => 'createdBy', + 'created_on' => 'createdOn', + 'language' => 'language', + 'line_items' => 'lineItems', + 'planned_purge_date' => 'plannedPurgeDate', + 'space_view_id' => 'spaceViewId', + 'tax_amount' => 'taxAmount', + 'transaction' => 'transaction', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'created_by' => 'setCreatedBy', + 'created_on' => 'setCreatedOn', + 'language' => 'setLanguage', + 'line_items' => 'setLineItems', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'space_view_id' => 'setSpaceViewId', + 'tax_amount' => 'setTaxAmount', + 'transaction' => 'setTransaction', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'created_by' => 'getCreatedBy', + 'created_on' => 'getCreatedOn', + 'language' => 'getLanguage', + 'line_items' => 'getLineItems', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'space_view_id' => 'getSpaceViewId', + 'tax_amount' => 'getTaxAmount', + 'transaction' => 'getTransaction', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + + $this->container['created_by'] = isset($data['created_by']) ? $data['created_by'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['line_items'] = isset($data['line_items']) ? $data['line_items'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['space_view_id'] = isset($data['space_view_id']) ? $data['space_view_id'] : null; + + $this->container['tax_amount'] = isset($data['tax_amount']) ? $data['tax_amount'] : null; + + $this->container['transaction'] = isset($data['transaction']) ? $data['transaction'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 amount + * + * @return float + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param float $amount + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + + /** + * Gets created_by + * + * @return int + */ + public function getCreatedBy() + { + return $this->container['created_by']; + } + + /** + * Sets created_by + * + * @param int $created_by + * + * @return $this + */ + public function setCreatedBy($created_by) + { + $this->container['created_by'] = $created_by; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets line_items + * + * @return \Wallee\Sdk\Model\LineItem[] + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Wallee\Sdk\Model\LineItem[] $line_items + * + * @return $this + */ + public function setLineItems($line_items) + { + $this->container['line_items'] = $line_items; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets space_view_id + * + * @return int + */ + public function getSpaceViewId() + { + return $this->container['space_view_id']; + } + + /** + * Sets space_view_id + * + * @param int $space_view_id + * + * @return $this + */ + public function setSpaceViewId($space_view_id) + { + $this->container['space_view_id'] = $space_view_id; + + return $this; + } + + + /** + * Gets tax_amount + * + * @return float + */ + public function getTaxAmount() + { + return $this->container['tax_amount']; + } + + /** + * Sets tax_amount + * + * @param float $tax_amount + * + * @return $this + */ + public function setTaxAmount($tax_amount) + { + $this->container['tax_amount'] = $tax_amount; + + return $this; + } + + + /** + * Gets transaction + * + * @return \Wallee\Sdk\Model\Transaction + */ + public function getTransaction() + { + return $this->container['transaction']; + } + + /** + * Sets transaction + * + * @param \Wallee\Sdk\Model\Transaction $transaction + * + * @return $this + */ + public function setTransaction($transaction) + { + $this->container['transaction'] = $transaction; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/TransactionPending.php b/wallee-sdk/lib/Model/TransactionPending.php index c06f73d..f690d41 100644 --- a/wallee-sdk/lib/Model/TransactionPending.php +++ b/wallee-sdk/lib/Model/TransactionPending.php @@ -1,10 +1,8 @@ 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return TransactionPending - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return TransactionPending - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - if ($this->getId() === null) { - throw new ValidationException("'id' can't be null", 'id', $this); - } - if ($this->getVersion() === null) { - throw new ValidationException("'version' can't be null", 'version', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class TransactionPending extends AbstractTransactionPending +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'Transaction.Pending'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/TransactionState.php b/wallee-sdk/lib/Model/TransactionState.php index 5419c30..d6ba6e9 100644 --- a/wallee-sdk/lib/Model/TransactionState.php +++ b/wallee-sdk/lib/Model/TransactionState.php @@ -1,10 +1,8 @@ 'int', - 'createdOn' => '\DateTime', - 'failedOn' => '\DateTime', - 'failureReason' => '\Wallee\Sdk\Model\FailureReason', - 'labels' => '\Wallee\Sdk\Model\Label[]', - 'language' => 'string', - 'mode' => '\Wallee\Sdk\Model\TransactionVoidMode', - 'nextUpdateOn' => '\DateTime', - 'plannedPurgeDate' => '\DateTime', - 'processorReference' => 'string', - 'spaceViewId' => 'int', - 'state' => '\Wallee\Sdk\Model\TransactionVoidState', - 'succeededOn' => '\DateTime', - 'timeoutOn' => '\DateTime', - 'transaction' => '\Wallee\Sdk\Model\Transaction', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * - * - * @var int - */ - private $createdBy; - - /** - * The created on date indicates the date on which the entity was stored into the database. - * - * @var \DateTime - */ - private $createdOn; - - /** - * - * - * @var \DateTime - */ - private $failedOn; - - /** - * - * - * @var \Wallee\Sdk\Model\FailureReason - */ - private $failureReason; - - /** - * - * - * @var \Wallee\Sdk\Model\Label[] - */ - private $labels; - - /** - * - * - * @var string - */ - private $language; - - /** - * - * - * @var \Wallee\Sdk\Model\TransactionVoidMode - */ - private $mode; - - /** - * - * - * @var \DateTime - */ - private $nextUpdateOn; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var string - */ - private $processorReference; - - /** - * - * - * @var int - */ - private $spaceViewId; - - /** - * - * - * @var \Wallee\Sdk\Model\TransactionVoidState - */ - private $state; - - /** - * - * - * @var \DateTime - */ - private $succeededOn; - - /** - * - * - * @var \DateTime - */ - private $timeoutOn; - - /** - * - * - * @var \Wallee\Sdk\Model\Transaction - */ - private $transaction; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['failureReason'])) { - $this->setFailureReason($data['failureReason']); - } - if (isset($data['labels'])) { - $this->setLabels($data['labels']); - } - if (isset($data['mode'])) { - $this->setMode($data['mode']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['transaction'])) { - $this->setTransaction($data['transaction']); - } - } - - - /** - * Returns createdBy. - * - * - * - * @return int - */ - public function getCreatedBy() { - return $this->createdBy; - } - - /** - * Sets createdBy. - * - * @param int $createdBy - * @return TransactionVoid - */ - protected function setCreatedBy($createdBy) { - $this->createdBy = $createdBy; - - return $this; - } - - /** - * Returns createdOn. - * - * The created on date indicates the date on which the entity was stored into the database. - * - * @return \DateTime - */ - public function getCreatedOn() { - return $this->createdOn; - } - - /** - * Sets createdOn. - * - * @param \DateTime $createdOn - * @return TransactionVoid - */ - protected function setCreatedOn($createdOn) { - $this->createdOn = $createdOn; - - return $this; - } - - /** - * Returns failedOn. - * - * - * - * @return \DateTime - */ - public function getFailedOn() { - return $this->failedOn; - } - - /** - * Sets failedOn. - * - * @param \DateTime $failedOn - * @return TransactionVoid - */ - protected function setFailedOn($failedOn) { - $this->failedOn = $failedOn; - - return $this; - } - - /** - * Returns failureReason. - * - * - * - * @return \Wallee\Sdk\Model\FailureReason - */ - public function getFailureReason() { - return $this->failureReason; - } - - /** - * Sets failureReason. - * - * @param \Wallee\Sdk\Model\FailureReason $failureReason - * @return TransactionVoid - */ - public function setFailureReason($failureReason) { - $this->failureReason = $failureReason; - - return $this; - } - - /** - * Returns labels. - * - * - * - * @return \Wallee\Sdk\Model\Label[] - */ - public function getLabels() { - return $this->labels; - } - - /** - * Sets labels. - * - * @param \Wallee\Sdk\Model\Label[] $labels - * @return TransactionVoid - */ - public function setLabels($labels) { - $this->labels = $labels; - - return $this; - } - - /** - * Returns language. - * - * - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - /** - * Sets language. - * - * @param string $language - * @return TransactionVoid - */ - protected function setLanguage($language) { - $this->language = $language; - - return $this; - } - - /** - * Returns mode. - * - * - * - * @return \Wallee\Sdk\Model\TransactionVoidMode - */ - public function getMode() { - return $this->mode; - } - - /** - * Sets mode. - * - * @param \Wallee\Sdk\Model\TransactionVoidMode $mode - * @return TransactionVoid - */ - public function setMode($mode) { - $this->mode = $mode; - - return $this; - } - - /** - * Returns nextUpdateOn. - * - * - * - * @return \DateTime - */ - public function getNextUpdateOn() { - return $this->nextUpdateOn; - } - - /** - * Sets nextUpdateOn. - * - * @param \DateTime $nextUpdateOn - * @return TransactionVoid - */ - protected function setNextUpdateOn($nextUpdateOn) { - $this->nextUpdateOn = $nextUpdateOn; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return TransactionVoid - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns processorReference. - * - * - * - * @return string - */ - public function getProcessorReference() { - return $this->processorReference; - } - - /** - * Sets processorReference. - * - * @param string $processorReference - * @return TransactionVoid - */ - protected function setProcessorReference($processorReference) { - $this->processorReference = $processorReference; - - return $this; - } - - /** - * Returns spaceViewId. - * - * - * - * @return int - */ - public function getSpaceViewId() { - return $this->spaceViewId; - } - - /** - * Sets spaceViewId. - * - * @param int $spaceViewId - * @return TransactionVoid - */ - protected function setSpaceViewId($spaceViewId) { - $this->spaceViewId = $spaceViewId; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\TransactionVoidState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\TransactionVoidState $state - * @return TransactionVoid - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns succeededOn. - * - * - * - * @return \DateTime - */ - public function getSucceededOn() { - return $this->succeededOn; - } - - /** - * Sets succeededOn. - * - * @param \DateTime $succeededOn - * @return TransactionVoid - */ - protected function setSucceededOn($succeededOn) { - $this->succeededOn = $succeededOn; - - return $this; - } - - /** - * Returns timeoutOn. - * - * - * - * @return \DateTime - */ - public function getTimeoutOn() { - return $this->timeoutOn; - } - - /** - * Sets timeoutOn. - * - * @param \DateTime $timeoutOn - * @return TransactionVoid - */ - protected function setTimeoutOn($timeoutOn) { - $this->timeoutOn = $timeoutOn; - - return $this; - } - - /** - * Returns transaction. - * - * - * - * @return \Wallee\Sdk\Model\Transaction - */ - public function getTransaction() { - return $this->transaction; - } - - /** - * Sets transaction. - * - * @param \Wallee\Sdk\Model\Transaction $transaction - * @return TransactionVoid - */ - public function setTransaction($transaction) { - $this->transaction = $transaction; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return TransactionVoid - */ - protected function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class TransactionVoid extends TransactionAwareEntity +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'TransactionVoid'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'created_by' => 'int', + 'created_on' => '\DateTime', + 'failed_on' => '\DateTime', + 'failure_reason' => '\Wallee\Sdk\Model\FailureReason', + 'labels' => '\Wallee\Sdk\Model\Label[]', + 'language' => 'string', + 'mode' => '\Wallee\Sdk\Model\TransactionVoidMode', + 'next_update_on' => '\DateTime', + 'planned_purge_date' => '\DateTime', + 'processor_reference' => 'string', + 'space_view_id' => 'int', + 'state' => '\Wallee\Sdk\Model\TransactionVoidState', + 'succeeded_on' => '\DateTime', + 'timeout_on' => '\DateTime', + 'transaction' => '\Wallee\Sdk\Model\Transaction', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'created_by' => 'int64', + 'created_on' => 'date-time', + 'failed_on' => 'date-time', + 'failure_reason' => null, + 'labels' => null, + 'language' => null, + 'mode' => null, + 'next_update_on' => 'date-time', + 'planned_purge_date' => 'date-time', + 'processor_reference' => null, + 'space_view_id' => 'int64', + 'state' => null, + 'succeeded_on' => 'date-time', + 'timeout_on' => 'date-time', + 'transaction' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'created_by' => 'createdBy', + 'created_on' => 'createdOn', + 'failed_on' => 'failedOn', + 'failure_reason' => 'failureReason', + 'labels' => 'labels', + 'language' => 'language', + 'mode' => 'mode', + 'next_update_on' => 'nextUpdateOn', + 'planned_purge_date' => 'plannedPurgeDate', + 'processor_reference' => 'processorReference', + 'space_view_id' => 'spaceViewId', + 'state' => 'state', + 'succeeded_on' => 'succeededOn', + 'timeout_on' => 'timeoutOn', + 'transaction' => 'transaction', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'created_by' => 'setCreatedBy', + 'created_on' => 'setCreatedOn', + 'failed_on' => 'setFailedOn', + 'failure_reason' => 'setFailureReason', + 'labels' => 'setLabels', + 'language' => 'setLanguage', + 'mode' => 'setMode', + 'next_update_on' => 'setNextUpdateOn', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'processor_reference' => 'setProcessorReference', + 'space_view_id' => 'setSpaceViewId', + 'state' => 'setState', + 'succeeded_on' => 'setSucceededOn', + 'timeout_on' => 'setTimeoutOn', + 'transaction' => 'setTransaction', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'created_by' => 'getCreatedBy', + 'created_on' => 'getCreatedOn', + 'failed_on' => 'getFailedOn', + 'failure_reason' => 'getFailureReason', + 'labels' => 'getLabels', + 'language' => 'getLanguage', + 'mode' => 'getMode', + 'next_update_on' => 'getNextUpdateOn', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'processor_reference' => 'getProcessorReference', + 'space_view_id' => 'getSpaceViewId', + 'state' => 'getState', + 'succeeded_on' => 'getSucceededOn', + 'timeout_on' => 'getTimeoutOn', + 'transaction' => 'getTransaction', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['created_by'] = isset($data['created_by']) ? $data['created_by'] : null; + + $this->container['created_on'] = isset($data['created_on']) ? $data['created_on'] : null; + + $this->container['failed_on'] = isset($data['failed_on']) ? $data['failed_on'] : null; + + $this->container['failure_reason'] = isset($data['failure_reason']) ? $data['failure_reason'] : null; + + $this->container['labels'] = isset($data['labels']) ? $data['labels'] : null; + + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + + $this->container['mode'] = isset($data['mode']) ? $data['mode'] : null; + + $this->container['next_update_on'] = isset($data['next_update_on']) ? $data['next_update_on'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['processor_reference'] = isset($data['processor_reference']) ? $data['processor_reference'] : null; + + $this->container['space_view_id'] = isset($data['space_view_id']) ? $data['space_view_id'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['succeeded_on'] = isset($data['succeeded_on']) ? $data['succeeded_on'] : null; + + $this->container['timeout_on'] = isset($data['timeout_on']) ? $data['timeout_on'] : null; + + $this->container['transaction'] = isset($data['transaction']) ? $data['transaction'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 created_by + * + * @return int + */ + public function getCreatedBy() + { + return $this->container['created_by']; + } + + /** + * Sets created_by + * + * @param int $created_by + * + * @return $this + */ + public function setCreatedBy($created_by) + { + $this->container['created_by'] = $created_by; + + return $this; + } + + + /** + * Gets created_on + * + * @return \DateTime + */ + public function getCreatedOn() + { + return $this->container['created_on']; + } + + /** + * Sets created_on + * + * @param \DateTime $created_on The created on date indicates the date on which the entity was stored into the database. + * + * @return $this + */ + public function setCreatedOn($created_on) + { + $this->container['created_on'] = $created_on; + + return $this; + } + + + /** + * Gets failed_on + * + * @return \DateTime + */ + public function getFailedOn() + { + return $this->container['failed_on']; + } + + /** + * Sets failed_on + * + * @param \DateTime $failed_on + * + * @return $this + */ + public function setFailedOn($failed_on) + { + $this->container['failed_on'] = $failed_on; + + return $this; + } + + + /** + * Gets failure_reason + * + * @return \Wallee\Sdk\Model\FailureReason + */ + public function getFailureReason() + { + return $this->container['failure_reason']; + } + + /** + * Sets failure_reason + * + * @param \Wallee\Sdk\Model\FailureReason $failure_reason + * + * @return $this + */ + public function setFailureReason($failure_reason) + { + $this->container['failure_reason'] = $failure_reason; + + return $this; + } + + + /** + * Gets labels + * + * @return \Wallee\Sdk\Model\Label[] + */ + public function getLabels() + { + return $this->container['labels']; + } + + /** + * Sets labels + * + * @param \Wallee\Sdk\Model\Label[] $labels + * + * @return $this + */ + public function setLabels($labels) + { + $this->container['labels'] = $labels; + + return $this; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + + /** + * Gets mode + * + * @return \Wallee\Sdk\Model\TransactionVoidMode + */ + public function getMode() + { + return $this->container['mode']; + } + + /** + * Sets mode + * + * @param \Wallee\Sdk\Model\TransactionVoidMode $mode + * + * @return $this + */ + public function setMode($mode) + { + $this->container['mode'] = $mode; + + return $this; + } + + + /** + * Gets next_update_on + * + * @return \DateTime + */ + public function getNextUpdateOn() + { + return $this->container['next_update_on']; + } + + /** + * Sets next_update_on + * + * @param \DateTime $next_update_on + * + * @return $this + */ + public function setNextUpdateOn($next_update_on) + { + $this->container['next_update_on'] = $next_update_on; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets processor_reference + * + * @return string + */ + public function getProcessorReference() + { + return $this->container['processor_reference']; + } + + /** + * Sets processor_reference + * + * @param string $processor_reference + * + * @return $this + */ + public function setProcessorReference($processor_reference) + { + $this->container['processor_reference'] = $processor_reference; + + return $this; + } + + + /** + * Gets space_view_id + * + * @return int + */ + public function getSpaceViewId() + { + return $this->container['space_view_id']; + } + + /** + * Sets space_view_id + * + * @param int $space_view_id + * + * @return $this + */ + public function setSpaceViewId($space_view_id) + { + $this->container['space_view_id'] = $space_view_id; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\TransactionVoidState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\TransactionVoidState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets succeeded_on + * + * @return \DateTime + */ + public function getSucceededOn() + { + return $this->container['succeeded_on']; + } + + /** + * Sets succeeded_on + * + * @param \DateTime $succeeded_on + * + * @return $this + */ + public function setSucceededOn($succeeded_on) + { + $this->container['succeeded_on'] = $succeeded_on; + + return $this; + } + + + /** + * Gets timeout_on + * + * @return \DateTime + */ + public function getTimeoutOn() + { + return $this->container['timeout_on']; + } + + /** + * Sets timeout_on + * + * @param \DateTime $timeout_on + * + * @return $this + */ + public function setTimeoutOn($timeout_on) + { + $this->container['timeout_on'] = $timeout_on; + + return $this; + } + + + /** + * Gets transaction + * + * @return \Wallee\Sdk\Model\Transaction + */ + public function getTransaction() + { + return $this->container['transaction']; + } + + /** + * Sets transaction + * + * @param \Wallee\Sdk\Model\Transaction $transaction + * + * @return $this + */ + public function setTransaction($transaction) + { + $this->container['transaction'] = $transaction; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/TransactionVoidMode.php b/wallee-sdk/lib/Model/TransactionVoidMode.php index 78eb1e0..f3f4c6a 100644 --- a/wallee-sdk/lib/Model/TransactionVoidMode.php +++ b/wallee-sdk/lib/Model/TransactionVoidMode.php @@ -1,10 +1,8 @@ 'map[string,string]', - 'feature' => 'int', - 'icon' => 'string', - 'id' => 'int', - 'name' => 'map[string,string]' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var map[string,string] - */ - private $description; - - /** - * - * - * @var int - */ - private $feature; - - /** - * - * - * @var string - */ - private $icon; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $name; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['description'])) { - $this->setDescription($data['description']); - } - if (isset($data['name'])) { - $this->setName($data['name']); - } - } - - - /** - * Returns description. - * - * - * - * @return map[string,string] - */ - public function getDescription() { - return $this->description; - } - - /** - * Sets description. - * - * @param map[string,string] $description - * @return TwoFactorAuthenticationType - */ - public function setDescription($description) { - if (is_array($description) && empty($description)) { - $this->description = new \stdClass; - } else { - $this->description = $description; - } - - return $this; - } - - /** - * Returns feature. - * - * - * - * @return int - */ - public function getFeature() { - return $this->feature; - } - - /** - * Sets feature. - * - * @param int $feature - * @return TwoFactorAuthenticationType - */ - protected function setFeature($feature) { - $this->feature = $feature; - - return $this; - } - - /** - * Returns icon. - * - * - * - * @return string - */ - public function getIcon() { - return $this->icon; - } - - /** - * Sets icon. - * - * @param string $icon - * @return TwoFactorAuthenticationType - */ - protected function setIcon($icon) { - $this->icon = $icon; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return TwoFactorAuthenticationType - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return TwoFactorAuthenticationType - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class TwoFactorAuthenticationType implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'TwoFactorAuthenticationType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'description' => 'map[string,string]', + 'feature' => 'int', + 'icon' => 'string', + 'id' => 'int', + 'name' => 'map[string,string]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'description' => null, + 'feature' => 'int64', + 'icon' => null, + 'id' => 'int64', + 'name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'feature' => 'feature', + 'icon' => 'icon', + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'feature' => 'setFeature', + 'icon' => 'setIcon', + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'feature' => 'getFeature', + 'icon' => 'getIcon', + 'id' => 'getId', + 'name' => 'getName' + ]; + + + + /** + * 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['description'] = isset($data['description']) ? $data['description'] : null; + + $this->container['feature'] = isset($data['feature']) ? $data['feature'] : null; + + $this->container['icon'] = isset($data['icon']) ? $data['icon'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 description + * + * @return map[string,string] + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param map[string,string] $description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + + /** + * Gets feature + * + * @return int + */ + public function getFeature() + { + return $this->container['feature']; + } + + /** + * Sets feature + * + * @param int $feature + * + * @return $this + */ + public function setFeature($feature) + { + $this->container['feature'] = $feature; + + return $this; + } + + + /** + * Gets icon + * + * @return string + */ + public function getIcon() + { + return $this->container['icon']; + } + + /** + * Sets icon + * + * @param string $icon + * + * @return $this + */ + public function setIcon($icon) + { + $this->container['icon'] = $icon; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + 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/wallee-sdk/lib/Model/UnencryptedCardData.php b/wallee-sdk/lib/Model/UnencryptedCardData.php index 72919e5..7b8c67d 100644 --- a/wallee-sdk/lib/Model/UnencryptedCardData.php +++ b/wallee-sdk/lib/Model/UnencryptedCardData.php @@ -1,10 +1,8 @@ 'string', - 'cardVerificationCode' => 'string', - 'expiryDate' => 'string', - 'primaryAccountNumber' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The card holder name is the name printed onto the card. It identifies the person who owns the card. - * - * @var string - */ - private $cardHolderName; - - /** - * The card verification code (CVC) is a 3 to 4 digit code typically printed on the back of the card. It helps to ensure that the card holder is authorizing the transaction. For card not-present transactions this field is optional. - * - * @var string - */ - private $cardVerificationCode; - - /** - * The card expiry date indicates when the card expires. The format is the format yyyy-mm where yyyy is the year (e.g. 2019) and the mm is the month (e.g. 09). - * - * @var string - */ - private $expiryDate; - - /** - * The primary account number (PAN) identifies the card. The number is numeric and typically printed on the front of the card. - * - * @var string - */ - private $primaryAccountNumber; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - } - - - /** - * Returns cardHolderName. - * - * The card holder name is the name printed onto the card. It identifies the person who owns the card. - * - * @return string - */ - public function getCardHolderName() { - return $this->cardHolderName; - } - - /** - * Sets cardHolderName. - * - * @param string $cardHolderName - * @return UnencryptedCardData - */ - protected function setCardHolderName($cardHolderName) { - $this->cardHolderName = $cardHolderName; - - return $this; - } - - /** - * Returns cardVerificationCode. - * - * The card verification code (CVC) is a 3 to 4 digit code typically printed on the back of the card. It helps to ensure that the card holder is authorizing the transaction. For card not-present transactions this field is optional. - * - * @return string - */ - public function getCardVerificationCode() { - return $this->cardVerificationCode; - } - - /** - * Sets cardVerificationCode. - * - * @param string $cardVerificationCode - * @return UnencryptedCardData - */ - protected function setCardVerificationCode($cardVerificationCode) { - $this->cardVerificationCode = $cardVerificationCode; - - return $this; - } - - /** - * Returns expiryDate. - * - * The card expiry date indicates when the card expires. The format is the format yyyy-mm where yyyy is the year (e.g. 2019) and the mm is the month (e.g. 09). - * - * @return string - */ - public function getExpiryDate() { - return $this->expiryDate; - } - - /** - * Sets expiryDate. - * - * @param string $expiryDate - * @return UnencryptedCardData - */ - protected function setExpiryDate($expiryDate) { - $this->expiryDate = $expiryDate; - - return $this; - } - - /** - * Returns primaryAccountNumber. - * - * The primary account number (PAN) identifies the card. The number is numeric and typically printed on the front of the card. - * - * @return string - */ - public function getPrimaryAccountNumber() { - return $this->primaryAccountNumber; - } - - /** - * Sets primaryAccountNumber. - * - * @param string $primaryAccountNumber - * @return UnencryptedCardData - */ - protected function setPrimaryAccountNumber($primaryAccountNumber) { - $this->primaryAccountNumber = $primaryAccountNumber; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class UnencryptedCardData implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'UnencryptedCardData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'card_holder_name' => 'string', + 'card_verification_code' => 'string', + 'expiry_date' => 'string', + 'primary_account_number' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'card_holder_name' => null, + 'card_verification_code' => null, + 'expiry_date' => null, + 'primary_account_number' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'card_holder_name' => 'cardHolderName', + 'card_verification_code' => 'cardVerificationCode', + 'expiry_date' => 'expiryDate', + 'primary_account_number' => 'primaryAccountNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'card_holder_name' => 'setCardHolderName', + 'card_verification_code' => 'setCardVerificationCode', + 'expiry_date' => 'setExpiryDate', + 'primary_account_number' => 'setPrimaryAccountNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'card_holder_name' => 'getCardHolderName', + 'card_verification_code' => 'getCardVerificationCode', + 'expiry_date' => 'getExpiryDate', + 'primary_account_number' => 'getPrimaryAccountNumber' + ]; + + + + /** + * 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['card_holder_name'] = isset($data['card_holder_name']) ? $data['card_holder_name'] : null; + + $this->container['card_verification_code'] = isset($data['card_verification_code']) ? $data['card_verification_code'] : null; + + $this->container['expiry_date'] = isset($data['expiry_date']) ? $data['expiry_date'] : null; + + $this->container['primary_account_number'] = isset($data['primary_account_number']) ? $data['primary_account_number'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 card_holder_name + * + * @return string + */ + public function getCardHolderName() + { + return $this->container['card_holder_name']; + } + + /** + * Sets card_holder_name + * + * @param string $card_holder_name The card holder name is the name printed onto the card. It identifies the person who owns the card. + * + * @return $this + */ + public function setCardHolderName($card_holder_name) + { + $this->container['card_holder_name'] = $card_holder_name; + + return $this; + } + + + /** + * Gets card_verification_code + * + * @return string + */ + public function getCardVerificationCode() + { + return $this->container['card_verification_code']; + } + + /** + * Sets card_verification_code + * + * @param string $card_verification_code The card verification code (CVC) is a 3 to 4 digit code typically printed on the back of the card. It helps to ensure that the card holder is authorizing the transaction. For card not-present transactions this field is optional. + * + * @return $this + */ + public function setCardVerificationCode($card_verification_code) + { + $this->container['card_verification_code'] = $card_verification_code; + + return $this; + } + + + /** + * Gets expiry_date + * + * @return string + */ + public function getExpiryDate() + { + return $this->container['expiry_date']; + } + + /** + * Sets expiry_date + * + * @param string $expiry_date The card expiry date indicates when the card expires. The format is the format yyyy-mm where yyyy is the year (e.g. 2019) and the mm is the month (e.g. 09). + * + * @return $this + */ + public function setExpiryDate($expiry_date) + { + $this->container['expiry_date'] = $expiry_date; + + return $this; + } + + + /** + * Gets primary_account_number + * + * @return string + */ + public function getPrimaryAccountNumber() + { + return $this->container['primary_account_number']; + } + + /** + * Sets primary_account_number + * + * @param string $primary_account_number The primary account number (PAN) identifies the card. The number is numeric and typically printed on the front of the card. + * + * @return $this + */ + public function setPrimaryAccountNumber($primary_account_number) + { + $this->container['primary_account_number'] = $primary_account_number; + + 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/wallee-sdk/lib/Model/UnencryptedCardDataCreate.php b/wallee-sdk/lib/Model/UnencryptedCardDataCreate.php index 131a90c..25c70ba 100644 --- a/wallee-sdk/lib/Model/UnencryptedCardDataCreate.php +++ b/wallee-sdk/lib/Model/UnencryptedCardDataCreate.php @@ -1,10 +1,8 @@ 'string', - 'cardVerificationCode' => 'string', - 'expiryDate' => 'string', - 'primaryAccountNumber' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The card holder name is the name printed onto the card. It identifies the person who owns the card. - * - * @var string - */ - private $cardHolderName; - - /** - * The card verification code (CVC) is a 3 to 4 digit code typically printed on the back of the card. It helps to ensure that the card holder is authorizing the transaction. For card not-present transactions this field is optional. - * - * @var string - */ - private $cardVerificationCode; - - /** - * The card expiry date indicates when the card expires. The format is the format yyyy-mm where yyyy is the year (e.g. 2019) and the mm is the month (e.g. 09). - * - * @var string - */ - private $expiryDate; - - /** - * The primary account number (PAN) identifies the card. The number is numeric and typically printed on the front of the card. - * - * @var string - */ - private $primaryAccountNumber; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['cardHolderName'])) { - $this->setCardHolderName($data['cardHolderName']); - } - if (isset($data['cardVerificationCode'])) { - $this->setCardVerificationCode($data['cardVerificationCode']); - } - if (isset($data['expiryDate'])) { - $this->setExpiryDate($data['expiryDate']); - } - if (isset($data['primaryAccountNumber'])) { - $this->setPrimaryAccountNumber($data['primaryAccountNumber']); - } - } - - - /** - * Returns cardHolderName. - * - * The card holder name is the name printed onto the card. It identifies the person who owns the card. - * - * @return string - */ - public function getCardHolderName() { - return $this->cardHolderName; - } - - /** - * Sets cardHolderName. - * - * @param string $cardHolderName - * @return UnencryptedCardDataCreate - */ - public function setCardHolderName($cardHolderName) { - $this->cardHolderName = $cardHolderName; - - return $this; - } - - /** - * Returns cardVerificationCode. - * - * The card verification code (CVC) is a 3 to 4 digit code typically printed on the back of the card. It helps to ensure that the card holder is authorizing the transaction. For card not-present transactions this field is optional. - * - * @return string - */ - public function getCardVerificationCode() { - return $this->cardVerificationCode; - } - - /** - * Sets cardVerificationCode. - * - * @param string $cardVerificationCode - * @return UnencryptedCardDataCreate - */ - public function setCardVerificationCode($cardVerificationCode) { - $this->cardVerificationCode = $cardVerificationCode; - - return $this; - } - - /** - * Returns expiryDate. - * - * The card expiry date indicates when the card expires. The format is the format yyyy-mm where yyyy is the year (e.g. 2019) and the mm is the month (e.g. 09). - * - * @return string - */ - public function getExpiryDate() { - return $this->expiryDate; - } - - /** - * Sets expiryDate. - * - * @param string $expiryDate - * @return UnencryptedCardDataCreate - */ - public function setExpiryDate($expiryDate) { - $this->expiryDate = $expiryDate; - - return $this; - } - - /** - * Returns primaryAccountNumber. - * - * The primary account number (PAN) identifies the card. The number is numeric and typically printed on the front of the card. - * - * @return string - */ - public function getPrimaryAccountNumber() { - return $this->primaryAccountNumber; - } - - /** - * Sets primaryAccountNumber. - * - * @param string $primaryAccountNumber - * @return UnencryptedCardDataCreate - */ - public function setPrimaryAccountNumber($primaryAccountNumber) { - $this->primaryAccountNumber = $primaryAccountNumber; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - if ($this->getPrimaryAccountNumber() === null) { - throw new ValidationException("'primaryAccountNumber' can't be null", 'primaryAccountNumber', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class UnencryptedCardDataCreate implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'UnencryptedCardData.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'card_holder_name' => 'string', + 'card_verification_code' => 'string', + 'expiry_date' => 'string', + 'primary_account_number' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'card_holder_name' => null, + 'card_verification_code' => null, + 'expiry_date' => null, + 'primary_account_number' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'card_holder_name' => 'cardHolderName', + 'card_verification_code' => 'cardVerificationCode', + 'expiry_date' => 'expiryDate', + 'primary_account_number' => 'primaryAccountNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'card_holder_name' => 'setCardHolderName', + 'card_verification_code' => 'setCardVerificationCode', + 'expiry_date' => 'setExpiryDate', + 'primary_account_number' => 'setPrimaryAccountNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'card_holder_name' => 'getCardHolderName', + 'card_verification_code' => 'getCardVerificationCode', + 'expiry_date' => 'getExpiryDate', + 'primary_account_number' => 'getPrimaryAccountNumber' + ]; + + + + /** + * 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['card_holder_name'] = isset($data['card_holder_name']) ? $data['card_holder_name'] : null; + + $this->container['card_verification_code'] = isset($data['card_verification_code']) ? $data['card_verification_code'] : null; + + $this->container['expiry_date'] = isset($data['expiry_date']) ? $data['expiry_date'] : null; + + $this->container['primary_account_number'] = isset($data['primary_account_number']) ? $data['primary_account_number'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['primary_account_number'] === null) { + $invalidProperties[] = "'primary_account_number' can't be null"; + } + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 card_holder_name + * + * @return string + */ + public function getCardHolderName() + { + return $this->container['card_holder_name']; + } + + /** + * Sets card_holder_name + * + * @param string $card_holder_name The card holder name is the name printed onto the card. It identifies the person who owns the card. + * + * @return $this + */ + public function setCardHolderName($card_holder_name) + { + $this->container['card_holder_name'] = $card_holder_name; + + return $this; + } + + + /** + * Gets card_verification_code + * + * @return string + */ + public function getCardVerificationCode() + { + return $this->container['card_verification_code']; + } + + /** + * Sets card_verification_code + * + * @param string $card_verification_code The card verification code (CVC) is a 3 to 4 digit code typically printed on the back of the card. It helps to ensure that the card holder is authorizing the transaction. For card not-present transactions this field is optional. + * + * @return $this + */ + public function setCardVerificationCode($card_verification_code) + { + $this->container['card_verification_code'] = $card_verification_code; + + return $this; + } + + + /** + * Gets expiry_date + * + * @return string + */ + public function getExpiryDate() + { + return $this->container['expiry_date']; + } + + /** + * Sets expiry_date + * + * @param string $expiry_date The card expiry date indicates when the card expires. The format is the format yyyy-mm where yyyy is the year (e.g. 2019) and the mm is the month (e.g. 09). + * + * @return $this + */ + public function setExpiryDate($expiry_date) + { + $this->container['expiry_date'] = $expiry_date; + + return $this; + } + + + /** + * Gets primary_account_number + * + * @return string + */ + public function getPrimaryAccountNumber() + { + return $this->container['primary_account_number']; + } + + /** + * Sets primary_account_number + * + * @param string $primary_account_number The primary account number (PAN) identifies the card. The number is numeric and typically printed on the front of the card. + * + * @return $this + */ + public function setPrimaryAccountNumber($primary_account_number) + { + $this->container['primary_account_number'] = $primary_account_number; + + 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/wallee-sdk/lib/Model/User.php b/wallee-sdk/lib/Model/User.php index acaf7cd..386fa53 100644 --- a/wallee-sdk/lib/Model/User.php +++ b/wallee-sdk/lib/Model/User.php @@ -1,10 +1,8 @@ 'int', - 'plannedPurgeDate' => '\DateTime', - 'scope' => '\Wallee\Sdk\Model\Scope', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'userType' => '\Wallee\Sdk\Model\UserType', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var \Wallee\Sdk\Model\Scope - */ - private $scope; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * - * - * @var \Wallee\Sdk\Model\UserType - */ - private $userType; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['scope'])) { - $this->setScope($data['scope']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['userType'])) { - $this->setUserType($data['userType']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return User - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return User - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns scope. - * - * - * - * @return \Wallee\Sdk\Model\Scope - */ - public function getScope() { - return $this->scope; - } - - /** - * Sets scope. - * - * @param \Wallee\Sdk\Model\Scope $scope - * @return User - */ - public function setScope($scope) { - $this->scope = $scope; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return User - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns userType. - * - * - * - * @return \Wallee\Sdk\Model\UserType - */ - public function getUserType() { - return $this->userType; - } - - /** - * Sets userType. - * - * @param \Wallee\Sdk\Model\UserType $userType - * @return User - */ - public function setUserType($userType) { - $this->userType = $userType; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return User - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class User implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'User'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'planned_purge_date' => '\DateTime', + 'scope' => '\Wallee\Sdk\Model\Scope', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'user_type' => '\Wallee\Sdk\Model\UserType', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'planned_purge_date' => 'date-time', + 'scope' => null, + 'state' => null, + 'user_type' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'planned_purge_date' => 'plannedPurgeDate', + 'scope' => 'scope', + 'state' => 'state', + 'user_type' => 'userType', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'scope' => 'setScope', + 'state' => 'setState', + 'user_type' => 'setUserType', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'scope' => 'getScope', + 'state' => 'getState', + 'user_type' => 'getUserType', + 'version' => 'getVersion' + ]; + + + + /** + * 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['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['scope'] = isset($data['scope']) ? $data['scope'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['user_type'] = isset($data['user_type']) ? $data['user_type'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets scope + * + * @return \Wallee\Sdk\Model\Scope + */ + public function getScope() + { + return $this->container['scope']; + } + + /** + * Sets scope + * + * @param \Wallee\Sdk\Model\Scope $scope + * + * @return $this + */ + public function setScope($scope) + { + $this->container['scope'] = $scope; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets user_type + * + * @return \Wallee\Sdk\Model\UserType + */ + public function getUserType() + { + return $this->container['user_type']; + } + + /** + * Sets user_type + * + * @param \Wallee\Sdk\Model\UserType $user_type + * + * @return $this + */ + public function setUserType($user_type) + { + $this->container['user_type'] = $user_type; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/UserAccountRole.php b/wallee-sdk/lib/Model/UserAccountRole.php index e6098ec..3b433f0 100644 --- a/wallee-sdk/lib/Model/UserAccountRole.php +++ b/wallee-sdk/lib/Model/UserAccountRole.php @@ -1,10 +1,8 @@ 'int', - 'appliesOnSubAccount' => 'bool', - 'id' => 'int', - 'role' => 'int', - 'user' => 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * - * - * @var int - */ - private $account; - - /** - * - * - * @var bool - */ - private $appliesOnSubAccount; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var int - */ - private $role; - - /** - * - * - * @var int - */ - private $user; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns account. - * - * - * - * @return int - */ - public function getAccount() { - return $this->account; - } - - /** - * Sets account. - * - * @param int $account - * @return UserAccountRole - */ - protected function setAccount($account) { - $this->account = $account; - - return $this; - } - - /** - * Returns appliesOnSubAccount. - * - * - * - * @return bool - */ - public function getAppliesOnSubAccount() { - return $this->appliesOnSubAccount; - } - - /** - * Sets appliesOnSubAccount. - * - * @param bool $appliesOnSubAccount - * @return UserAccountRole - */ - protected function setAppliesOnSubAccount($appliesOnSubAccount) { - $this->appliesOnSubAccount = $appliesOnSubAccount; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return UserAccountRole - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns role. - * - * - * - * @return int - */ - public function getRole() { - return $this->role; - } - - /** - * Sets role. - * - * @param int $role - * @return UserAccountRole - */ - protected function setRole($role) { - $this->role = $role; - - return $this; - } - - /** - * Returns user. - * - * - * - * @return int - */ - public function getUser() { - return $this->user; - } - - /** - * Sets user. - * - * @param int $user - * @return UserAccountRole - */ - protected function setUser($user) { - $this->user = $user; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return UserAccountRole - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class UserAccountRole implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'UserAccountRole'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'account' => 'int', + 'applies_on_sub_account' => 'bool', + 'id' => 'int', + 'role' => 'int', + 'user' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'account' => 'int64', + 'applies_on_sub_account' => null, + 'id' => 'int64', + 'role' => 'int64', + 'user' => 'int64', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account' => 'account', + 'applies_on_sub_account' => 'appliesOnSubAccount', + 'id' => 'id', + 'role' => 'role', + 'user' => 'user', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account' => 'setAccount', + 'applies_on_sub_account' => 'setAppliesOnSubAccount', + 'id' => 'setId', + 'role' => 'setRole', + 'user' => 'setUser', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account' => 'getAccount', + 'applies_on_sub_account' => 'getAppliesOnSubAccount', + 'id' => 'getId', + 'role' => 'getRole', + 'user' => 'getUser', + 'version' => 'getVersion' + ]; + + + + /** + * 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['account'] = isset($data['account']) ? $data['account'] : null; + + $this->container['applies_on_sub_account'] = isset($data['applies_on_sub_account']) ? $data['applies_on_sub_account'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['role'] = isset($data['role']) ? $data['role'] : null; + + $this->container['user'] = isset($data['user']) ? $data['user'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 account + * + * @return int + */ + public function getAccount() + { + return $this->container['account']; + } + + /** + * Sets account + * + * @param int $account + * + * @return $this + */ + public function setAccount($account) + { + $this->container['account'] = $account; + + return $this; + } + + + /** + * Gets applies_on_sub_account + * + * @return bool + */ + public function getAppliesOnSubAccount() + { + return $this->container['applies_on_sub_account']; + } + + /** + * Sets applies_on_sub_account + * + * @param bool $applies_on_sub_account + * + * @return $this + */ + public function setAppliesOnSubAccount($applies_on_sub_account) + { + $this->container['applies_on_sub_account'] = $applies_on_sub_account; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets role + * + * @return int + */ + public function getRole() + { + return $this->container['role']; + } + + /** + * Sets role + * + * @param int $role + * + * @return $this + */ + public function setRole($role) + { + $this->container['role'] = $role; + + return $this; + } + + + /** + * Gets user + * + * @return int + */ + public function getUser() + { + return $this->container['user']; + } + + /** + * Sets user + * + * @param int $user + * + * @return $this + */ + public function setUser($user) + { + $this->container['user'] = $user; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/UserSpaceRole.php b/wallee-sdk/lib/Model/UserSpaceRole.php index 5db904d..a8200d5 100644 --- a/wallee-sdk/lib/Model/UserSpaceRole.php +++ b/wallee-sdk/lib/Model/UserSpaceRole.php @@ -1,10 +1,8 @@ 'int', - 'role' => 'int', - 'space' => 'int', - 'user' => 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var int - */ - private $role; - - /** - * - * - * @var int - */ - private $space; - - /** - * - * - * @var int - */ - private $user; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return UserSpaceRole - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns role. - * - * - * - * @return int - */ - public function getRole() { - return $this->role; - } - - /** - * Sets role. - * - * @param int $role - * @return UserSpaceRole - */ - protected function setRole($role) { - $this->role = $role; - - return $this; - } - - /** - * Returns space. - * - * - * - * @return int - */ - public function getSpace() { - return $this->space; - } - - /** - * Sets space. - * - * @param int $space - * @return UserSpaceRole - */ - protected function setSpace($space) { - $this->space = $space; - - return $this; - } - - /** - * Returns user. - * - * - * - * @return int - */ - public function getUser() { - return $this->user; - } - - /** - * Sets user. - * - * @param int $user - * @return UserSpaceRole - */ - protected function setUser($user) { - $this->user = $user; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return UserSpaceRole - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class UserSpaceRole implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'UserSpaceRole'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'role' => 'int', + 'space' => 'int', + 'user' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'role' => 'int64', + 'space' => 'int64', + 'user' => 'int64', + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'role' => 'role', + 'space' => 'space', + 'user' => 'user', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'role' => 'setRole', + 'space' => 'setSpace', + 'user' => 'setUser', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'role' => 'getRole', + 'space' => 'getSpace', + 'user' => 'getUser', + 'version' => 'getVersion' + ]; + + + + /** + * 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['role'] = isset($data['role']) ? $data['role'] : null; + + $this->container['space'] = isset($data['space']) ? $data['space'] : null; + + $this->container['user'] = isset($data['user']) ? $data['user'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets role + * + * @return int + */ + public function getRole() + { + return $this->container['role']; + } + + /** + * Sets role + * + * @param int $role + * + * @return $this + */ + public function setRole($role) + { + $this->container['role'] = $role; + + return $this; + } + + + /** + * Gets space + * + * @return int + */ + public function getSpace() + { + return $this->container['space']; + } + + /** + * Sets space + * + * @param int $space + * + * @return $this + */ + public function setSpace($space) + { + $this->container['space'] = $space; + + return $this; + } + + + /** + * Gets user + * + * @return int + */ + public function getUser() + { + return $this->container['user']; + } + + /** + * Sets user + * + * @param int $user + * + * @return $this + */ + public function setUser($user) + { + $this->container['user'] = $user; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/UserType.php b/wallee-sdk/lib/Model/UserType.php index b2be53a..12b2582 100644 --- a/wallee-sdk/lib/Model/UserType.php +++ b/wallee-sdk/lib/Model/UserType.php @@ -1,10 +1,8 @@ 'int', - 'linkedSpaceId' => 'int', - 'name' => 'string', - 'plannedPurgeDate' => '\DateTime', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The identity name is used internally to identify the webhook identity in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return WebhookIdentity - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return WebhookIdentity - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * The identity name is used internally to identify the webhook identity in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return WebhookIdentity - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return WebhookIdentity - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return WebhookIdentity - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return WebhookIdentity - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class WebhookIdentity implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'WebhookIdentity'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'linked_space_id' => 'int', + 'name' => 'string', + 'planned_purge_date' => '\DateTime', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'name' => null, + 'planned_purge_date' => 'date-time', + 'state' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'planned_purge_date' => 'plannedPurgeDate', + 'state' => 'state', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'state' => 'setState', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'state' => 'getState', + 'version' => 'getVersion' + ]; + + + + /** + * 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['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The identity name is used internally to identify the webhook identity in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/WebhookListener.php b/wallee-sdk/lib/Model/WebhookListener.php index b3ca6f8..14aa9b6 100644 --- a/wallee-sdk/lib/Model/WebhookListener.php +++ b/wallee-sdk/lib/Model/WebhookListener.php @@ -1,10 +1,8 @@ 'int', - 'entityStates' => 'string[]', - 'id' => 'int', - 'identity' => '\Wallee\Sdk\Model\WebhookIdentity', - 'linkedSpaceId' => 'int', - 'name' => 'string', - 'notifyEveryChange' => 'bool', - 'plannedPurgeDate' => '\DateTime', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'url' => '\Wallee\Sdk\Model\WebhookUrl', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The listener listens on state changes of the entity linked with the listener. - * - * @var int - */ - private $entity; - - /** - * The target state identifies the state into which entities need to move into to trigger the webhook listener. - * - * @var string[] - */ - private $entityStates; - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The identity which will be used to sign messages sent by this listener. - * - * @var \Wallee\Sdk\Model\WebhookIdentity - */ - private $identity; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The webhook listener name is used internally to identify the webhook listener in administrative interfaces.For example it is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * Defines whether the webhook listener is to be informed about every change made to the entity in contrast to state transitions only. - * - * @var bool - */ - private $notifyEveryChange; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The URL which is invoked by the listener to notify the application about the event. - * - * @var \Wallee\Sdk\Model\WebhookUrl - */ - private $url; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['entityStates'])) { - $this->setEntityStates($data['entityStates']); - } - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['identity'])) { - $this->setIdentity($data['identity']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['url'])) { - $this->setUrl($data['url']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns entity. - * - * The listener listens on state changes of the entity linked with the listener. - * - * @return int - */ - public function getEntity() { - return $this->entity; - } - - /** - * Sets entity. - * - * @param int $entity - * @return WebhookListener - */ - protected function setEntity($entity) { - $this->entity = $entity; - - return $this; - } - - /** - * Returns entityStates. - * - * The target state identifies the state into which entities need to move into to trigger the webhook listener. - * - * @return string[] - */ - public function getEntityStates() { - return $this->entityStates; - } - - /** - * Sets entityStates. - * - * @param string[] $entityStates - * @return WebhookListener - */ - public function setEntityStates($entityStates) { - $this->entityStates = $entityStates; - - return $this; - } - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return WebhookListener - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns identity. - * - * The identity which will be used to sign messages sent by this listener. - * - * @return \Wallee\Sdk\Model\WebhookIdentity - */ - public function getIdentity() { - return $this->identity; - } - - /** - * Sets identity. - * - * @param \Wallee\Sdk\Model\WebhookIdentity $identity - * @return WebhookListener - */ - public function setIdentity($identity) { - $this->identity = $identity; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return WebhookListener - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * The webhook listener name is used internally to identify the webhook listener in administrative interfaces.For example it is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return WebhookListener - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns notifyEveryChange. - * - * Defines whether the webhook listener is to be informed about every change made to the entity in contrast to state transitions only. - * - * @return bool - */ - public function getNotifyEveryChange() { - return $this->notifyEveryChange; - } - - /** - * Sets notifyEveryChange. - * - * @param bool $notifyEveryChange - * @return WebhookListener - */ - protected function setNotifyEveryChange($notifyEveryChange) { - $this->notifyEveryChange = $notifyEveryChange; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return WebhookListener - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return WebhookListener - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns url. - * - * The URL which is invoked by the listener to notify the application about the event. - * - * @return \Wallee\Sdk\Model\WebhookUrl - */ - public function getUrl() { - return $this->url; - } - - /** - * Sets url. - * - * @param \Wallee\Sdk\Model\WebhookUrl $url - * @return WebhookListener - */ - public function setUrl($url) { - $this->url = $url; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return WebhookListener - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class WebhookListener implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'WebhookListener'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'entity' => 'int', + 'entity_states' => 'string[]', + 'id' => 'int', + 'identity' => '\Wallee\Sdk\Model\WebhookIdentity', + 'linked_space_id' => 'int', + 'name' => 'string', + 'notify_every_change' => 'bool', + 'planned_purge_date' => '\DateTime', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'url' => '\Wallee\Sdk\Model\WebhookUrl', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'entity' => 'int64', + 'entity_states' => null, + 'id' => 'int64', + 'identity' => null, + 'linked_space_id' => 'int64', + 'name' => null, + 'notify_every_change' => null, + 'planned_purge_date' => 'date-time', + 'state' => null, + 'url' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'entity' => 'entity', + 'entity_states' => 'entityStates', + 'id' => 'id', + 'identity' => 'identity', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'notify_every_change' => 'notifyEveryChange', + 'planned_purge_date' => 'plannedPurgeDate', + 'state' => 'state', + 'url' => 'url', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'entity' => 'setEntity', + 'entity_states' => 'setEntityStates', + 'id' => 'setId', + 'identity' => 'setIdentity', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'notify_every_change' => 'setNotifyEveryChange', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'state' => 'setState', + 'url' => 'setUrl', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'entity' => 'getEntity', + 'entity_states' => 'getEntityStates', + 'id' => 'getId', + 'identity' => 'getIdentity', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'notify_every_change' => 'getNotifyEveryChange', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'state' => 'getState', + 'url' => 'getUrl', + 'version' => 'getVersion' + ]; + + + + /** + * 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['entity'] = isset($data['entity']) ? $data['entity'] : null; + + $this->container['entity_states'] = isset($data['entity_states']) ? $data['entity_states'] : null; + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['identity'] = isset($data['identity']) ? $data['identity'] : null; + + $this->container['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['notify_every_change'] = isset($data['notify_every_change']) ? $data['notify_every_change'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets entity + * + * @return int + */ + public function getEntity() + { + return $this->container['entity']; + } + + /** + * Sets entity + * + * @param int $entity The listener listens on state changes of the entity linked with the listener. + * + * @return $this + */ + public function setEntity($entity) + { + $this->container['entity'] = $entity; + + return $this; + } + + + /** + * Gets entity_states + * + * @return string[] + */ + public function getEntityStates() + { + return $this->container['entity_states']; + } + + /** + * Sets entity_states + * + * @param string[] $entity_states The target state identifies the state into which entities need to move into to trigger the webhook listener. + * + * @return $this + */ + public function setEntityStates($entity_states) + { + $this->container['entity_states'] = $entity_states; + + return $this; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets identity + * + * @return \Wallee\Sdk\Model\WebhookIdentity + */ + public function getIdentity() + { + return $this->container['identity']; + } + + /** + * Sets identity + * + * @param \Wallee\Sdk\Model\WebhookIdentity $identity The identity which will be used to sign messages sent by this listener. + * + * @return $this + */ + public function setIdentity($identity) + { + $this->container['identity'] = $identity; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The webhook listener name is used internally to identify the webhook listener in administrative interfaces.For example it is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets notify_every_change + * + * @return bool + */ + public function getNotifyEveryChange() + { + return $this->container['notify_every_change']; + } + + /** + * Sets notify_every_change + * + * @param bool $notify_every_change Defines whether the webhook listener is to be informed about every change made to the entity in contrast to state transitions only. + * + * @return $this + */ + public function setNotifyEveryChange($notify_every_change) + { + $this->container['notify_every_change'] = $notify_every_change; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets url + * + * @return \Wallee\Sdk\Model\WebhookUrl + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param \Wallee\Sdk\Model\WebhookUrl $url The URL which is invoked by the listener to notify the application about the event. + * + * @return $this + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/WebhookListenerCreate.php b/wallee-sdk/lib/Model/WebhookListenerCreate.php index 3c1744d..332ba96 100644 --- a/wallee-sdk/lib/Model/WebhookListenerCreate.php +++ b/wallee-sdk/lib/Model/WebhookListenerCreate.php @@ -1,10 +1,8 @@ 'int', - 'entityStates' => 'string[]', - 'identity' => 'int', - 'notifyEveryChange' => 'bool', - 'url' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * The listener listens on state changes of the entity linked with the listener. - * - * @var int - */ - private $entity; - - /** - * The target state identifies the state into which entities need to move into to trigger the webhook listener. - * - * @var string[] - */ - private $entityStates; - - /** - * The identity which will be used to sign messages sent by this listener. - * - * @var int - */ - private $identity; - - /** - * Defines whether the webhook listener is to be informed about every change made to the entity in contrast to state transitions only. - * - * @var bool - */ - private $notifyEveryChange; - - /** - * The URL which is invoked by the listener to notify the application about the event. - * - * @var int - */ - private $url; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['entity'])) { - $this->setEntity($data['entity']); - } - if (isset($data['entityStates'])) { - $this->setEntityStates($data['entityStates']); - } - if (isset($data['identity'])) { - $this->setIdentity($data['identity']); - } - if (isset($data['notifyEveryChange'])) { - $this->setNotifyEveryChange($data['notifyEveryChange']); - } - if (isset($data['url'])) { - $this->setUrl($data['url']); - } - } - - - /** - * Returns entity. - * - * The listener listens on state changes of the entity linked with the listener. - * - * @return int - */ - public function getEntity() { - return $this->entity; - } - - /** - * Sets entity. - * - * @param int $entity - * @return WebhookListenerCreate - */ - public function setEntity($entity) { - $this->entity = $entity; - - return $this; - } - - /** - * Returns entityStates. - * - * The target state identifies the state into which entities need to move into to trigger the webhook listener. - * - * @return string[] - */ - public function getEntityStates() { - return $this->entityStates; - } - - /** - * Sets entityStates. - * - * @param string[] $entityStates - * @return WebhookListenerCreate - */ - public function setEntityStates($entityStates) { - $this->entityStates = $entityStates; - - return $this; - } - - /** - * Returns identity. - * - * The identity which will be used to sign messages sent by this listener. - * - * @return int - */ - public function getIdentity() { - return $this->identity; - } - - /** - * Sets identity. - * - * @param int $identity - * @return WebhookListenerCreate - */ - public function setIdentity($identity) { - $this->identity = $identity; - - return $this; - } - - /** - * Returns notifyEveryChange. - * - * Defines whether the webhook listener is to be informed about every change made to the entity in contrast to state transitions only. - * - * @return bool - */ - public function getNotifyEveryChange() { - return $this->notifyEveryChange; - } - - /** - * Sets notifyEveryChange. - * - * @param bool $notifyEveryChange - * @return WebhookListenerCreate - */ - public function setNotifyEveryChange($notifyEveryChange) { - $this->notifyEveryChange = $notifyEveryChange; - - return $this; - } - - /** - * Returns url. - * - * The URL which is invoked by the listener to notify the application about the event. - * - * @return int - */ - public function getUrl() { - return $this->url; - } - - /** - * Sets url. - * - * @param int $url - * @return WebhookListenerCreate - */ - public function setUrl($url) { - $this->url = $url; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - if ($this->getEntity() === null) { - throw new ValidationException("'entity' can't be null", 'entity', $this); - } - if ($this->getEntityStates() === null) { - throw new ValidationException("'entityStates' can't be null", 'entityStates', $this); - } - if ($this->getUrl() === null) { - throw new ValidationException("'url' can't be null", 'url', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class WebhookListenerCreate extends AbstractWebhookListenerUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'WebhookListener.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'entity' => 'int', + 'identity' => 'int', + 'url' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'entity' => 'int64', + 'identity' => 'int64', + 'url' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'entity' => 'entity', + 'identity' => 'identity', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'entity' => 'setEntity', + 'identity' => 'setIdentity', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'entity' => 'getEntity', + 'identity' => 'getIdentity', + 'url' => 'getUrl' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['entity'] = isset($data['entity']) ? $data['entity'] : null; + + $this->container['identity'] = isset($data['identity']) ? $data['identity'] : null; + + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['entity'] === null) { + $invalidProperties[] = "'entity' can't be null"; + } + if ($this->container['url'] === null) { + $invalidProperties[] = "'url' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + + /** + * Gets entity + * + * @return int + */ + public function getEntity() + { + return $this->container['entity']; + } + + /** + * Sets entity + * + * @param int $entity The listener listens on state changes of the entity linked with the listener. + * + * @return $this + */ + public function setEntity($entity) + { + $this->container['entity'] = $entity; + + return $this; + } + + + /** + * Gets identity + * + * @return int + */ + public function getIdentity() + { + return $this->container['identity']; + } + + /** + * Sets identity + * + * @param int $identity The identity which will be used to sign messages sent by this listener. + * + * @return $this + */ + public function setIdentity($identity) + { + $this->container['identity'] = $identity; + + return $this; + } + + + /** + * Gets url + * + * @return int + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param int $url The URL which is invoked by the listener to notify the application about the event. + * + * @return $this + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + 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/wallee-sdk/lib/Model/WebhookListenerEntity.php b/wallee-sdk/lib/Model/WebhookListenerEntity.php index afb9b3a..9b6ddff 100644 --- a/wallee-sdk/lib/Model/WebhookListenerEntity.php +++ b/wallee-sdk/lib/Model/WebhookListenerEntity.php @@ -1,10 +1,8 @@ 'int', - 'name' => 'map[string,string]', - 'technicalName' => 'string' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * - * - * @var map[string,string] - */ - private $name; - - /** - * - * - * @var string - */ - private $technicalName; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['name'])) { - $this->setName($data['name']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return WebhookListenerEntity - */ - protected function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns name. - * - * - * - * @return map[string,string] - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param map[string,string] $name - * @return WebhookListenerEntity - */ - public function setName($name) { - if (is_array($name) && empty($name)) { - $this->name = new \stdClass; - } else { - $this->name = $name; - } - - return $this; - } - - /** - * Returns technicalName. - * - * - * - * @return string - */ - public function getTechnicalName() { - return $this->technicalName; - } - - /** - * Sets technicalName. - * - * @param string $technicalName - * @return WebhookListenerEntity - */ - protected function setTechnicalName($technicalName) { - $this->technicalName = $technicalName; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class WebhookListenerEntity implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'WebhookListenerEntity'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'name' => 'map[string,string]', + 'technical_name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'name' => null, + 'technical_name' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'technical_name' => 'technicalName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'technical_name' => 'setTechnicalName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'technical_name' => 'getTechnicalName' + ]; + + + + /** + * 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['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['technical_name'] = isset($data['technical_name']) ? $data['technical_name'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets name + * + * @return map[string,string] + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param map[string,string] $name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets technical_name + * + * @return string + */ + public function getTechnicalName() + { + return $this->container['technical_name']; + } + + /** + * Sets technical_name + * + * @param string $technical_name + * + * @return $this + */ + public function setTechnicalName($technical_name) + { + $this->container['technical_name'] = $technical_name; + + 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/wallee-sdk/lib/Model/WebhookListenerUpdate.php b/wallee-sdk/lib/Model/WebhookListenerUpdate.php index 3799660..1460fe4 100644 --- a/wallee-sdk/lib/Model/WebhookListenerUpdate.php +++ b/wallee-sdk/lib/Model/WebhookListenerUpdate.php @@ -1,10 +1,8 @@ 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return WebhookListenerUpdate - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return WebhookListenerUpdate - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - if ($this->getId() === null) { - throw new ValidationException("'id' can't be null", 'id', $this); - } - if ($this->getVersion() === null) { - throw new ValidationException("'version' can't be null", 'version', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class WebhookListenerUpdate extends AbstractWebhookListenerUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'WebhookListener.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/WebhookUrl.php b/wallee-sdk/lib/Model/WebhookUrl.php index df68584..e1c8c67 100644 --- a/wallee-sdk/lib/Model/WebhookUrl.php +++ b/wallee-sdk/lib/Model/WebhookUrl.php @@ -1,10 +1,8 @@ 'int', - 'linkedSpaceId' => 'int', - 'name' => 'string', - 'plannedPurgeDate' => '\DateTime', - 'state' => '\Wallee\Sdk\Model\CreationEntityState', - 'url' => 'string', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes; - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @var int - */ - private $linkedSpaceId; - - /** - * The URL name is used internally to identify the URL in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @var string - */ - private $name; - - /** - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @var \DateTime - */ - private $plannedPurgeDate; - - /** - * - * - * @var \Wallee\Sdk\Model\CreationEntityState - */ - private $state; - - /** - * The URL to which the HTTP requests are sent to. An example URL could look like https://www.example.com/some/path?some-query-parameter=value. - * - * @var string - */ - private $url; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['state'])) { - $this->setState($data['state']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return WebhookUrl - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns linkedSpaceId. - * - * The linked space id holds the ID of the space to which the entity belongs to. - * - * @return int - */ - public function getLinkedSpaceId() { - return $this->linkedSpaceId; - } - - /** - * Sets linkedSpaceId. - * - * @param int $linkedSpaceId - * @return WebhookUrl - */ - protected function setLinkedSpaceId($linkedSpaceId) { - $this->linkedSpaceId = $linkedSpaceId; - - return $this; - } - - /** - * Returns name. - * - * The URL name is used internally to identify the URL in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. - * - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * Sets name. - * - * @param string $name - * @return WebhookUrl - */ - protected function setName($name) { - $this->name = $name; - - return $this; - } - - /** - * Returns plannedPurgeDate. - * - * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. - * - * @return \DateTime - */ - public function getPlannedPurgeDate() { - return $this->plannedPurgeDate; - } - - /** - * Sets plannedPurgeDate. - * - * @param \DateTime $plannedPurgeDate - * @return WebhookUrl - */ - protected function setPlannedPurgeDate($plannedPurgeDate) { - $this->plannedPurgeDate = $plannedPurgeDate; - - return $this; - } - - /** - * Returns state. - * - * - * - * @return \Wallee\Sdk\Model\CreationEntityState - */ - public function getState() { - return $this->state; - } - - /** - * Sets state. - * - * @param \Wallee\Sdk\Model\CreationEntityState $state - * @return WebhookUrl - */ - public function setState($state) { - $this->state = $state; - - return $this; - } - - /** - * Returns url. - * - * The URL to which the HTTP requests are sent to. An example URL could look like https://www.example.com/some/path?some-query-parameter=value. - * - * @return string - */ - public function getUrl() { - return $this->url; - } - - /** - * Sets url. - * - * @param string $url - * @return WebhookUrl - */ - protected function setUrl($url) { - $this->url = $url; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return WebhookUrl - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } - +class WebhookUrl implements ModelInterface, ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'WebhookUrl'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'linked_space_id' => 'int', + 'name' => 'string', + 'planned_purge_date' => '\DateTime', + 'state' => '\Wallee\Sdk\Model\CreationEntityState', + 'url' => 'string', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'linked_space_id' => 'int64', + 'name' => null, + 'planned_purge_date' => 'date-time', + 'state' => null, + 'url' => null, + 'version' => 'int32' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'linked_space_id' => 'linkedSpaceId', + 'name' => 'name', + 'planned_purge_date' => 'plannedPurgeDate', + 'state' => 'state', + 'url' => 'url', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'linked_space_id' => 'setLinkedSpaceId', + 'name' => 'setName', + 'planned_purge_date' => 'setPlannedPurgeDate', + 'state' => 'setState', + 'url' => 'setUrl', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'linked_space_id' => 'getLinkedSpaceId', + 'name' => 'getName', + 'planned_purge_date' => 'getPlannedPurgeDate', + 'state' => 'getState', + 'url' => 'getUrl', + 'version' => 'getVersion' + ]; + + + + /** + * 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['linked_space_id'] = isset($data['linked_space_id']) ? $data['linked_space_id'] : null; + + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + + $this->container['planned_purge_date'] = isset($data['planned_purge_date']) ? $data['planned_purge_date'] : null; + + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 + * + * @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; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets linked_space_id + * + * @return int + */ + public function getLinkedSpaceId() + { + return $this->container['linked_space_id']; + } + + /** + * Sets linked_space_id + * + * @param int $linked_space_id The linked space id holds the ID of the space to which the entity belongs to. + * + * @return $this + */ + public function setLinkedSpaceId($linked_space_id) + { + $this->container['linked_space_id'] = $linked_space_id; + + return $this; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The URL name is used internally to identify the URL in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + + /** + * Gets planned_purge_date + * + * @return \DateTime + */ + public function getPlannedPurgeDate() + { + return $this->container['planned_purge_date']; + } + + /** + * Sets planned_purge_date + * + * @param \DateTime $planned_purge_date The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. + * + * @return $this + */ + public function setPlannedPurgeDate($planned_purge_date) + { + $this->container['planned_purge_date'] = $planned_purge_date; + + return $this; + } + + + /** + * Gets state + * + * @return \Wallee\Sdk\Model\CreationEntityState + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Wallee\Sdk\Model\CreationEntityState $state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url The URL to which the HTTP requests are sent to. An example URL could look like https://www.example.com/some/path?some-query-parameter=value. + * + * @return $this + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/Model/WebhookUrlCreate.php b/wallee-sdk/lib/Model/WebhookUrlCreate.php index ebaf159..4fbe76a 100644 --- a/wallee-sdk/lib/Model/WebhookUrlCreate.php +++ b/wallee-sdk/lib/Model/WebhookUrlCreate.php @@ -1,10 +1,8 @@ validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class WebhookUrlCreate extends AbstractWebhookUrlUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'WebhookUrl.Create'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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; + } + + + /** + * 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/wallee-sdk/lib/Model/WebhookUrlUpdate.php b/wallee-sdk/lib/Model/WebhookUrlUpdate.php index e0628e7..8db338c 100644 --- a/wallee-sdk/lib/Model/WebhookUrlUpdate.php +++ b/wallee-sdk/lib/Model/WebhookUrlUpdate.php @@ -1,10 +1,8 @@ 'int', - 'version' => 'int' ); - - /** - * Returns an array of property to type mappings. - * - * @return string[] - */ - public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); - } - - - - /** - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @var int - */ - private $id; - - /** - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @var int - */ - private $version; - - - /** - * Constructor. - * - * @param mixed[] $data an associated array of property values initializing the model - */ - public function __construct(array $data = null) { - parent::__construct($data); - - if (isset($data['id'])) { - $this->setId($data['id']); - } - if (isset($data['version'])) { - $this->setVersion($data['version']); - } - } - - - /** - * Returns id. - * - * The ID is the primary key of the entity. The ID identifies the entity uniquely. - * - * @return int - */ - public function getId() { - return $this->id; - } - - /** - * Sets id. - * - * @param int $id - * @return WebhookUrlUpdate - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Returns version. - * - * The version number indicates the version of the entity. The version is incremented whenever the entity is changed. - * - * @return int - */ - public function getVersion() { - return $this->version; - } - - /** - * Sets version. - * - * @param int $version - * @return WebhookUrlUpdate - */ - public function setVersion($version) { - $this->version = $version; - - return $this; - } - - /** - * Validates the model's properties and throws a ValidationException if the validation fails. - * - * @throws ValidationException - */ - public function validate() { - parent::validate(); - - if ($this->getId() === null) { - throw new ValidationException("'id' can't be null", 'id', $this); - } - if ($this->getVersion() === null) { - throw new ValidationException("'version' can't be null", 'version', $this); - } - } - - /** - * Returns true if all the properties in the model are valid. - * - * @return boolean - */ - public function isValid() { - try { - $this->validate(); - return true; - } catch (ValidationException $e) { - return false; - } - } - - /** - * Returns the string presentation of the object. - * - * @return string - */ - public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Wallee\Sdk\ObjectSerializer::sanitizeForSerialization($this)); - } +class WebhookUrlUpdate extends AbstractWebhookUrlUpdate +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = 'WebhookUrl.Update'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'version' => 'int64' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'version' => 'getVersion' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 The ID is the primary key of the entity. The ID identifies the entity uniquely. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + 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/wallee-sdk/lib/ObjectSerializer.php b/wallee-sdk/lib/ObjectSerializer.php index febc41a..f6fced2 100644 --- a/wallee-sdk/lib/ObjectSerializer.php +++ b/wallee-sdk/lib/ObjectSerializer.php @@ -1,10 +1,8 @@ format(\DateTime::ATOM); - } elseif (is_array($data)) { - foreach ($data as $property => $value) { - $data[$property] = self::sanitizeForSerialization($value); - } - return $data; - } elseif ($data instanceof \stdClass) { - return $data; - } elseif (is_object($data)) { - $values = array(); - foreach (array_keys($data::swaggerTypes()) as $property) { - $getter = 'get' . ucfirst($property); - $values[$property] = self::sanitizeForSerialization($data->$getter()); - } - return (object)$values; - } else { - return (string)$data; - } - } + /** + * Serialize data + * + * @param mixed $data the data to serialize + * @param string $type the SwaggerType of the data + * @param string $format the format of the Swagger type of the data + * + * @return string|object serialized form of $data + */ + public static function sanitizeForSerialization($data, $type = null, $format = null) + { + if (is_scalar($data) || null === $data) { + return $data; + } elseif ($data instanceof \DateTime) { + return ($format === 'date') ? $data->format('Y-m-d') : $data->format(\DateTime::ATOM); + } elseif (is_array($data)) { + foreach ($data as $property => $value) { + $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(); + foreach ($data::swaggerTypes() as $property => $swaggerType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + 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(), true)) { + $imploded = implode("', '", $swaggerType::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'"); + } + if ($value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $swaggerType, $formats[$property]); + } + } + return (object)$values; + } else { + return (string)$data; + } + } - /** - * Sanitizes a filename by removing the path. - * e.g. ../../sun.gif becomes sun.gif - * - * @param string $filename the filename to be sanitized - * @return string - */ - public function sanitizeFilename($filename) { - if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { - return $match[1]; - } else { - return $filename; - } - } + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } - /** - * Takes a value and turns it into a string suitable for inclusion in the path, by url-encoding. - * - * @param string $value a string which will be part of the path - * @return string - */ - public function toPathValue($value) { - return rawurlencode($this->toString($value)); - } + /** + * Take value and turn it into a string suitable for inclusion in + * the path, by url-encoding. + * + * @param string $value a string which will be part of the path + * + * @return string the serialized object + */ + public static function toPathValue($value) + { + return rawurlencode(self::toString($value)); + } - /** - * Takes a value and turns it into a string suitable for inclusion in the query, by imploding comma-separated if - * it's an object. If it's a string, pass through unchanged. It will be url-encoded later. - * - * @param string[]|string|\DateTime $object an object to be serialized to a string - * @return string - */ - public function toQueryValue($object) { - if (is_array($object)) { - return implode(',', $object); - } else { - return $this->toString($object); - } - } + /** + * Take value and turn it into a string suitable for inclusion in + * the query, by imploding comma-separated if it's an object. + * If it's a string, pass through unchanged. It will be url-encoded + * later. + * + * @param string[]|string|\DateTime $object an object to be serialized to a string + * + * @return string the serialized object + */ + public static function toQueryValue($object) + { + if (is_array($object)) { + return implode(',', $object); + } else { + return self::toString($object); + } + } - /** - * Takes a value and turns it into a string suitable for inclusion in the header. If it's a string, pass through - * unchanged. If it's a datetime object, format it in ISO8601 - * - * @param string $value a string which will be part of the header - * @return string - */ - public function toHeaderValue($value) { - return $this->toString($value); - } + /** + * Take value and turn it into a string suitable for inclusion in + * the header. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string $value a string which will be part of the header + * + * @return string the header string + */ + public static function toHeaderValue($value) + { + return self::toString($value); + } - /** - * Takes a value and turns it into a string suitable for inclusion in the http body (form parameter). If it's a - * string, pass through unchanged. If it's a datetime object, format it in ISO8601 - * - * @param string|\SplFileObject $value the value of the form parameter - * @return string - */ - public function toFormValue($value) { - if ($value instanceof \SplFileObject) { - return $value->getRealPath(); - } else { - return $this->toString($value); - } - } + /** + * Take value and turn it into a string suitable for inclusion in + * the http body (form parameter). If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string|\SplFileObject $value the value of the form parameter + * + * @return string the form string + */ + public static function toFormValue($value) + { + if ($value instanceof \SplFileObject) { + return $value->getRealPath(); + } else { + return self::toString($value); + } + } - /** - * Takes a value and turns it into a string suitable for inclusion in the parameter. If it's a string, pass through - * unchanged. If it's a datetime object, format it in ISO8601 - * - * @param string|\DateTime $value the value of the parameter - * @return string - */ - public function toString($value) { - if ($value instanceof \DateTime) { // datetime in ISO8601 format - return $value->format(\DateTime::ATOM); - } else { - return $value; - } - } + /** + * Take value and turn it into a string suitable for inclusion in + * the parameter. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string|\DateTime $value the value of the parameter + * + * @return string the header string + */ + public static function toString($value) + { + if ($value instanceof \DateTime) { // datetime in ISO8601 format + return $value->format(\DateTime::ATOM); + } else { + return $value; + } + } - /** - * Serializes an array to a string. - * - * @param array $collection the collection to serialize to a string - * @param string $collectionFormat the format used for serialization (csv, ssv, tsv, pipes, multi) - * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array - * @return string - */ - public function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false) { - if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) { - // http_build_query() almost does the job for us. We just - // need to fix the result of multidimensional arrays. - return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); - } - switch ($collectionFormat) { - case 'pipes': - return implode('|', $collection); - - case 'tsv': - return implode("\t", $collection); - - case 'ssv': - return implode(' ', $collection); - - case 'csv': - // Deliberate fall through. CSV is default format. - default: - return implode(',', $collection); - } - } + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $collectionFormat the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($collectionFormat) { + case 'pipes': + return implode('|', $collection); - /** - * Deserialize a JSON string into an object. - * - * @param mixed $data the data to be deserialized - * @param string $class the class name to convert the data to - * @param string[] $httpHeaders the HTTP headers - * @param string $discriminator the discriminator if polymorphism is used - * - * @return object|array|null an single or an array of $class instances - */ - public function deserialize($data, $class, $httpHeaders = null, $discriminator = null) { - if (null === $data) { - return null; - } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] - $inner = substr($class, 4, -1); - $deserialized = array(); - if (strrpos($inner, ",") !== false) { - $subClassArray = explode(',', $inner, 2); - $subClass = $subClassArray[1]; - foreach ($data as $key => $value) { - $deserialized[$key] = self::deserialize($value, $subClass, null, $discriminator); - } - } - return $deserialized; - } elseif (strcasecmp(substr($class, -2), '[]') === 0) { - $subClass = substr($class, 0, -2); - $values = array(); - foreach ($data as $key => $value) { - $values[] = self::deserialize($value, $subClass, null, $discriminator); - } - return $values; - } elseif ($class === 'object') { - settype($data, 'array'); - return $data; - } elseif ($class === '\DateTime') { - // Some API's return an invalid, empty string as a - // date-time property. DateTime::__construct() will return - // the current time for empty input which is probably not - // what is meant. The invalid empty string is probably to - // be interpreted as a missing field/value. Let's handle - // this graceful. - if (!empty($data)) { - return new \DateTime($data); - } else { - return null; - } - } elseif (in_array($class, array('void', 'bool', 'string', 'double', 'byte', 'mixed', 'integer', 'float', 'int', 'DateTime', 'number', 'boolean', 'object'), true)) { - settype($data, $class); - return $data; - } elseif ($class === '\SplFileObject') { - // determine file name - if (array_key_exists('Content-Disposition', $httpHeaders) && - preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { - $filename = $this->getTempFolderPath() . sanitizeFilename($match[1]); - } else { - $filename = tempnam($this->getTempFolderPath(), ''); - } - $deserialized = new \SplFileObject($filename, "w"); - $byteWritten = $deserialized->fwrite($data); - if ($this->isDebuggingEnabled()) { - error_log("[DEBUG] Written $byteWritten byte to $filename. Please move the file to a proper folder or delete the temp file after processing.".PHP_EOL, 3, $this->getDebugFile()); - } - - return $deserialized; - } else { - // If a discriminator is defined and points to a valid subclass, use it. - if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { - $subclass = '\Wallee\Sdk\Model\\' . $data->{$discriminator}; - if (is_subclass_of($subclass, $class)) { - $class = $subclass; - } - } - - if (is_subclass_of($class, '\Wallee\Sdk\Model\IEnum')) { - return (string) $data; - } - - $instance = new $class(); - foreach ($instance::swaggerTypes() as $property => $type) { - $propertySetter = 'set' . ucfirst($property); - - if (!isset($propertySetter) || !isset($data->{$property})) { - continue; - } - - $propertyValue = $data->{$property}; - if (isset($propertyValue)) { - $method = new \ReflectionMethod($class, $propertySetter); - $method->setAccessible(true); - $method->invoke($instance, self::deserialize($propertyValue, $type, null, $discriminator)); - } - } - return $instance; - } - } + case 'tsv': + return implode("\t", $collection); + + case 'ssv': + return implode(' ', $collection); + + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null an single or an array of $class instances + * @throws \Exception + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } elseif (strcasecmp(substr($class, -2), '[]') === 0) { + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } elseif ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === '\DateTime') { + // Some API's return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + return new \DateTime($data); + } else { + return null; + } + } elseif (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } elseif ($class === '\SplFileObject') { + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if (array_key_exists('Content-Disposition', $httpHeaders) && + preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } elseif (method_exists($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'"); + } + return $data; + } else { + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\Wallee\Sdk\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + $instance = new $class(); + foreach ($instance::swaggerTypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { + continue; + } + + $propertyValue = $data->{$instance::attributeMap()[$property]}; + if (isset($propertyValue)) { + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } + + /** + * Wrapper for json_decode that throws when an error occurs. + * + * @param string $json JSON data to parse + * @param bool $assoc When true, returned objects will be converted + * into associative arrays. + * @param int $depth User specified recursion depth. + * @param int $options Bitmask of JSON decode options. + * + * @return mixed + * @throws Exception\InvalidArgumentException if the JSON cannot be decoded. + * @link http://www.php.net/manual/en/function.json-decode.php + * @link https://github.com/guzzle/guzzle/blob/6.4.1/src/functions.php + */ + public static function json_decode($json, $assoc = false, $depth = 512, $options = 0) + { + $data = \json_decode($json, $assoc, $depth, $options); + if (JSON_ERROR_NONE !== json_last_error()) { + throw new Exception('json_decode error: ' . json_last_error_msg()); + } + return $data; + } + + /** + * Wrapper for JSON encoding that throws when an error occurs. + * + * @param mixed $value The value being encoded + * @param int $options JSON encode option bitmask + * @param int $depth Set the maximum depth. Must be greater than zero. + * + * @return string + * @throws Exception\InvalidArgumentException if the JSON cannot be encoded. + * @link http://www.php.net/manual/en/function.json-encode.php + * @link https://github.com/guzzle/guzzle/blob/6.4.1/src/functions.php + */ + public static function json_encode($value, $options = 0, $depth = 512) + { + $json = \json_encode($value, $options, $depth); + if (JSON_ERROR_NONE !== json_last_error()) { + throw new Exception('json_encode error: ' . json_last_error_msg()); + } + return $json; + } + + /** + * Build a query string from an array of key value pairs. + * + * This function can use the return value of parse_query() to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like http_build_query would). + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + * @return string + */ + public static function build_query(array $params, $encoding = PHP_QUERY_RFC3986) + { + if (!$params) { + return ''; + } + if ($encoding === false) { + $encoder = function ($str) { return $str; }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $qs = ''; + + foreach ($params as $k => $v) { + $k = $encoder($k); + if (!is_array($v)) { + $qs .= $k; + if ($v !== null) { + $qs .= '=' . $encoder($v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + if ($vv !== null) { + $qs .= '=' . $encoder($vv); + } + $qs .= '&'; + } + } + } + return $qs ? (string) substr($qs, 0, -1) : ''; + } -} \ No newline at end of file +} diff --git a/wallee-sdk/lib/Service/AccountService.php b/wallee-sdk/lib/Service/AccountService.php index 49e9c86..e421f4c 100644 --- a/wallee-sdk/lib/Service/AccountService.php +++ b/wallee-sdk/lib/Service/AccountService.php @@ -1,10 +1,8 @@ apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/account/count"; + $resourcePath = '/account/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -138,20 +138,31 @@ public function countWithHttpInfo($filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -184,27 +195,27 @@ public function create($entity) { */ public function createWithHttpInfo($entity) { // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/account/create"; + $resourcePath = '/account/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -232,20 +243,31 @@ public function createWithHttpInfo($entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Account', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Account', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Account', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -278,27 +300,27 @@ public function delete($id) { */ public function deleteWithHttpInfo($id) { // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/account/delete"; + $resourcePath = '/account/delete'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($id)) { @@ -326,20 +348,31 @@ public function deleteWithHttpInfo($id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -372,30 +405,30 @@ public function read($id) { */ public function readWithHttpInfo($id) { // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($id !== null) { + $queryParams = []; + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/account/read"; + $resourcePath = '/account/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -418,20 +451,31 @@ public function readWithHttpInfo($id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Account', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Account', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Account', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -464,27 +508,27 @@ public function search($query) { */ public function searchWithHttpInfo($query) { // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/account/search"; + $resourcePath = '/account/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -512,20 +556,31 @@ public function searchWithHttpInfo($query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Account[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Account[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Account[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -558,27 +613,27 @@ public function update($entity) { */ public function updateWithHttpInfo($entity) { // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/account/update"; + $resourcePath = '/account/update'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -606,24 +661,39 @@ public function updateWithHttpInfo($entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Account', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Account', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Account', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/ApplicationUserService.php b/wallee-sdk/lib/Service/ApplicationUserService.php index ca282cb..4e8714f 100644 --- a/wallee-sdk/lib/Service/ApplicationUserService.php +++ b/wallee-sdk/lib/Service/ApplicationUserService.php @@ -1,10 +1,8 @@ apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/application-user/count"; + $resourcePath = '/application-user/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -138,20 +138,31 @@ public function countWithHttpInfo($filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -184,27 +195,27 @@ public function create($entity) { */ public function createWithHttpInfo($entity) { // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/application-user/create"; + $resourcePath = '/application-user/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -232,20 +243,31 @@ public function createWithHttpInfo($entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ApplicationUserCreateWithMacKey', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ApplicationUserCreateWithMacKey', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ApplicationUserCreateWithMacKey', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -278,27 +300,27 @@ public function delete($id) { */ public function deleteWithHttpInfo($id) { // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/application-user/delete"; + $resourcePath = '/application-user/delete'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($id)) { @@ -326,20 +348,31 @@ public function deleteWithHttpInfo($id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -372,30 +405,30 @@ public function read($id) { */ public function readWithHttpInfo($id) { // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($id !== null) { + $queryParams = []; + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/application-user/read"; + $resourcePath = '/application-user/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -418,20 +451,31 @@ public function readWithHttpInfo($id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ApplicationUser', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ApplicationUser', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ApplicationUser', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -464,27 +508,27 @@ public function search($query) { */ public function searchWithHttpInfo($query) { // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/application-user/search"; + $resourcePath = '/application-user/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -512,20 +556,31 @@ public function searchWithHttpInfo($query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ApplicationUser[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ApplicationUser[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ApplicationUser[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -558,27 +613,27 @@ public function update($entity) { */ public function updateWithHttpInfo($entity) { // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/application-user/update"; + $resourcePath = '/application-user/update'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -606,24 +661,39 @@ public function updateWithHttpInfo($entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ApplicationUser', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ApplicationUser', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ApplicationUser', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/CardProcessingService.php b/wallee-sdk/lib/Service/CardProcessingService.php index 80caa64..aa0893a 100644 --- a/wallee-sdk/lib/Service/CardProcessingService.php +++ b/wallee-sdk/lib/Service/CardProcessingService.php @@ -1,10 +1,8 @@ processWithHttpInfo($spaceId, $transactionId, $paymentMethodConfigurationId, $cardData)->getData(); + public function process($space_id, $transaction_id, $payment_method_configuration_id, $card_data) { + return $this->processWithHttpInfo($space_id, $transaction_id, $payment_method_configuration_id, $card_data)->getData(); } /** @@ -89,63 +89,63 @@ public function process($spaceId, $transactionId, $paymentMethodConfigurationId, * * Process * - * @param int $spaceId (required) - * @param int $transactionId The ID of the transaction which should be processed. (required) - * @param int $paymentMethodConfigurationId The payment method configuration ID which is applied to the transaction. (required) - * @param \Wallee\Sdk\Model\UnencryptedCardDataCreate $cardData The card details as JSON in plain which should be used to authorize the payment. (required) + * @param int $space_id (required) + * @param int $transaction_id The ID of the transaction which should be processed. (required) + * @param int $payment_method_configuration_id The payment method configuration ID which is applied to the transaction. (required) + * @param \Wallee\Sdk\Model\UnencryptedCardDataCreate $card_data The card details as JSON in plain which should be used to authorize the payment. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function processWithHttpInfo($spaceId, $transactionId, $paymentMethodConfigurationId, $cardData) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling process'); + public function processWithHttpInfo($space_id, $transaction_id, $payment_method_configuration_id, $card_data) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling process'); } - // verify the required parameter 'transactionId' is set - if ($transactionId === null) { - throw new \InvalidArgumentException('Missing the required parameter $transactionId when calling process'); + // verify the required parameter 'transaction_id' is set + if (is_null($transaction_id)) { + throw new \InvalidArgumentException('Missing the required parameter $transaction_id when calling process'); } - // verify the required parameter 'paymentMethodConfigurationId' is set - if ($paymentMethodConfigurationId === null) { - throw new \InvalidArgumentException('Missing the required parameter $paymentMethodConfigurationId when calling process'); + // verify the required parameter 'payment_method_configuration_id' is set + if (is_null($payment_method_configuration_id)) { + throw new \InvalidArgumentException('Missing the required parameter $payment_method_configuration_id when calling process'); } - // verify the required parameter 'cardData' is set - if ($cardData === null) { - throw new \InvalidArgumentException('Missing the required parameter $cardData when calling process'); + // verify the required parameter 'card_data' is set + if (is_null($card_data)) { + throw new \InvalidArgumentException('Missing the required parameter $card_data when calling process'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($transactionId !== null) { - $queryParams['transactionId'] = $this->apiClient->getSerializer()->toQueryValue($transactionId); + if (!is_null($transaction_id)) { + $queryParams['transactionId'] = $this->apiClient->getSerializer()->toQueryValue($transaction_id); } - if ($paymentMethodConfigurationId !== null) { - $queryParams['paymentMethodConfigurationId'] = $this->apiClient->getSerializer()->toQueryValue($paymentMethodConfigurationId); + if (!is_null($payment_method_configuration_id)) { + $queryParams['paymentMethodConfigurationId'] = $this->apiClient->getSerializer()->toQueryValue($payment_method_configuration_id); } // path params - $resourcePath = "/card-processing/process"; + $resourcePath = '/card-processing/process'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; - if (isset($cardData)) { - $tempBody = $cardData; + if (isset($card_data)) { + $tempBody = $card_data; } // for model (json/xml) @@ -169,24 +169,39 @@ public function processWithHttpInfo($spaceId, $transactionId, $paymentMethodConf return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Transaction', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Transaction', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Transaction', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -196,17 +211,17 @@ public function processWithHttpInfo($spaceId, $transactionId, $paymentMethodConf * * Process With 3-D Secure * - * @param int $spaceId (required) - * @param int $transactionId The ID of the transaction which should be processed. (required) - * @param int $paymentMethodConfigurationId The payment method configuration ID which is applied to the transaction. (required) - * @param \Wallee\Sdk\Model\UnencryptedCardDataCreate $cardData The card details as JSON in plain which should be used to authorize the payment. (required) + * @param int $space_id (required) + * @param int $transaction_id The ID of the transaction which should be processed. (required) + * @param int $payment_method_configuration_id The payment method configuration ID which is applied to the transaction. (required) + * @param \Wallee\Sdk\Model\UnencryptedCardDataCreate $card_data The card details as JSON in plain which should be used to authorize the payment. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return string */ - public function processWith3DSecure($spaceId, $transactionId, $paymentMethodConfigurationId, $cardData) { - return $this->processWith3DSecureWithHttpInfo($spaceId, $transactionId, $paymentMethodConfigurationId, $cardData)->getData(); + public function processWith3DSecure($space_id, $transaction_id, $payment_method_configuration_id, $card_data) { + return $this->processWith3DSecureWithHttpInfo($space_id, $transaction_id, $payment_method_configuration_id, $card_data)->getData(); } /** @@ -214,63 +229,63 @@ public function processWith3DSecure($spaceId, $transactionId, $paymentMethodConf * * Process With 3-D Secure * - * @param int $spaceId (required) - * @param int $transactionId The ID of the transaction which should be processed. (required) - * @param int $paymentMethodConfigurationId The payment method configuration ID which is applied to the transaction. (required) - * @param \Wallee\Sdk\Model\UnencryptedCardDataCreate $cardData The card details as JSON in plain which should be used to authorize the payment. (required) + * @param int $space_id (required) + * @param int $transaction_id The ID of the transaction which should be processed. (required) + * @param int $payment_method_configuration_id The payment method configuration ID which is applied to the transaction. (required) + * @param \Wallee\Sdk\Model\UnencryptedCardDataCreate $card_data The card details as JSON in plain which should be used to authorize the payment. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function processWith3DSecureWithHttpInfo($spaceId, $transactionId, $paymentMethodConfigurationId, $cardData) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling processWith3DSecure'); + public function processWith3DSecureWithHttpInfo($space_id, $transaction_id, $payment_method_configuration_id, $card_data) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling processWith3DSecure'); } - // verify the required parameter 'transactionId' is set - if ($transactionId === null) { - throw new \InvalidArgumentException('Missing the required parameter $transactionId when calling processWith3DSecure'); + // verify the required parameter 'transaction_id' is set + if (is_null($transaction_id)) { + throw new \InvalidArgumentException('Missing the required parameter $transaction_id when calling processWith3DSecure'); } - // verify the required parameter 'paymentMethodConfigurationId' is set - if ($paymentMethodConfigurationId === null) { - throw new \InvalidArgumentException('Missing the required parameter $paymentMethodConfigurationId when calling processWith3DSecure'); + // verify the required parameter 'payment_method_configuration_id' is set + if (is_null($payment_method_configuration_id)) { + throw new \InvalidArgumentException('Missing the required parameter $payment_method_configuration_id when calling processWith3DSecure'); } - // verify the required parameter 'cardData' is set - if ($cardData === null) { - throw new \InvalidArgumentException('Missing the required parameter $cardData when calling processWith3DSecure'); + // verify the required parameter 'card_data' is set + if (is_null($card_data)) { + throw new \InvalidArgumentException('Missing the required parameter $card_data when calling processWith3DSecure'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array()); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept([]); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($transactionId !== null) { - $queryParams['transactionId'] = $this->apiClient->getSerializer()->toQueryValue($transactionId); + if (!is_null($transaction_id)) { + $queryParams['transactionId'] = $this->apiClient->getSerializer()->toQueryValue($transaction_id); } - if ($paymentMethodConfigurationId !== null) { - $queryParams['paymentMethodConfigurationId'] = $this->apiClient->getSerializer()->toQueryValue($paymentMethodConfigurationId); + if (!is_null($payment_method_configuration_id)) { + $queryParams['paymentMethodConfigurationId'] = $this->apiClient->getSerializer()->toQueryValue($payment_method_configuration_id); } // path params - $resourcePath = "/card-processing/processWith3DSecure"; + $resourcePath = '/card-processing/processWith3DSecure'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; - if (isset($cardData)) { - $tempBody = $cardData; + if (isset($card_data)) { + $tempBody = $card_data; } // for model (json/xml) @@ -294,24 +309,39 @@ public function processWith3DSecureWithHttpInfo($spaceId, $transactionId, $payme return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'string', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/ChargeAttemptService.php b/wallee-sdk/lib/Service/ChargeAttemptService.php index 1bdd539..f5c132c 100644 --- a/wallee-sdk/lib/Service/ChargeAttemptService.php +++ b/wallee-sdk/lib/Service/ChargeAttemptService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/charge-attempt/count"; + $resourcePath = '/charge-attempt/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the charge attempt which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ChargeAttempt */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -186,46 +197,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the charge attempt which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/charge-attempt/read"; + $resourcePath = '/charge-attempt/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -248,20 +259,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ChargeAttempt', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ChargeAttempt', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ChargeAttempt', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -271,15 +293,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the charge attempts which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ChargeAttempt[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -287,43 +309,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the charge attempts which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/charge-attempt/search"; + $resourcePath = '/charge-attempt/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -351,20 +373,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ChargeAttempt[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ChargeAttempt[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ChargeAttempt[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/ChargeFlowLevelService.php b/wallee-sdk/lib/Service/ChargeFlowLevelService.php index cfd8c8f..cb6a29d 100644 --- a/wallee-sdk/lib/Service/ChargeFlowLevelService.php +++ b/wallee-sdk/lib/Service/ChargeFlowLevelService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/charge-flow-level/count"; + $resourcePath = '/charge-flow-level/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the payment flow level which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ChargeFlowLevel */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -186,46 +197,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the payment flow level which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/charge-flow-level/read"; + $resourcePath = '/charge-flow-level/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -248,20 +259,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ChargeFlowLevel', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ChargeFlowLevel', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ChargeFlowLevel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -271,15 +293,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the payment flow levels which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ChargeFlowLevel[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -287,43 +309,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the payment flow levels which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/charge-flow-level/search"; + $resourcePath = '/charge-flow-level/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -351,20 +373,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ChargeFlowLevel[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ChargeFlowLevel[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ChargeFlowLevel[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -374,15 +407,15 @@ public function searchWithHttpInfo($spaceId, $query) { * * Send Payment Link * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the charge flow level whose payment link should be sent. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ChargeFlowLevel */ - public function sendMessage($spaceId, $id) { - return $this->sendMessageWithHttpInfo($spaceId, $id)->getData(); + public function sendMessage($space_id, $id) { + return $this->sendMessageWithHttpInfo($space_id, $id)->getData(); } /** @@ -390,46 +423,46 @@ public function sendMessage($spaceId, $id) { * * Send Payment Link * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the charge flow level whose payment link should be sent. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function sendMessageWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling sendMessage'); + public function sendMessageWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling sendMessage'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling sendMessage'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/charge-flow-level/sendMessage"; + $resourcePath = '/charge-flow-level/sendMessage'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -452,20 +485,31 @@ public function sendMessageWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ChargeFlowLevel', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ChargeFlowLevel', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ChargeFlowLevel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/ChargeFlowService.php b/wallee-sdk/lib/Service/ChargeFlowService.php index 06dab09..e8ae4e9 100644 --- a/wallee-sdk/lib/Service/ChargeFlowService.php +++ b/wallee-sdk/lib/Service/ChargeFlowService.php @@ -1,10 +1,8 @@ applyFlowWithHttpInfo($spaceId, $id)->getData(); + public function applyFlow($space_id, $id) { + return $this->applyFlowWithHttpInfo($space_id, $id)->getData(); } /** @@ -87,46 +87,46 @@ public function applyFlow($spaceId, $id) { * * applyFlow * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The transaction id of the transaction which should be process asynchronously. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function applyFlowWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling applyFlow'); + public function applyFlowWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling applyFlow'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling applyFlow'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/charge-flow/applyFlow"; + $resourcePath = '/charge-flow/applyFlow'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -149,20 +149,31 @@ public function applyFlowWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Transaction', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Transaction', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Transaction', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -172,15 +183,15 @@ public function applyFlowWithHttpInfo($spaceId, $id) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return int */ - public function count($spaceId, $filter = null) { - return $this->countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -188,39 +199,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/charge-flow/count"; + $resourcePath = '/charge-flow/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -248,20 +259,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -271,15 +293,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the charge flow which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ChargeFlow */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -287,46 +309,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the charge flow which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/charge-flow/read"; + $resourcePath = '/charge-flow/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -349,20 +371,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ChargeFlow', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ChargeFlow', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ChargeFlow', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -372,15 +405,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the charge flows which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ChargeFlow[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -388,43 +421,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the charge flows which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/charge-flow/search"; + $resourcePath = '/charge-flow/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -452,20 +485,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ChargeFlow[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ChargeFlow[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ChargeFlow[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -475,8 +519,8 @@ public function searchWithHttpInfo($spaceId, $query) { * * updateRecipient * - * @param int $spaceId (required) - * @param int $transactionId The transaction id of the transaction whose recipient should be updated. (required) + * @param int $space_id (required) + * @param int $transaction_id The transaction id of the transaction whose recipient should be updated. (required) * @param int $type The id of the charge flow configuration type to recipient should be updated for. (required) * @param string $recipient The recipient address that should be used to send the payment URL. (required) * @throws \Wallee\Sdk\ApiException @@ -484,8 +528,8 @@ public function searchWithHttpInfo($spaceId, $query) { * @throws \Wallee\Sdk\Http\ConnectionException * @return void */ - public function updateRecipient($spaceId, $transactionId, $type, $recipient) { - return $this->updateRecipientWithHttpInfo($spaceId, $transactionId, $type, $recipient)->getData(); + public function updateRecipient($space_id, $transaction_id, $type, $recipient) { + return $this->updateRecipientWithHttpInfo($space_id, $transaction_id, $type, $recipient)->getData(); } /** @@ -493,8 +537,8 @@ public function updateRecipient($spaceId, $transactionId, $type, $recipient) { * * updateRecipient * - * @param int $spaceId (required) - * @param int $transactionId The transaction id of the transaction whose recipient should be updated. (required) + * @param int $space_id (required) + * @param int $transaction_id The transaction id of the transaction whose recipient should be updated. (required) * @param int $type The id of the charge flow configuration type to recipient should be updated for. (required) * @param string $recipient The recipient address that should be used to send the payment URL. (required) * @throws \Wallee\Sdk\ApiException @@ -502,53 +546,53 @@ public function updateRecipient($spaceId, $transactionId, $type, $recipient) { * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function updateRecipientWithHttpInfo($spaceId, $transactionId, $type, $recipient) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling updateRecipient'); + public function updateRecipientWithHttpInfo($space_id, $transaction_id, $type, $recipient) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling updateRecipient'); } - // verify the required parameter 'transactionId' is set - if ($transactionId === null) { - throw new \InvalidArgumentException('Missing the required parameter $transactionId when calling updateRecipient'); + // verify the required parameter 'transaction_id' is set + if (is_null($transaction_id)) { + throw new \InvalidArgumentException('Missing the required parameter $transaction_id when calling updateRecipient'); } // verify the required parameter 'type' is set - if ($type === null) { + if (is_null($type)) { throw new \InvalidArgumentException('Missing the required parameter $type when calling updateRecipient'); } // verify the required parameter 'recipient' is set - if ($recipient === null) { + if (is_null($recipient)) { throw new \InvalidArgumentException('Missing the required parameter $recipient when calling updateRecipient'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($transactionId !== null) { - $queryParams['transactionId'] = $this->apiClient->getSerializer()->toQueryValue($transactionId); + if (!is_null($transaction_id)) { + $queryParams['transactionId'] = $this->apiClient->getSerializer()->toQueryValue($transaction_id); } - if ($type !== null) { + if (!is_null($type)) { $queryParams['type'] = $this->apiClient->getSerializer()->toQueryValue($type); } - if ($recipient !== null) { + if (!is_null($recipient)) { $queryParams['recipient'] = $this->apiClient->getSerializer()->toQueryValue($recipient); } // path params - $resourcePath = "/charge-flow/updateRecipient"; + $resourcePath = '/charge-flow/updateRecipient'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -571,20 +615,31 @@ public function updateRecipientWithHttpInfo($spaceId, $transactionId, $type, $re return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/ConditionTypeService.php b/wallee-sdk/lib/Service/ConditionTypeService.php index 360ea8d..ad3de2a 100644 --- a/wallee-sdk/lib/Service/ConditionTypeService.php +++ b/wallee-sdk/lib/Service/ConditionTypeService.php @@ -1,10 +1,8 @@ apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/condition-type/all"; + $resourcePath = '/condition-type/all'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -131,20 +131,31 @@ public function allWithHttpInfo() { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ConditionType[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ConditionType[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ConditionType[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -177,30 +188,30 @@ public function read($id) { */ public function readWithHttpInfo($id) { // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($id !== null) { + $queryParams = []; + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/condition-type/read"; + $resourcePath = '/condition-type/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -223,20 +234,31 @@ public function readWithHttpInfo($id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ConditionType', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ConditionType', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ConditionType', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/CountryService.php b/wallee-sdk/lib/Service/CountryService.php index 551cef9..e160927 100644 --- a/wallee-sdk/lib/Service/CountryService.php +++ b/wallee-sdk/lib/Service/CountryService.php @@ -1,10 +1,8 @@ apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/country/all"; + $resourcePath = '/country/all'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -131,20 +131,31 @@ public function allWithHttpInfo() { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\RestCountry[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\RestCountry[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\RestCountry[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/CountryStateService.php b/wallee-sdk/lib/Service/CountryStateService.php index 441f198..c51aa9d 100644 --- a/wallee-sdk/lib/Service/CountryStateService.php +++ b/wallee-sdk/lib/Service/CountryStateService.php @@ -1,10 +1,8 @@ apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/country-state/all"; + $resourcePath = '/country-state/all'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -131,20 +131,31 @@ public function allWithHttpInfo() { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\RestCountryState[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\RestCountryState[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\RestCountryState[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -177,30 +188,30 @@ public function country($code) { */ public function countryWithHttpInfo($code) { // verify the required parameter 'code' is set - if ($code === null) { + if (is_null($code)) { throw new \InvalidArgumentException('Missing the required parameter $code when calling country'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($code !== null) { + $queryParams = []; + if (!is_null($code)) { $queryParams['code'] = $this->apiClient->getSerializer()->toQueryValue($code); } // path params - $resourcePath = "/country-state/country"; + $resourcePath = '/country-state/country'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -223,20 +234,31 @@ public function countryWithHttpInfo($code) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\RestCountryState[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\RestCountryState[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\RestCountryState[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/CurrencyService.php b/wallee-sdk/lib/Service/CurrencyService.php index 6006f73..43f033b 100644 --- a/wallee-sdk/lib/Service/CurrencyService.php +++ b/wallee-sdk/lib/Service/CurrencyService.php @@ -1,10 +1,8 @@ apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/currency/all"; + $resourcePath = '/currency/all'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -131,20 +131,31 @@ public function allWithHttpInfo() { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\RestCurrency[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\RestCurrency[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\RestCurrency[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/CustomerAddressService.php b/wallee-sdk/lib/Service/CustomerAddressService.php new file mode 100644 index 0000000..30d9cb2 --- /dev/null +++ b/wallee-sdk/lib/Service/CustomerAddressService.php @@ -0,0 +1,867 @@ +apiClient = $apiClient; + } + + /** + * Returns the API client instance. + * + * @return ApiClient + */ + public function getApiClient() { + return $this->apiClient; + } + + + /** + * Operation count + * + * Count + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return int + */ + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); + } + + /** + * Operation countWithHttpInfo + * + * Count + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/customer-address/count'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($filter)) { + $tempBody = $filter; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + 'int', + '/customer-address/count' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation create + * + * Create + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\CustomerAddressCreate $entity The customer object which should be created. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\CustomerAddress + */ + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); + } + + /** + * Operation createWithHttpInfo + * + * Create + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\CustomerAddressCreate $entity The customer object which should be created. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); + } + // verify the required parameter 'entity' is set + if (is_null($entity)) { + throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/customer-address/create'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($entity)) { + $tempBody = $entity; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\CustomerAddress', + '/customer-address/create' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\CustomerAddress', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\CustomerAddress', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation delete + * + * Delete + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return void + */ + public function delete($space_id, $id) { + return $this->deleteWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation deleteWithHttpInfo + * + * Delete + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function deleteWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling delete'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/customer-address/delete'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($id)) { + $tempBody = $id; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + null, + '/customer-address/delete' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders()); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation read + * + * Read + * + * @param int $space_id (required) + * @param int $id The id of the customer which should be returned. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\CustomerAddress + */ + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation readWithHttpInfo + * + * Read + * + * @param int $space_id (required) + * @param int $id The id of the customer which should be returned. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/customer-address/read'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\CustomerAddress', + '/customer-address/read' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\CustomerAddress', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\CustomerAddress', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation search + * + * Search + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the customers which are returned by the search. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\CustomerAddress[] + */ + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); + } + + /** + * Operation searchWithHttpInfo + * + * Search + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the customers which are returned by the search. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); + } + // verify the required parameter 'query' is set + if (is_null($query)) { + throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/customer-address/search'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($query)) { + $tempBody = $query; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\CustomerAddress[]', + '/customer-address/search' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\CustomerAddress[]', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\CustomerAddress[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation selectDefaultAddress + * + * selectDefaultAddress + * + * @param int $space_id (required) + * @param int $id The id of the customer address to set as default. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return void + */ + public function selectDefaultAddress($space_id, $id) { + return $this->selectDefaultAddressWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation selectDefaultAddressWithHttpInfo + * + * selectDefaultAddress + * + * @param int $space_id (required) + * @param int $id The id of the customer address to set as default. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function selectDefaultAddressWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling selectDefaultAddress'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling selectDefaultAddress'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/customer-address/select-default-address'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + null, + '/customer-address/select-default-address' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders()); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation update + * + * Update + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\CustomerAddressActive $entity The customer object with the properties which should be updated. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\CustomerAddress + */ + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); + } + + /** + * Operation updateWithHttpInfo + * + * Update + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\CustomerAddressActive $entity The customer object with the properties which should be updated. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); + } + // verify the required parameter 'entity' is set + if (is_null($entity)) { + throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/customer-address/update'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($entity)) { + $tempBody = $entity; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\CustomerAddress', + '/customer-address/update' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\CustomerAddress', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\CustomerAddress', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + +} diff --git a/wallee-sdk/lib/Service/CustomerCommentService.php b/wallee-sdk/lib/Service/CustomerCommentService.php new file mode 100644 index 0000000..5ac32d8 --- /dev/null +++ b/wallee-sdk/lib/Service/CustomerCommentService.php @@ -0,0 +1,979 @@ +apiClient = $apiClient; + } + + /** + * Returns the API client instance. + * + * @return ApiClient + */ + public function getApiClient() { + return $this->apiClient; + } + + + /** + * Operation count + * + * Count + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return int + */ + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); + } + + /** + * Operation countWithHttpInfo + * + * Count + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/customer-comment/count'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($filter)) { + $tempBody = $filter; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + 'int', + '/customer-comment/count' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation create + * + * Create + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\CustomerCommentCreate $entity The customer object which should be created. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\CustomerComment + */ + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); + } + + /** + * Operation createWithHttpInfo + * + * Create + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\CustomerCommentCreate $entity The customer object which should be created. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); + } + // verify the required parameter 'entity' is set + if (is_null($entity)) { + throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/customer-comment/create'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($entity)) { + $tempBody = $entity; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\CustomerComment', + '/customer-comment/create' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\CustomerComment', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\CustomerComment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation delete + * + * Delete + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return void + */ + public function delete($space_id, $id) { + return $this->deleteWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation deleteWithHttpInfo + * + * Delete + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function deleteWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling delete'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/customer-comment/delete'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($id)) { + $tempBody = $id; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + null, + '/customer-comment/delete' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders()); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation pinComment + * + * pinComment + * + * @param int $space_id (required) + * @param int $id The id of the customer comment to pin to the top. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return void + */ + public function pinComment($space_id, $id) { + return $this->pinCommentWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation pinCommentWithHttpInfo + * + * pinComment + * + * @param int $space_id (required) + * @param int $id The id of the customer comment to pin to the top. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function pinCommentWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling pinComment'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling pinComment'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/customer-comment/pin-comment'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + null, + '/customer-comment/pin-comment' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders()); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation read + * + * Read + * + * @param int $space_id (required) + * @param int $id The id of the customer which should be returned. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\CustomerComment + */ + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation readWithHttpInfo + * + * Read + * + * @param int $space_id (required) + * @param int $id The id of the customer which should be returned. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/customer-comment/read'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\CustomerComment', + '/customer-comment/read' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\CustomerComment', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\CustomerComment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation search + * + * Search + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the customers which are returned by the search. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\CustomerComment[] + */ + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); + } + + /** + * Operation searchWithHttpInfo + * + * Search + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the customers which are returned by the search. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); + } + // verify the required parameter 'query' is set + if (is_null($query)) { + throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/customer-comment/search'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($query)) { + $tempBody = $query; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\CustomerComment[]', + '/customer-comment/search' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\CustomerComment[]', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\CustomerComment[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation unpinComment + * + * unpinComment + * + * @param int $space_id (required) + * @param int $id The id of the customer comment to unpin. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return void + */ + public function unpinComment($space_id, $id) { + return $this->unpinCommentWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation unpinCommentWithHttpInfo + * + * unpinComment + * + * @param int $space_id (required) + * @param int $id The id of the customer comment to unpin. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function unpinCommentWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling unpinComment'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling unpinComment'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/customer-comment/unpin-comment'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + null, + '/customer-comment/unpin-comment' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders()); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation update + * + * Update + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\CustomerCommentActive $entity The customer object with the properties which should be updated. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\CustomerComment + */ + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); + } + + /** + * Operation updateWithHttpInfo + * + * Update + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\CustomerCommentActive $entity The customer object with the properties which should be updated. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); + } + // verify the required parameter 'entity' is set + if (is_null($entity)) { + throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/customer-comment/update'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($entity)) { + $tempBody = $entity; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\CustomerComment', + '/customer-comment/update' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\CustomerComment', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\CustomerComment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + +} diff --git a/wallee-sdk/lib/Service/CustomerService.php b/wallee-sdk/lib/Service/CustomerService.php new file mode 100644 index 0000000..5a12b51 --- /dev/null +++ b/wallee-sdk/lib/Service/CustomerService.php @@ -0,0 +1,755 @@ +apiClient = $apiClient; + } + + /** + * Returns the API client instance. + * + * @return ApiClient + */ + public function getApiClient() { + return $this->apiClient; + } + + + /** + * Operation count + * + * Count + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return int + */ + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); + } + + /** + * Operation countWithHttpInfo + * + * Count + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/customer/count'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($filter)) { + $tempBody = $filter; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + 'int', + '/customer/count' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation create + * + * Create + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\CustomerCreate $entity The customer object which should be created. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\Customer + */ + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); + } + + /** + * Operation createWithHttpInfo + * + * Create + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\CustomerCreate $entity The customer object which should be created. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); + } + // verify the required parameter 'entity' is set + if (is_null($entity)) { + throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/customer/create'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($entity)) { + $tempBody = $entity; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\Customer', + '/customer/create' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Customer', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Customer', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation delete + * + * Delete + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return void + */ + public function delete($space_id, $id) { + return $this->deleteWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation deleteWithHttpInfo + * + * Delete + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function deleteWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling delete'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/customer/delete'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($id)) { + $tempBody = $id; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + null, + '/customer/delete' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders()); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation read + * + * Read + * + * @param int $space_id (required) + * @param int $id The id of the customer which should be returned. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\Customer + */ + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation readWithHttpInfo + * + * Read + * + * @param int $space_id (required) + * @param int $id The id of the customer which should be returned. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/customer/read'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\Customer', + '/customer/read' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Customer', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Customer', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation search + * + * Search + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the customers which are returned by the search. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\Customer[] + */ + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); + } + + /** + * Operation searchWithHttpInfo + * + * Search + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the customers which are returned by the search. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); + } + // verify the required parameter 'query' is set + if (is_null($query)) { + throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/customer/search'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($query)) { + $tempBody = $query; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\Customer[]', + '/customer/search' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Customer[]', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Customer[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation update + * + * Update + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\CustomerActive $entity The customer object with the properties which should be updated. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\Customer + */ + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); + } + + /** + * Operation updateWithHttpInfo + * + * Update + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\CustomerActive $entity The customer object with the properties which should be updated. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); + } + // verify the required parameter 'entity' is set + if (is_null($entity)) { + throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/customer/update'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($entity)) { + $tempBody = $entity; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\Customer', + '/customer/update' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Customer', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Customer', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + +} diff --git a/wallee-sdk/lib/Service/DebtCollectionCaseService.php b/wallee-sdk/lib/Service/DebtCollectionCaseService.php index 684d09f..37a5db4 100644 --- a/wallee-sdk/lib/Service/DebtCollectionCaseService.php +++ b/wallee-sdk/lib/Service/DebtCollectionCaseService.php @@ -1,10 +1,8 @@ addCollectedAmountWithHttpInfo($spaceId, $id, $collectedAmount, $externalId)->getData(); + public function addCollectedAmount($space_id, $id, $collected_amount, $external_id) { + return $this->addCollectedAmountWithHttpInfo($space_id, $id, $collected_amount, $external_id)->getData(); } /** @@ -89,62 +89,62 @@ public function addCollectedAmount($spaceId, $id, $collectedAmount, $externalId) * * Add Collected Amount * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the debt collection case for which the amount should be added. (required) - * @param float $collectedAmount The amount that has been collected. (required) - * @param string $externalId The unique external id of this payment receipt. (required) + * @param float $collected_amount The amount that has been collected. (required) + * @param string $external_id The unique external id of this payment receipt. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function addCollectedAmountWithHttpInfo($spaceId, $id, $collectedAmount, $externalId) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling addCollectedAmount'); + public function addCollectedAmountWithHttpInfo($space_id, $id, $collected_amount, $external_id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling addCollectedAmount'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling addCollectedAmount'); } - // verify the required parameter 'collectedAmount' is set - if ($collectedAmount === null) { - throw new \InvalidArgumentException('Missing the required parameter $collectedAmount when calling addCollectedAmount'); + // verify the required parameter 'collected_amount' is set + if (is_null($collected_amount)) { + throw new \InvalidArgumentException('Missing the required parameter $collected_amount when calling addCollectedAmount'); } - // verify the required parameter 'externalId' is set - if ($externalId === null) { - throw new \InvalidArgumentException('Missing the required parameter $externalId when calling addCollectedAmount'); + // verify the required parameter 'external_id' is set + if (is_null($external_id)) { + throw new \InvalidArgumentException('Missing the required parameter $external_id when calling addCollectedAmount'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array()); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept([]); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } - if ($collectedAmount !== null) { - $queryParams['collectedAmount'] = $this->apiClient->getSerializer()->toQueryValue($collectedAmount); + if (!is_null($collected_amount)) { + $queryParams['collectedAmount'] = $this->apiClient->getSerializer()->toQueryValue($collected_amount); } - if ($externalId !== null) { - $queryParams['externalId'] = $this->apiClient->getSerializer()->toQueryValue($externalId); + if (!is_null($external_id)) { + $queryParams['externalId'] = $this->apiClient->getSerializer()->toQueryValue($external_id); } // path params - $resourcePath = "/debt-collection-case/addCollectedAmount"; + $resourcePath = '/debt-collection-case/addCollectedAmount'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -167,24 +167,39 @@ public function addCollectedAmountWithHttpInfo($spaceId, $id, $collectedAmount, return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\DebtCollectionReceipt', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\DebtCollectionReceipt', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\DebtCollectionReceipt', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -194,17 +209,17 @@ public function addCollectedAmountWithHttpInfo($spaceId, $id, $collectedAmount, * * Attach Document * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the debt collection case. (required) - * @param string $fileName The file name of the document that is uploaded. (required) - * @param string $contentBase64 The BASE64 encoded contents of the document. (required) + * @param string $file_name The file name of the document that is uploaded. (required) + * @param string $content_base64 The BASE64 encoded contents of the document. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\DebtCollectionCaseDocument */ - public function attachDocument($spaceId, $id, $fileName, $contentBase64) { - return $this->attachDocumentWithHttpInfo($spaceId, $id, $fileName, $contentBase64)->getData(); + public function attachDocument($space_id, $id, $file_name, $content_base64) { + return $this->attachDocumentWithHttpInfo($space_id, $id, $file_name, $content_base64)->getData(); } /** @@ -212,62 +227,62 @@ public function attachDocument($spaceId, $id, $fileName, $contentBase64) { * * Attach Document * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the debt collection case. (required) - * @param string $fileName The file name of the document that is uploaded. (required) - * @param string $contentBase64 The BASE64 encoded contents of the document. (required) + * @param string $file_name The file name of the document that is uploaded. (required) + * @param string $content_base64 The BASE64 encoded contents of the document. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function attachDocumentWithHttpInfo($spaceId, $id, $fileName, $contentBase64) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling attachDocument'); + public function attachDocumentWithHttpInfo($space_id, $id, $file_name, $content_base64) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling attachDocument'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling attachDocument'); } - // verify the required parameter 'fileName' is set - if ($fileName === null) { - throw new \InvalidArgumentException('Missing the required parameter $fileName when calling attachDocument'); + // verify the required parameter 'file_name' is set + if (is_null($file_name)) { + throw new \InvalidArgumentException('Missing the required parameter $file_name when calling attachDocument'); } - // verify the required parameter 'contentBase64' is set - if ($contentBase64 === null) { - throw new \InvalidArgumentException('Missing the required parameter $contentBase64 when calling attachDocument'); + // verify the required parameter 'content_base64' is set + if (is_null($content_base64)) { + throw new \InvalidArgumentException('Missing the required parameter $content_base64 when calling attachDocument'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array()); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept([]); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } - if ($fileName !== null) { - $queryParams['fileName'] = $this->apiClient->getSerializer()->toQueryValue($fileName); + if (!is_null($file_name)) { + $queryParams['fileName'] = $this->apiClient->getSerializer()->toQueryValue($file_name); } - if ($contentBase64 !== null) { - $queryParams['contentBase64'] = $this->apiClient->getSerializer()->toQueryValue($contentBase64); + if (!is_null($content_base64)) { + $queryParams['contentBase64'] = $this->apiClient->getSerializer()->toQueryValue($content_base64); } // path params - $resourcePath = "/debt-collection-case/attachDocument"; + $resourcePath = '/debt-collection-case/attachDocument'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -290,24 +305,39 @@ public function attachDocumentWithHttpInfo($spaceId, $id, $fileName, $contentBas return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\DebtCollectionCaseDocument', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\DebtCollectionCaseDocument', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\DebtCollectionCaseDocument', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -317,15 +347,15 @@ public function attachDocumentWithHttpInfo($spaceId, $id, $fileName, $contentBas * * Close * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the debt collection case which should be closed. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\DebtCollectionCase */ - public function close($spaceId, $id) { - return $this->closeWithHttpInfo($spaceId, $id)->getData(); + public function close($space_id, $id) { + return $this->closeWithHttpInfo($space_id, $id)->getData(); } /** @@ -333,46 +363,46 @@ public function close($spaceId, $id) { * * Close * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the debt collection case which should be closed. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function closeWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling close'); + public function closeWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling close'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling close'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array()); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept([]); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/debt-collection-case/close"; + $resourcePath = '/debt-collection-case/close'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -395,24 +425,39 @@ public function closeWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\DebtCollectionCase', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\DebtCollectionCase', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\DebtCollectionCase', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -422,15 +467,15 @@ public function closeWithHttpInfo($spaceId, $id) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return int */ - public function count($spaceId, $filter = null) { - return $this->countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -438,39 +483,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/debt-collection-case/count"; + $resourcePath = '/debt-collection-case/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -498,20 +543,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -521,15 +577,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\DebtCollectionCaseCreate $entity The debt collection case object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\DebtCollectionCase */ - public function create($spaceId, $entity) { - return $this->createWithHttpInfo($spaceId, $entity)->getData(); + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); } /** @@ -537,43 +593,43 @@ public function create($spaceId, $entity) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\DebtCollectionCaseCreate $entity The debt collection case object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/debt-collection-case/create"; + $resourcePath = '/debt-collection-case/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -601,20 +657,31 @@ public function createWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\DebtCollectionCase', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\DebtCollectionCase', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\DebtCollectionCase', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -624,15 +691,15 @@ public function createWithHttpInfo($spaceId, $entity) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return void */ - public function delete($spaceId, $id) { - return $this->deleteWithHttpInfo($spaceId, $id)->getData(); + public function delete($space_id, $id) { + return $this->deleteWithHttpInfo($space_id, $id)->getData(); } /** @@ -640,43 +707,43 @@ public function delete($spaceId, $id) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function deleteWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling delete'); + public function deleteWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling delete'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/debt-collection-case/delete"; + $resourcePath = '/debt-collection-case/delete'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($id)) { @@ -704,20 +771,31 @@ public function deleteWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -727,15 +805,15 @@ public function deleteWithHttpInfo($spaceId, $id) { * * Documents * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the debt collection case for which the attached documents are returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\DebtCollectionCaseDocument[] */ - public function documents($spaceId, $id) { - return $this->documentsWithHttpInfo($spaceId, $id)->getData(); + public function documents($space_id, $id) { + return $this->documentsWithHttpInfo($space_id, $id)->getData(); } /** @@ -743,46 +821,46 @@ public function documents($spaceId, $id) { * * Documents * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the debt collection case for which the attached documents are returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function documentsWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling documents'); + public function documentsWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling documents'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling documents'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array()); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept([]); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/debt-collection-case/documents"; + $resourcePath = '/debt-collection-case/documents'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -805,24 +883,39 @@ public function documentsWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\DebtCollectionCaseDocument[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\DebtCollectionCaseDocument[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\DebtCollectionCaseDocument[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -832,15 +925,15 @@ public function documentsWithHttpInfo($spaceId, $id) { * * Mark Case As Prepared * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the debt collection case which should be marked as prepared. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\DebtCollectionCase */ - public function markAsPrepared($spaceId, $id) { - return $this->markAsPreparedWithHttpInfo($spaceId, $id)->getData(); + public function markAsPrepared($space_id, $id) { + return $this->markAsPreparedWithHttpInfo($space_id, $id)->getData(); } /** @@ -848,46 +941,46 @@ public function markAsPrepared($spaceId, $id) { * * Mark Case As Prepared * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the debt collection case which should be marked as prepared. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function markAsPreparedWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling markAsPrepared'); + public function markAsPreparedWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling markAsPrepared'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling markAsPrepared'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array()); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept([]); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/debt-collection-case/markAsPrepared"; + $resourcePath = '/debt-collection-case/markAsPrepared'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -910,24 +1003,39 @@ public function markAsPreparedWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\DebtCollectionCase', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\DebtCollectionCase', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\DebtCollectionCase', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -937,15 +1045,15 @@ public function markAsPreparedWithHttpInfo($spaceId, $id) { * * Mark Case As Reviewed * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the debt collection case which should be reviewed. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\DebtCollectionCase */ - public function markAsReviewed($spaceId, $id) { - return $this->markAsReviewedWithHttpInfo($spaceId, $id)->getData(); + public function markAsReviewed($space_id, $id) { + return $this->markAsReviewedWithHttpInfo($space_id, $id)->getData(); } /** @@ -953,46 +1061,46 @@ public function markAsReviewed($spaceId, $id) { * * Mark Case As Reviewed * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the debt collection case which should be reviewed. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function markAsReviewedWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling markAsReviewed'); + public function markAsReviewedWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling markAsReviewed'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling markAsReviewed'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array()); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept([]); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/debt-collection-case/markAsReviewed"; + $resourcePath = '/debt-collection-case/markAsReviewed'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -1015,24 +1123,39 @@ public function markAsReviewedWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\DebtCollectionCase', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\DebtCollectionCase', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\DebtCollectionCase', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1042,15 +1165,15 @@ public function markAsReviewedWithHttpInfo($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the debt collection case which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\DebtCollectionCase */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -1058,46 +1181,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the debt collection case which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/debt-collection-case/read"; + $resourcePath = '/debt-collection-case/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -1120,20 +1243,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\DebtCollectionCase', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\DebtCollectionCase', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\DebtCollectionCase', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1143,15 +1277,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the cases which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\DebtCollectionCase[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -1159,43 +1293,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the cases which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/debt-collection-case/search"; + $resourcePath = '/debt-collection-case/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -1223,20 +1357,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\DebtCollectionCase[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\DebtCollectionCase[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\DebtCollectionCase[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1246,15 +1391,15 @@ public function searchWithHttpInfo($spaceId, $query) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\DebtCollectionCaseUpdate $entity The object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\DebtCollectionCase */ - public function update($spaceId, $entity) { - return $this->updateWithHttpInfo($spaceId, $entity)->getData(); + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); } /** @@ -1262,43 +1407,43 @@ public function update($spaceId, $entity) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\DebtCollectionCaseUpdate $entity The object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function updateWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling update'); + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/debt-collection-case/update"; + $resourcePath = '/debt-collection-case/update'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -1326,24 +1471,39 @@ public function updateWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\DebtCollectionCase', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\DebtCollectionCase', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\DebtCollectionCase', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/DebtCollectorConfigurationService.php b/wallee-sdk/lib/Service/DebtCollectorConfigurationService.php index ee79bb8..d6cf45c 100644 --- a/wallee-sdk/lib/Service/DebtCollectorConfigurationService.php +++ b/wallee-sdk/lib/Service/DebtCollectorConfigurationService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/debt-collector-configuration/count"; + $resourcePath = '/debt-collector-configuration/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the debt collector configuration which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\DebtCollectorConfiguration */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -186,46 +197,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the debt collector configuration which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/debt-collector-configuration/read"; + $resourcePath = '/debt-collector-configuration/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -248,20 +259,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\DebtCollectorConfiguration', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\DebtCollectorConfiguration', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\DebtCollectorConfiguration', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -271,15 +293,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the debt collector configuration which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\DebtCollectorConfiguration[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -287,43 +309,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the debt collector configuration which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/debt-collector-configuration/search"; + $resourcePath = '/debt-collector-configuration/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -351,20 +373,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\DebtCollectorConfiguration[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\DebtCollectorConfiguration[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\DebtCollectorConfiguration[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/DebtCollectorService.php b/wallee-sdk/lib/Service/DebtCollectorService.php index 92fae69..b8c1f04 100644 --- a/wallee-sdk/lib/Service/DebtCollectorService.php +++ b/wallee-sdk/lib/Service/DebtCollectorService.php @@ -1,10 +1,8 @@ apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/debt-collector/all"; + $resourcePath = '/debt-collector/all'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -131,20 +131,31 @@ public function allWithHttpInfo() { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\DebtCollector[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\DebtCollector[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\DebtCollector[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -177,30 +188,30 @@ public function read($id) { */ public function readWithHttpInfo($id) { // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($id !== null) { + $queryParams = []; + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/debt-collector/read"; + $resourcePath = '/debt-collector/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -223,20 +234,31 @@ public function readWithHttpInfo($id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\DebtCollector', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\DebtCollector', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\DebtCollector', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/DeliveryIndicationService.php b/wallee-sdk/lib/Service/DeliveryIndicationService.php index 9f8ce26..1d66fd4 100644 --- a/wallee-sdk/lib/Service/DeliveryIndicationService.php +++ b/wallee-sdk/lib/Service/DeliveryIndicationService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/delivery-indication/count"; + $resourcePath = '/delivery-indication/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * markAsNotSuitable * - * @param int $spaceId (required) - * @param int $deliveryIndicationId The delivery indication id which should be marked as not suitable. (required) + * @param int $space_id (required) + * @param int $delivery_indication_id The delivery indication id which should be marked as not suitable. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\DeliveryIndication */ - public function markAsNotSuitable($spaceId, $deliveryIndicationId) { - return $this->markAsNotSuitableWithHttpInfo($spaceId, $deliveryIndicationId)->getData(); + public function markAsNotSuitable($space_id, $delivery_indication_id) { + return $this->markAsNotSuitableWithHttpInfo($space_id, $delivery_indication_id)->getData(); } /** @@ -186,47 +197,47 @@ public function markAsNotSuitable($spaceId, $deliveryIndicationId) { * * markAsNotSuitable * - * @param int $spaceId (required) - * @param int $deliveryIndicationId The delivery indication id which should be marked as not suitable. (required) + * @param int $space_id (required) + * @param int $delivery_indication_id The delivery indication id which should be marked as not suitable. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function markAsNotSuitableWithHttpInfo($spaceId, $deliveryIndicationId) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling markAsNotSuitable'); + public function markAsNotSuitableWithHttpInfo($space_id, $delivery_indication_id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling markAsNotSuitable'); } - // verify the required parameter 'deliveryIndicationId' is set - if ($deliveryIndicationId === null) { - throw new \InvalidArgumentException('Missing the required parameter $deliveryIndicationId when calling markAsNotSuitable'); + // verify the required parameter 'delivery_indication_id' is set + if (is_null($delivery_indication_id)) { + throw new \InvalidArgumentException('Missing the required parameter $delivery_indication_id when calling markAsNotSuitable'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/delivery-indication/markAsNotSuitable"; + $resourcePath = '/delivery-indication/markAsNotSuitable'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; - if (isset($deliveryIndicationId)) { - $tempBody = $deliveryIndicationId; + if (isset($delivery_indication_id)) { + $tempBody = $delivery_indication_id; } // for model (json/xml) @@ -250,20 +261,31 @@ public function markAsNotSuitableWithHttpInfo($spaceId, $deliveryIndicationId) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\DeliveryIndication', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\DeliveryIndication', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\DeliveryIndication', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -273,15 +295,15 @@ public function markAsNotSuitableWithHttpInfo($spaceId, $deliveryIndicationId) { * * markAsSuitable * - * @param int $spaceId (required) - * @param int $deliveryIndicationId The delivery indication id which should be marked as suitable. (required) + * @param int $space_id (required) + * @param int $delivery_indication_id The delivery indication id which should be marked as suitable. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\DeliveryIndication */ - public function markAsSuitable($spaceId, $deliveryIndicationId) { - return $this->markAsSuitableWithHttpInfo($spaceId, $deliveryIndicationId)->getData(); + public function markAsSuitable($space_id, $delivery_indication_id) { + return $this->markAsSuitableWithHttpInfo($space_id, $delivery_indication_id)->getData(); } /** @@ -289,47 +311,47 @@ public function markAsSuitable($spaceId, $deliveryIndicationId) { * * markAsSuitable * - * @param int $spaceId (required) - * @param int $deliveryIndicationId The delivery indication id which should be marked as suitable. (required) + * @param int $space_id (required) + * @param int $delivery_indication_id The delivery indication id which should be marked as suitable. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function markAsSuitableWithHttpInfo($spaceId, $deliveryIndicationId) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling markAsSuitable'); + public function markAsSuitableWithHttpInfo($space_id, $delivery_indication_id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling markAsSuitable'); } - // verify the required parameter 'deliveryIndicationId' is set - if ($deliveryIndicationId === null) { - throw new \InvalidArgumentException('Missing the required parameter $deliveryIndicationId when calling markAsSuitable'); + // verify the required parameter 'delivery_indication_id' is set + if (is_null($delivery_indication_id)) { + throw new \InvalidArgumentException('Missing the required parameter $delivery_indication_id when calling markAsSuitable'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/delivery-indication/markAsSuitable"; + $resourcePath = '/delivery-indication/markAsSuitable'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; - if (isset($deliveryIndicationId)) { - $tempBody = $deliveryIndicationId; + if (isset($delivery_indication_id)) { + $tempBody = $delivery_indication_id; } // for model (json/xml) @@ -353,20 +375,31 @@ public function markAsSuitableWithHttpInfo($spaceId, $deliveryIndicationId) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\DeliveryIndication', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\DeliveryIndication', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\DeliveryIndication', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -376,15 +409,15 @@ public function markAsSuitableWithHttpInfo($spaceId, $deliveryIndicationId) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the delivery indication which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\DeliveryIndication */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -392,46 +425,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the delivery indication which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/delivery-indication/read"; + $resourcePath = '/delivery-indication/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -454,20 +487,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\DeliveryIndication', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\DeliveryIndication', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\DeliveryIndication', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -477,15 +521,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the delivery indications which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\DeliveryIndication[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -493,43 +537,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the delivery indications which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/delivery-indication/search"; + $resourcePath = '/delivery-indication/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -557,20 +601,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\DeliveryIndication[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\DeliveryIndication[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\DeliveryIndication[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/DocumentTemplateService.php b/wallee-sdk/lib/Service/DocumentTemplateService.php index b527703..412baac 100644 --- a/wallee-sdk/lib/Service/DocumentTemplateService.php +++ b/wallee-sdk/lib/Service/DocumentTemplateService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/document-template/count"; + $resourcePath = '/document-template/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the document template which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\DocumentTemplate */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -186,46 +197,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the document template which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/document-template/read"; + $resourcePath = '/document-template/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -248,20 +259,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\DocumentTemplate', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\DocumentTemplate', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\DocumentTemplate', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -271,15 +293,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the document templates which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\DocumentTemplate[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -287,43 +309,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the document templates which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/document-template/search"; + $resourcePath = '/document-template/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -351,20 +373,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\DocumentTemplate[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\DocumentTemplate[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\DocumentTemplate[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/DocumentTemplateTypeService.php b/wallee-sdk/lib/Service/DocumentTemplateTypeService.php index 1504684..e1e4229 100644 --- a/wallee-sdk/lib/Service/DocumentTemplateTypeService.php +++ b/wallee-sdk/lib/Service/DocumentTemplateTypeService.php @@ -1,10 +1,8 @@ apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/document-template-type/all"; + $resourcePath = '/document-template-type/all'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -131,20 +131,31 @@ public function allWithHttpInfo() { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\DocumentTemplateType[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\DocumentTemplateType[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\DocumentTemplateType[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -177,30 +188,30 @@ public function read($id) { */ public function readWithHttpInfo($id) { // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($id !== null) { + $queryParams = []; + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/document-template-type/read"; + $resourcePath = '/document-template-type/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -223,20 +234,31 @@ public function readWithHttpInfo($id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\DocumentTemplateType', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\DocumentTemplateType', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\DocumentTemplateType', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/EmailSenderService.php b/wallee-sdk/lib/Service/EmailSenderService.php deleted file mode 100644 index dce1c3b..0000000 --- a/wallee-sdk/lib/Service/EmailSenderService.php +++ /dev/null @@ -1,365 +0,0 @@ -apiClient = $apiClient; - } - - /** - * Returns the API client instance. - * - * @return ApiClient - */ - public function getApiClient() { - return $this->apiClient; - } - - - /** - * Operation count - * - * Count - * - * @param int $spaceId (required) - * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the email senders which are used to calculate the count. (required) - * @throws \Wallee\Sdk\ApiException - * @return int - */ - public function count($spaceId, $filter) { - return $this->countWithHttpInfo($spaceId, $filter)->getData(); - } - - /** - * Operation countWithHttpInfo - * - * Count - * - * @param int $spaceId (required) - * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the email senders which are used to calculate the count. (required) - * @throws \Wallee\Sdk\ApiException - * @return ApiResponse - */ - public function countWithHttpInfo($spaceId, $filter) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); - } - // verify the required parameter 'filter' is set - if ($filter === null) { - throw new \InvalidArgumentException('Missing the required parameter $filter when calling count'); - } - // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if (!is_null($headerAccept)) { - $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; - } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); - - // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); - } - - // path params - $resourcePath = "/email-sender/count"; - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - - // form params - $formParams = array(); - // body params - $tempBody = null; - if (isset($filter)) { - $tempBody = $filter; - } - - // for model (json/xml) - $httpBody = ''; - if (isset($tempBody)) { - $httpBody = $tempBody; // $tempBody is the method argument, if present - } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) - } - // make the API Call - try { - $response = $this->apiClient->callApi( - $resourcePath, - 'POST', - $queryParams, - $httpBody, - $headerParams, - 'int', - '/email-sender/count' - ); - return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - } - - throw $e; - } - } - - /** - * Operation read - * - * Read - * - * @param int $spaceId (required) - * @param int $id The id of the email sender which should be returned. (required) - * @throws \Wallee\Sdk\ApiException - * @return \Wallee\Sdk\Model\EmailSender - */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); - } - - /** - * Operation readWithHttpInfo - * - * Read - * - * @param int $spaceId (required) - * @param int $id The id of the email sender which should be returned. (required) - * @throws \Wallee\Sdk\ApiException - * @return ApiResponse - */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); - } - // verify the required parameter 'id' is set - if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); - } - // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('*/*')); - if (!is_null($headerAccept)) { - $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; - } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); - - // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); - } - if ($id !== null) { - $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); - } - - // path params - $resourcePath = "/email-sender/read"; - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - - // form params - $formParams = array(); - - // for model (json/xml) - $httpBody = ''; - if (isset($tempBody)) { - $httpBody = $tempBody; // $tempBody is the method argument, if present - } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) - } - // make the API Call - try { - $response = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\Wallee\Sdk\Model\EmailSender', - '/email-sender/read' - ); - return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\EmailSender', $response->getHeaders())); - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\EmailSender', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - } - - throw $e; - } - } - - /** - * Operation search - * - * Search - * - * @param int $spaceId (required) - * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the email senders which are returned by the search. (required) - * @throws \Wallee\Sdk\ApiException - * @return \Wallee\Sdk\Model\EmailSender[] - */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); - } - - /** - * Operation searchWithHttpInfo - * - * Search - * - * @param int $spaceId (required) - * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the email senders which are returned by the search. (required) - * @throws \Wallee\Sdk\ApiException - * @return ApiResponse - */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); - } - // verify the required parameter 'query' is set - if ($query === null) { - throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); - } - // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if (!is_null($headerAccept)) { - $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; - } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); - - // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); - } - - // path params - $resourcePath = "/email-sender/search"; - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - - // form params - $formParams = array(); - // body params - $tempBody = null; - if (isset($query)) { - $tempBody = $query; - } - - // for model (json/xml) - $httpBody = ''; - if (isset($tempBody)) { - $httpBody = $tempBody; // $tempBody is the method argument, if present - } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) - } - // make the API Call - try { - $response = $this->apiClient->callApi( - $resourcePath, - 'POST', - $queryParams, - $httpBody, - $headerParams, - '\Wallee\Sdk\Model\EmailSender[]', - '/email-sender/search' - ); - return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\EmailSender[]', $response->getHeaders())); - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\EmailSender[]', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - } - - throw $e; - } - } - -} diff --git a/wallee-sdk/lib/Service/EmailSenderTypeService.php b/wallee-sdk/lib/Service/EmailSenderTypeService.php deleted file mode 100644 index 2f6cd2c..0000000 --- a/wallee-sdk/lib/Service/EmailSenderTypeService.php +++ /dev/null @@ -1,237 +0,0 @@ -apiClient = $apiClient; - } - - /** - * Returns the API client instance. - * - * @return ApiClient - */ - public function getApiClient() { - return $this->apiClient; - } - - - /** - * Operation all - * - * All - * - * @throws \Wallee\Sdk\ApiException - * @return \Wallee\Sdk\Model\EmailSenderType[] - */ - public function all() { - return $this->allWithHttpInfo()->getData(); - } - - /** - * Operation allWithHttpInfo - * - * All - * - * @throws \Wallee\Sdk\ApiException - * @return ApiResponse - */ - public function allWithHttpInfo() { - // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('*/*')); - if (!is_null($headerAccept)) { - $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; - } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); - - // query params - $queryParams = array(); - - // path params - $resourcePath = "/email-sender-type/all"; - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - - // form params - $formParams = array(); - - // for model (json/xml) - $httpBody = ''; - if (isset($tempBody)) { - $httpBody = $tempBody; // $tempBody is the method argument, if present - } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) - } - // make the API Call - try { - $response = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\Wallee\Sdk\Model\EmailSenderType[]', - '/email-sender-type/all' - ); - return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\EmailSenderType[]', $response->getHeaders())); - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\EmailSenderType[]', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - } - - throw $e; - } - } - - /** - * Operation read - * - * Read - * - * @param int $id The id of the email sender type which should be returned. (required) - * @throws \Wallee\Sdk\ApiException - * @return \Wallee\Sdk\Model\EmailSenderType - */ - public function read($id) { - return $this->readWithHttpInfo($id)->getData(); - } - - /** - * Operation readWithHttpInfo - * - * Read - * - * @param int $id The id of the email sender type which should be returned. (required) - * @throws \Wallee\Sdk\ApiException - * @return ApiResponse - */ - public function readWithHttpInfo($id) { - // verify the required parameter 'id' is set - if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); - } - // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('*/*')); - if (!is_null($headerAccept)) { - $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; - } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); - - // query params - $queryParams = array(); - if ($id !== null) { - $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); - } - - // path params - $resourcePath = "/email-sender-type/read"; - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - - // form params - $formParams = array(); - - // for model (json/xml) - $httpBody = ''; - if (isset($tempBody)) { - $httpBody = $tempBody; // $tempBody is the method argument, if present - } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) - } - // make the API Call - try { - $response = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\Wallee\Sdk\Model\EmailSenderType', - '/email-sender-type/read' - ); - return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\EmailSenderType', $response->getHeaders())); - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\EmailSenderType', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - } - - throw $e; - } - } - -} diff --git a/wallee-sdk/lib/Service/EmailTemplateService.php b/wallee-sdk/lib/Service/EmailTemplateService.php deleted file mode 100644 index 577edb1..0000000 --- a/wallee-sdk/lib/Service/EmailTemplateService.php +++ /dev/null @@ -1,361 +0,0 @@ -apiClient = $apiClient; - } - - /** - * Returns the API client instance. - * - * @return ApiClient - */ - public function getApiClient() { - return $this->apiClient; - } - - - /** - * Operation count - * - * Count - * - * @param int $spaceId (required) - * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) - * @throws \Wallee\Sdk\ApiException - * @return int - */ - public function count($spaceId, $filter = null) { - return $this->countWithHttpInfo($spaceId, $filter)->getData(); - } - - /** - * Operation countWithHttpInfo - * - * Count - * - * @param int $spaceId (required) - * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) - * @throws \Wallee\Sdk\ApiException - * @return ApiResponse - */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); - } - // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if (!is_null($headerAccept)) { - $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; - } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); - - // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); - } - - // path params - $resourcePath = "/email-template/count"; - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - - // form params - $formParams = array(); - // body params - $tempBody = null; - if (isset($filter)) { - $tempBody = $filter; - } - - // for model (json/xml) - $httpBody = ''; - if (isset($tempBody)) { - $httpBody = $tempBody; // $tempBody is the method argument, if present - } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) - } - // make the API Call - try { - $response = $this->apiClient->callApi( - $resourcePath, - 'POST', - $queryParams, - $httpBody, - $headerParams, - 'int', - '/email-template/count' - ); - return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - } - - throw $e; - } - } - - /** - * Operation read - * - * Read - * - * @param int $spaceId (required) - * @param int $id The id of the email template which should be returned. (required) - * @throws \Wallee\Sdk\ApiException - * @return \Wallee\Sdk\Model\EmailTemplate - */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); - } - - /** - * Operation readWithHttpInfo - * - * Read - * - * @param int $spaceId (required) - * @param int $id The id of the email template which should be returned. (required) - * @throws \Wallee\Sdk\ApiException - * @return ApiResponse - */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); - } - // verify the required parameter 'id' is set - if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); - } - // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('*/*')); - if (!is_null($headerAccept)) { - $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; - } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); - - // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); - } - if ($id !== null) { - $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); - } - - // path params - $resourcePath = "/email-template/read"; - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - - // form params - $formParams = array(); - - // for model (json/xml) - $httpBody = ''; - if (isset($tempBody)) { - $httpBody = $tempBody; // $tempBody is the method argument, if present - } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) - } - // make the API Call - try { - $response = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\Wallee\Sdk\Model\EmailTemplate', - '/email-template/read' - ); - return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\EmailTemplate', $response->getHeaders())); - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\EmailTemplate', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - } - - throw $e; - } - } - - /** - * Operation search - * - * Search - * - * @param int $spaceId (required) - * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the email templates which are returned by the search. (required) - * @throws \Wallee\Sdk\ApiException - * @return \Wallee\Sdk\Model\EmailTemplate[] - */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); - } - - /** - * Operation searchWithHttpInfo - * - * Search - * - * @param int $spaceId (required) - * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the email templates which are returned by the search. (required) - * @throws \Wallee\Sdk\ApiException - * @return ApiResponse - */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); - } - // verify the required parameter 'query' is set - if ($query === null) { - throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); - } - // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if (!is_null($headerAccept)) { - $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; - } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); - - // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); - } - - // path params - $resourcePath = "/email-template/search"; - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - - // form params - $formParams = array(); - // body params - $tempBody = null; - if (isset($query)) { - $tempBody = $query; - } - - // for model (json/xml) - $httpBody = ''; - if (isset($tempBody)) { - $httpBody = $tempBody; // $tempBody is the method argument, if present - } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) - } - // make the API Call - try { - $response = $this->apiClient->callApi( - $resourcePath, - 'POST', - $queryParams, - $httpBody, - $headerParams, - '\Wallee\Sdk\Model\EmailTemplate[]', - '/email-template/search' - ); - return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\EmailTemplate[]', $response->getHeaders())); - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\EmailTemplate[]', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - } - - throw $e; - } - } - -} diff --git a/wallee-sdk/lib/Service/EmailTemplateTypeService.php b/wallee-sdk/lib/Service/EmailTemplateTypeService.php deleted file mode 100644 index 91bda57..0000000 --- a/wallee-sdk/lib/Service/EmailTemplateTypeService.php +++ /dev/null @@ -1,237 +0,0 @@ -apiClient = $apiClient; - } - - /** - * Returns the API client instance. - * - * @return ApiClient - */ - public function getApiClient() { - return $this->apiClient; - } - - - /** - * Operation all - * - * All - * - * @throws \Wallee\Sdk\ApiException - * @return \Wallee\Sdk\Model\EmailTemplateType[] - */ - public function all() { - return $this->allWithHttpInfo()->getData(); - } - - /** - * Operation allWithHttpInfo - * - * All - * - * @throws \Wallee\Sdk\ApiException - * @return ApiResponse - */ - public function allWithHttpInfo() { - // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('*/*')); - if (!is_null($headerAccept)) { - $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; - } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); - - // query params - $queryParams = array(); - - // path params - $resourcePath = "/email-template-type/all"; - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - - // form params - $formParams = array(); - - // for model (json/xml) - $httpBody = ''; - if (isset($tempBody)) { - $httpBody = $tempBody; // $tempBody is the method argument, if present - } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) - } - // make the API Call - try { - $response = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\Wallee\Sdk\Model\EmailTemplateType[]', - '/email-template-type/all' - ); - return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\EmailTemplateType[]', $response->getHeaders())); - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\EmailTemplateType[]', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - } - - throw $e; - } - } - - /** - * Operation read - * - * Read - * - * @param int $id The id of the email template type which should be returned. (required) - * @throws \Wallee\Sdk\ApiException - * @return \Wallee\Sdk\Model\EmailTemplateType - */ - public function read($id) { - return $this->readWithHttpInfo($id)->getData(); - } - - /** - * Operation readWithHttpInfo - * - * Read - * - * @param int $id The id of the email template type which should be returned. (required) - * @throws \Wallee\Sdk\ApiException - * @return ApiResponse - */ - public function readWithHttpInfo($id) { - // verify the required parameter 'id' is set - if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); - } - // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('*/*')); - if (!is_null($headerAccept)) { - $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; - } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); - - // query params - $queryParams = array(); - if ($id !== null) { - $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); - } - - // path params - $resourcePath = "/email-template-type/read"; - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - - // form params - $formParams = array(); - - // for model (json/xml) - $httpBody = ''; - if (isset($tempBody)) { - $httpBody = $tempBody; // $tempBody is the method argument, if present - } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) - } - // make the API Call - try { - $response = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\Wallee\Sdk\Model\EmailTemplateType', - '/email-template-type/read' - ); - return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\EmailTemplateType', $response->getHeaders())); - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\EmailTemplateType', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - } - - throw $e; - } - } - -} diff --git a/wallee-sdk/lib/Service/HumanUserService.php b/wallee-sdk/lib/Service/HumanUserService.php index 0c90794..ff23b48 100644 --- a/wallee-sdk/lib/Service/HumanUserService.php +++ b/wallee-sdk/lib/Service/HumanUserService.php @@ -1,10 +1,8 @@ apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/human-user/count"; + $resourcePath = '/human-user/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -138,20 +138,31 @@ public function countWithHttpInfo($filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -184,27 +195,27 @@ public function create($entity) { */ public function createWithHttpInfo($entity) { // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/human-user/create"; + $resourcePath = '/human-user/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -232,20 +243,31 @@ public function createWithHttpInfo($entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\HumanUser', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\HumanUser', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\HumanUser', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -278,27 +300,27 @@ public function delete($id) { */ public function deleteWithHttpInfo($id) { // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/human-user/delete"; + $resourcePath = '/human-user/delete'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($id)) { @@ -326,20 +348,31 @@ public function deleteWithHttpInfo($id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -372,27 +405,27 @@ public function export($request) { */ public function exportWithHttpInfo($request) { // verify the required parameter 'request' is set - if ($request === null) { + if (is_null($request)) { throw new \InvalidArgumentException('Missing the required parameter $request when calling export'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8', 'text/csv')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8', 'text/csv']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/human-user/export"; + $resourcePath = '/human-user/export'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($request)) { @@ -420,20 +453,31 @@ public function exportWithHttpInfo($request) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'string', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -466,30 +510,30 @@ public function read($id) { */ public function readWithHttpInfo($id) { // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($id !== null) { + $queryParams = []; + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/human-user/read"; + $resourcePath = '/human-user/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -512,20 +556,31 @@ public function readWithHttpInfo($id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\HumanUser', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\HumanUser', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\HumanUser', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -558,27 +613,27 @@ public function search($query) { */ public function searchWithHttpInfo($query) { // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/human-user/search"; + $resourcePath = '/human-user/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -606,20 +661,31 @@ public function searchWithHttpInfo($query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\HumanUser[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\HumanUser[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\HumanUser[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -652,27 +718,27 @@ public function update($entity) { */ public function updateWithHttpInfo($entity) { // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/human-user/update"; + $resourcePath = '/human-user/update'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -700,24 +766,39 @@ public function updateWithHttpInfo($entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\HumanUser', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\HumanUser', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\HumanUser', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/InstallmentPaymentService.php b/wallee-sdk/lib/Service/InstallmentPaymentService.php index 157c1a2..e60f8f2 100644 --- a/wallee-sdk/lib/Service/InstallmentPaymentService.php +++ b/wallee-sdk/lib/Service/InstallmentPaymentService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,43 +87,43 @@ public function count($spaceId, $filter) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the installment payment which are used to calculate the count. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // verify the required parameter 'filter' is set - if ($filter === null) { + if (is_null($filter)) { throw new \InvalidArgumentException('Missing the required parameter $filter when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/installment-payment/count"; + $resourcePath = '/installment-payment/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -151,20 +151,31 @@ public function countWithHttpInfo($spaceId, $filter) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -174,16 +185,16 @@ public function countWithHttpInfo($spaceId, $filter) { * * Create Installment Payment * - * @param int $spaceId (required) - * @param int $transactionId The transaction which should be converted into an installment payment. (required) - * @param int $installmentPlanConfiguration The installment plan configuration ID which should be applied on the transaction. (required) + * @param int $space_id (required) + * @param int $transaction_id The transaction which should be converted into an installment payment. (required) + * @param int $installment_plan_configuration The installment plan configuration ID which should be applied on the transaction. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\InstallmentPayment */ - public function createInstallmentPayment($spaceId, $transactionId, $installmentPlanConfiguration) { - return $this->createInstallmentPaymentWithHttpInfo($spaceId, $transactionId, $installmentPlanConfiguration)->getData(); + public function createInstallmentPayment($space_id, $transaction_id, $installment_plan_configuration) { + return $this->createInstallmentPaymentWithHttpInfo($space_id, $transaction_id, $installment_plan_configuration)->getData(); } /** @@ -191,54 +202,54 @@ public function createInstallmentPayment($spaceId, $transactionId, $installmentP * * Create Installment Payment * - * @param int $spaceId (required) - * @param int $transactionId The transaction which should be converted into an installment payment. (required) - * @param int $installmentPlanConfiguration The installment plan configuration ID which should be applied on the transaction. (required) + * @param int $space_id (required) + * @param int $transaction_id The transaction which should be converted into an installment payment. (required) + * @param int $installment_plan_configuration The installment plan configuration ID which should be applied on the transaction. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createInstallmentPaymentWithHttpInfo($spaceId, $transactionId, $installmentPlanConfiguration) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling createInstallmentPayment'); + public function createInstallmentPaymentWithHttpInfo($space_id, $transaction_id, $installment_plan_configuration) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling createInstallmentPayment'); } - // verify the required parameter 'transactionId' is set - if ($transactionId === null) { - throw new \InvalidArgumentException('Missing the required parameter $transactionId when calling createInstallmentPayment'); + // verify the required parameter 'transaction_id' is set + if (is_null($transaction_id)) { + throw new \InvalidArgumentException('Missing the required parameter $transaction_id when calling createInstallmentPayment'); } - // verify the required parameter 'installmentPlanConfiguration' is set - if ($installmentPlanConfiguration === null) { - throw new \InvalidArgumentException('Missing the required parameter $installmentPlanConfiguration when calling createInstallmentPayment'); + // verify the required parameter 'installment_plan_configuration' is set + if (is_null($installment_plan_configuration)) { + throw new \InvalidArgumentException('Missing the required parameter $installment_plan_configuration when calling createInstallmentPayment'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($transactionId !== null) { - $queryParams['transactionId'] = $this->apiClient->getSerializer()->toQueryValue($transactionId); + if (!is_null($transaction_id)) { + $queryParams['transactionId'] = $this->apiClient->getSerializer()->toQueryValue($transaction_id); } - if ($installmentPlanConfiguration !== null) { - $queryParams['installmentPlanConfiguration'] = $this->apiClient->getSerializer()->toQueryValue($installmentPlanConfiguration); + if (!is_null($installment_plan_configuration)) { + $queryParams['installmentPlanConfiguration'] = $this->apiClient->getSerializer()->toQueryValue($installment_plan_configuration); } // path params - $resourcePath = "/installment-payment/createInstallmentPayment"; + $resourcePath = '/installment-payment/createInstallmentPayment'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -261,20 +272,31 @@ public function createInstallmentPaymentWithHttpInfo($spaceId, $transactionId, $ return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\InstallmentPayment', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\InstallmentPayment', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\InstallmentPayment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -284,15 +306,15 @@ public function createInstallmentPaymentWithHttpInfo($spaceId, $transactionId, $ * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the installment payment which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\InstallmentPayment */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -300,46 +322,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the installment payment which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/installment-payment/read"; + $resourcePath = '/installment-payment/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -362,20 +384,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\InstallmentPayment', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\InstallmentPayment', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\InstallmentPayment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -385,15 +418,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the installment payments which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\InstallmentPayment[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -401,43 +434,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the installment payments which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/installment-payment/search"; + $resourcePath = '/installment-payment/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -465,20 +498,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\InstallmentPayment[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\InstallmentPayment[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\InstallmentPayment[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/InstallmentPaymentSliceService.php b/wallee-sdk/lib/Service/InstallmentPaymentSliceService.php index edb95ac..1dfe500 100644 --- a/wallee-sdk/lib/Service/InstallmentPaymentSliceService.php +++ b/wallee-sdk/lib/Service/InstallmentPaymentSliceService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,43 +87,43 @@ public function count($spaceId, $filter) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the installment payment slices which are used to calculate the count. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // verify the required parameter 'filter' is set - if ($filter === null) { + if (is_null($filter)) { throw new \InvalidArgumentException('Missing the required parameter $filter when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/installment-payment-slice/count"; + $resourcePath = '/installment-payment-slice/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -151,20 +151,31 @@ public function countWithHttpInfo($spaceId, $filter) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -174,15 +185,15 @@ public function countWithHttpInfo($spaceId, $filter) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the installment payment slice which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\InstallmentPaymentSlice */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -190,46 +201,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the installment payment slice which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/installment-payment-slice/read"; + $resourcePath = '/installment-payment-slice/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -252,20 +263,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\InstallmentPaymentSlice', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\InstallmentPaymentSlice', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\InstallmentPaymentSlice', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -275,15 +297,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the installment payment slices which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\InstallmentPaymentSlice[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -291,43 +313,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the installment payment slices which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/installment-payment-slice/search"; + $resourcePath = '/installment-payment-slice/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -355,20 +377,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\InstallmentPaymentSlice[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\InstallmentPaymentSlice[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\InstallmentPaymentSlice[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/InstallmentPlanCalculationService.php b/wallee-sdk/lib/Service/InstallmentPlanCalculationService.php index 574085d..59886d5 100644 --- a/wallee-sdk/lib/Service/InstallmentPlanCalculationService.php +++ b/wallee-sdk/lib/Service/InstallmentPlanCalculationService.php @@ -1,10 +1,8 @@ calculatePlansWithHttpInfo($spaceId, $transactionId)->getData(); + public function calculatePlans($space_id, $transaction_id) { + return $this->calculatePlansWithHttpInfo($space_id, $transaction_id)->getData(); } /** @@ -87,46 +87,46 @@ public function calculatePlans($spaceId, $transactionId) { * * Calculate Plans * - * @param int $spaceId (required) - * @param int $transactionId The transaction for which the plans should be calculated for. (required) + * @param int $space_id (required) + * @param int $transaction_id The transaction for which the plans should be calculated for. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function calculatePlansWithHttpInfo($spaceId, $transactionId) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling calculatePlans'); + public function calculatePlansWithHttpInfo($space_id, $transaction_id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling calculatePlans'); } - // verify the required parameter 'transactionId' is set - if ($transactionId === null) { - throw new \InvalidArgumentException('Missing the required parameter $transactionId when calling calculatePlans'); + // verify the required parameter 'transaction_id' is set + if (is_null($transaction_id)) { + throw new \InvalidArgumentException('Missing the required parameter $transaction_id when calling calculatePlans'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($transactionId !== null) { - $queryParams['transactionId'] = $this->apiClient->getSerializer()->toQueryValue($transactionId); + if (!is_null($transaction_id)) { + $queryParams['transactionId'] = $this->apiClient->getSerializer()->toQueryValue($transaction_id); } // path params - $resourcePath = "/installment-plan-calculation/calculatePlans"; + $resourcePath = '/installment-plan-calculation/calculatePlans'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -149,20 +149,31 @@ public function calculatePlansWithHttpInfo($spaceId, $transactionId) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\InstallmentCalculatedPlan[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\InstallmentCalculatedPlan[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\InstallmentCalculatedPlan[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/InstallmentPlanConfigurationService.php b/wallee-sdk/lib/Service/InstallmentPlanConfigurationService.php index 0fda386..2f90287 100644 --- a/wallee-sdk/lib/Service/InstallmentPlanConfigurationService.php +++ b/wallee-sdk/lib/Service/InstallmentPlanConfigurationService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,43 +87,43 @@ public function count($spaceId, $filter) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the installment plan configurations which are used to calculate the count. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // verify the required parameter 'filter' is set - if ($filter === null) { + if (is_null($filter)) { throw new \InvalidArgumentException('Missing the required parameter $filter when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/installment-plan-configuration/count"; + $resourcePath = '/installment-plan-configuration/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -151,20 +151,31 @@ public function countWithHttpInfo($spaceId, $filter) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -174,15 +185,15 @@ public function countWithHttpInfo($spaceId, $filter) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the installment plan configuration which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\InstallmentPlanConfiguration */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -190,46 +201,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the installment plan configuration which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/installment-plan-configuration/read"; + $resourcePath = '/installment-plan-configuration/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -252,20 +263,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\InstallmentPlanConfiguration', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\InstallmentPlanConfiguration', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\InstallmentPlanConfiguration', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -275,15 +297,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the installment plan configurations which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\InstallmentPlanConfiguration[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -291,43 +313,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the installment plan configurations which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/installment-plan-configuration/search"; + $resourcePath = '/installment-plan-configuration/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -355,20 +377,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\InstallmentPlanConfiguration[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\InstallmentPlanConfiguration[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\InstallmentPlanConfiguration[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/InstallmentPlanSliceConfigurationService.php b/wallee-sdk/lib/Service/InstallmentPlanSliceConfigurationService.php index e6aa46a..8ada3e2 100644 --- a/wallee-sdk/lib/Service/InstallmentPlanSliceConfigurationService.php +++ b/wallee-sdk/lib/Service/InstallmentPlanSliceConfigurationService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,43 +87,43 @@ public function count($spaceId, $filter) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the installment plan slice configurations which are used to calculate the count. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // verify the required parameter 'filter' is set - if ($filter === null) { + if (is_null($filter)) { throw new \InvalidArgumentException('Missing the required parameter $filter when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/installment-plan-slice-configuration/count"; + $resourcePath = '/installment-plan-slice-configuration/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -151,20 +151,31 @@ public function countWithHttpInfo($spaceId, $filter) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -174,15 +185,15 @@ public function countWithHttpInfo($spaceId, $filter) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the installment plan slice configuration which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\InstallmentPlanSliceConfiguration */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -190,46 +201,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the installment plan slice configuration which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/installment-plan-slice-configuration/read"; + $resourcePath = '/installment-plan-slice-configuration/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -252,20 +263,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\InstallmentPlanSliceConfiguration', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\InstallmentPlanSliceConfiguration', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\InstallmentPlanSliceConfiguration', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -275,15 +297,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the installment plan slice configurations which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\InstallmentPlanSliceConfiguration[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -291,43 +313,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the installment plan slice configurations which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/installment-plan-slice-configuration/search"; + $resourcePath = '/installment-plan-slice-configuration/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -355,20 +377,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\InstallmentPlanSliceConfiguration[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\InstallmentPlanSliceConfiguration[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\InstallmentPlanSliceConfiguration[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/LabelDescriptionGroupService.php b/wallee-sdk/lib/Service/LabelDescriptionGroupService.php index e832c1f..a4f56da 100644 --- a/wallee-sdk/lib/Service/LabelDescriptionGroupService.php +++ b/wallee-sdk/lib/Service/LabelDescriptionGroupService.php @@ -1,10 +1,8 @@ apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/label-description-group-service/all"; + $resourcePath = '/label-description-group-service/all'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -131,20 +131,31 @@ public function allWithHttpInfo() { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\LabelDescriptorGroup[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\LabelDescriptorGroup[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\LabelDescriptorGroup[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -177,30 +188,30 @@ public function read($id) { */ public function readWithHttpInfo($id) { // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($id !== null) { + $queryParams = []; + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/label-description-group-service/read"; + $resourcePath = '/label-description-group-service/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -223,20 +234,31 @@ public function readWithHttpInfo($id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\LabelDescriptorGroup', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\LabelDescriptorGroup', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\LabelDescriptorGroup', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/LabelDescriptionService.php b/wallee-sdk/lib/Service/LabelDescriptionService.php index 39e1fac..133b1f1 100644 --- a/wallee-sdk/lib/Service/LabelDescriptionService.php +++ b/wallee-sdk/lib/Service/LabelDescriptionService.php @@ -1,10 +1,8 @@ apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/label-description-service/all"; + $resourcePath = '/label-description-service/all'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -131,20 +131,31 @@ public function allWithHttpInfo() { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\LabelDescriptor[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\LabelDescriptor[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\LabelDescriptor[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -177,30 +188,30 @@ public function read($id) { */ public function readWithHttpInfo($id) { // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($id !== null) { + $queryParams = []; + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/label-description-service/read"; + $resourcePath = '/label-description-service/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -223,20 +234,31 @@ public function readWithHttpInfo($id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\LabelDescriptor', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\LabelDescriptor', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\LabelDescriptor', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/LanguageService.php b/wallee-sdk/lib/Service/LanguageService.php index bcba3ff..c932079 100644 --- a/wallee-sdk/lib/Service/LanguageService.php +++ b/wallee-sdk/lib/Service/LanguageService.php @@ -1,10 +1,8 @@ apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/language/all"; + $resourcePath = '/language/all'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -131,20 +131,31 @@ public function allWithHttpInfo() { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\RestLanguage[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\RestLanguage[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\RestLanguage[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/LegalOrganizationFormService.php b/wallee-sdk/lib/Service/LegalOrganizationFormService.php index 99dd6d2..5292e54 100644 --- a/wallee-sdk/lib/Service/LegalOrganizationFormService.php +++ b/wallee-sdk/lib/Service/LegalOrganizationFormService.php @@ -1,10 +1,8 @@ apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/legal-organization-form/all"; + $resourcePath = '/legal-organization-form/all'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -131,20 +131,31 @@ public function allWithHttpInfo() { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\LegalOrganizationForm[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\LegalOrganizationForm[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\LegalOrganizationForm[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -177,30 +188,30 @@ public function country($code) { */ public function countryWithHttpInfo($code) { // verify the required parameter 'code' is set - if ($code === null) { + if (is_null($code)) { throw new \InvalidArgumentException('Missing the required parameter $code when calling country'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($code !== null) { + $queryParams = []; + if (!is_null($code)) { $queryParams['code'] = $this->apiClient->getSerializer()->toQueryValue($code); } // path params - $resourcePath = "/legal-organization-form/country"; + $resourcePath = '/legal-organization-form/country'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -223,20 +234,31 @@ public function countryWithHttpInfo($code) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\LegalOrganizationForm[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\LegalOrganizationForm[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\LegalOrganizationForm[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -269,30 +291,30 @@ public function read($id) { */ public function readWithHttpInfo($id) { // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($id !== null) { + $queryParams = []; + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/legal-organization-form/read"; + $resourcePath = '/legal-organization-form/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -315,20 +337,31 @@ public function readWithHttpInfo($id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\LegalOrganizationForm', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\LegalOrganizationForm', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\LegalOrganizationForm', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/ManualTaskService.php b/wallee-sdk/lib/Service/ManualTaskService.php index b6d3c39..eceb973 100644 --- a/wallee-sdk/lib/Service/ManualTaskService.php +++ b/wallee-sdk/lib/Service/ManualTaskService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/manual-task/count"; + $resourcePath = '/manual-task/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the manual task which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ManualTask */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -186,46 +197,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the manual task which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/manual-task/read"; + $resourcePath = '/manual-task/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -248,20 +259,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ManualTask', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ManualTask', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ManualTask', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -271,15 +293,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the manual tasks which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ManualTask[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -287,43 +309,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the manual tasks which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/manual-task/search"; + $resourcePath = '/manual-task/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -351,20 +373,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ManualTask[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ManualTask[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ManualTask[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/MerticUsageService.php b/wallee-sdk/lib/Service/MerticUsageService.php index eeb93f1..0e696e6 100644 --- a/wallee-sdk/lib/Service/MerticUsageService.php +++ b/wallee-sdk/lib/Service/MerticUsageService.php @@ -1,10 +1,8 @@ calculateWithHttpInfo($spaceId, $start, $end)->getData(); + public function calculate($space_id, $start, $end) { + return $this->calculateWithHttpInfo($space_id, $start, $end)->getData(); } /** @@ -88,7 +88,7 @@ public function calculate($spaceId, $start, $end) { * * Calculate * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \DateTime $start The start date from which on the consumed units should be returned from. (required) * @param \DateTime $end The end date to which the consumed units should be returned to. The end date is not included in the result. (required) * @throws \Wallee\Sdk\ApiException @@ -96,46 +96,46 @@ public function calculate($spaceId, $start, $end) { * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function calculateWithHttpInfo($spaceId, $start, $end) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling calculate'); + public function calculateWithHttpInfo($space_id, $start, $end) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling calculate'); } // verify the required parameter 'start' is set - if ($start === null) { + if (is_null($start)) { throw new \InvalidArgumentException('Missing the required parameter $start when calling calculate'); } // verify the required parameter 'end' is set - if ($end === null) { + if (is_null($end)) { throw new \InvalidArgumentException('Missing the required parameter $end when calling calculate'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($start !== null) { + if (!is_null($start)) { $queryParams['start'] = $this->apiClient->getSerializer()->toQueryValue($start); } - if ($end !== null) { + if (!is_null($end)) { $queryParams['end'] = $this->apiClient->getSerializer()->toQueryValue($end); } // path params - $resourcePath = "/mertic-usage/calculate"; + $resourcePath = '/mertic-usage/calculate'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -158,20 +158,31 @@ public function calculateWithHttpInfo($spaceId, $start, $end) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\MetricUsage[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\MetricUsage[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\MetricUsage[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/PaymentConnectorConfigurationService.php b/wallee-sdk/lib/Service/PaymentConnectorConfigurationService.php index 6294c11..02405e5 100644 --- a/wallee-sdk/lib/Service/PaymentConnectorConfigurationService.php +++ b/wallee-sdk/lib/Service/PaymentConnectorConfigurationService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/payment-connector-configuration/count"; + $resourcePath = '/payment-connector-configuration/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the payment connector configuration which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\PaymentConnectorConfiguration */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -186,46 +197,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the payment connector configuration which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/payment-connector-configuration/read"; + $resourcePath = '/payment-connector-configuration/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -248,20 +259,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\PaymentConnectorConfiguration', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\PaymentConnectorConfiguration', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\PaymentConnectorConfiguration', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -271,15 +293,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the payment connector configuration which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\PaymentConnectorConfiguration[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -287,43 +309,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the payment connector configuration which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/payment-connector-configuration/search"; + $resourcePath = '/payment-connector-configuration/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -351,20 +373,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\PaymentConnectorConfiguration[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\PaymentConnectorConfiguration[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\PaymentConnectorConfiguration[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/PaymentConnectorService.php b/wallee-sdk/lib/Service/PaymentConnectorService.php index 5a093b4..272e67d 100644 --- a/wallee-sdk/lib/Service/PaymentConnectorService.php +++ b/wallee-sdk/lib/Service/PaymentConnectorService.php @@ -1,10 +1,8 @@ apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/payment-connector/all"; + $resourcePath = '/payment-connector/all'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -131,20 +131,31 @@ public function allWithHttpInfo() { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\PaymentConnector[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\PaymentConnector[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\PaymentConnector[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -177,30 +188,30 @@ public function read($id) { */ public function readWithHttpInfo($id) { // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($id !== null) { + $queryParams = []; + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/payment-connector/read"; + $resourcePath = '/payment-connector/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -223,20 +234,31 @@ public function readWithHttpInfo($id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\PaymentConnector', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\PaymentConnector', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\PaymentConnector', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/PaymentLinkService.php b/wallee-sdk/lib/Service/PaymentLinkService.php index 59ead84..8f212d0 100644 --- a/wallee-sdk/lib/Service/PaymentLinkService.php +++ b/wallee-sdk/lib/Service/PaymentLinkService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/payment-link/count"; + $resourcePath = '/payment-link/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\PaymentLinkCreate $entity The payment link object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\PaymentLink */ - public function create($spaceId, $entity) { - return $this->createWithHttpInfo($spaceId, $entity)->getData(); + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); } /** @@ -186,43 +197,43 @@ public function create($spaceId, $entity) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\PaymentLinkCreate $entity The payment link object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/payment-link/create"; + $resourcePath = '/payment-link/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -250,20 +261,31 @@ public function createWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\PaymentLink', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\PaymentLink', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\PaymentLink', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -273,15 +295,15 @@ public function createWithHttpInfo($spaceId, $entity) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return void */ - public function delete($spaceId, $id) { - return $this->deleteWithHttpInfo($spaceId, $id)->getData(); + public function delete($space_id, $id) { + return $this->deleteWithHttpInfo($space_id, $id)->getData(); } /** @@ -289,43 +311,43 @@ public function delete($spaceId, $id) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function deleteWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling delete'); + public function deleteWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling delete'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/payment-link/delete"; + $resourcePath = '/payment-link/delete'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($id)) { @@ -353,20 +375,31 @@ public function deleteWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -376,15 +409,15 @@ public function deleteWithHttpInfo($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the payment links which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\PaymentLink */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -392,46 +425,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the payment links which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/payment-link/read"; + $resourcePath = '/payment-link/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -454,20 +487,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\PaymentLink', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\PaymentLink', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\PaymentLink', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -477,15 +521,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the payment links which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\PaymentLink[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -493,43 +537,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the payment links which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/payment-link/search"; + $resourcePath = '/payment-link/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -557,20 +601,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\PaymentLink[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\PaymentLink[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\PaymentLink[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -580,15 +635,15 @@ public function searchWithHttpInfo($spaceId, $query) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\PaymentLinkUpdate $entity The object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\PaymentLink */ - public function update($spaceId, $entity) { - return $this->updateWithHttpInfo($spaceId, $entity)->getData(); + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); } /** @@ -596,43 +651,43 @@ public function update($spaceId, $entity) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\PaymentLinkUpdate $entity The object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function updateWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling update'); + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/payment-link/update"; + $resourcePath = '/payment-link/update'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -660,24 +715,39 @@ public function updateWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\PaymentLink', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\PaymentLink', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\PaymentLink', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/PaymentMethodConfigurationService.php b/wallee-sdk/lib/Service/PaymentMethodConfigurationService.php index 3b548a3..400301f 100644 --- a/wallee-sdk/lib/Service/PaymentMethodConfigurationService.php +++ b/wallee-sdk/lib/Service/PaymentMethodConfigurationService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/payment-method-configuration/count"; + $resourcePath = '/payment-method-configuration/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the payment method configuration which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\PaymentMethodConfiguration */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -186,46 +197,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the payment method configuration which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/payment-method-configuration/read"; + $resourcePath = '/payment-method-configuration/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -248,20 +259,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\PaymentMethodConfiguration', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\PaymentMethodConfiguration', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\PaymentMethodConfiguration', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -271,15 +293,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the payment method configuration which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\PaymentMethodConfiguration[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -287,43 +309,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the payment method configuration which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/payment-method-configuration/search"; + $resourcePath = '/payment-method-configuration/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -351,20 +373,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\PaymentMethodConfiguration[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\PaymentMethodConfiguration[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\PaymentMethodConfiguration[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/PaymentMethodService.php b/wallee-sdk/lib/Service/PaymentMethodService.php index 41246c5..5d0b9af 100644 --- a/wallee-sdk/lib/Service/PaymentMethodService.php +++ b/wallee-sdk/lib/Service/PaymentMethodService.php @@ -1,10 +1,8 @@ apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/payment-method/all"; + $resourcePath = '/payment-method/all'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -131,20 +131,31 @@ public function allWithHttpInfo() { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\PaymentMethod[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\PaymentMethod[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\PaymentMethod[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -177,30 +188,30 @@ public function read($id) { */ public function readWithHttpInfo($id) { // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($id !== null) { + $queryParams = []; + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/payment-method/read"; + $resourcePath = '/payment-method/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -223,20 +234,31 @@ public function readWithHttpInfo($id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\PaymentMethod', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\PaymentMethod', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\PaymentMethod', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/PaymentProcessorConfigurationService.php b/wallee-sdk/lib/Service/PaymentProcessorConfigurationService.php index 2625ba7..e4816a5 100644 --- a/wallee-sdk/lib/Service/PaymentProcessorConfigurationService.php +++ b/wallee-sdk/lib/Service/PaymentProcessorConfigurationService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/payment-processor-configuration/count"; + $resourcePath = '/payment-processor-configuration/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the payment processor configuration which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\PaymentProcessorConfiguration */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -186,46 +197,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the payment processor configuration which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/payment-processor-configuration/read"; + $resourcePath = '/payment-processor-configuration/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -248,20 +259,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\PaymentProcessorConfiguration', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\PaymentProcessorConfiguration', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\PaymentProcessorConfiguration', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -271,15 +293,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the payment processor configuration which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\PaymentProcessorConfiguration[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -287,43 +309,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the payment processor configuration which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/payment-processor-configuration/search"; + $resourcePath = '/payment-processor-configuration/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -351,20 +373,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\PaymentProcessorConfiguration[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\PaymentProcessorConfiguration[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\PaymentProcessorConfiguration[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/PaymentProcessorService.php b/wallee-sdk/lib/Service/PaymentProcessorService.php index f551c5c..3e081c6 100644 --- a/wallee-sdk/lib/Service/PaymentProcessorService.php +++ b/wallee-sdk/lib/Service/PaymentProcessorService.php @@ -1,10 +1,8 @@ apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/payment-processor/all"; + $resourcePath = '/payment-processor/all'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -131,20 +131,31 @@ public function allWithHttpInfo() { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\PaymentProcessor[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\PaymentProcessor[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\PaymentProcessor[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -177,30 +188,30 @@ public function read($id) { */ public function readWithHttpInfo($id) { // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($id !== null) { + $queryParams = []; + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/payment-processor/read"; + $resourcePath = '/payment-processor/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -223,20 +234,31 @@ public function readWithHttpInfo($id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\PaymentProcessor', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\PaymentProcessor', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\PaymentProcessor', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/PermissionService.php b/wallee-sdk/lib/Service/PermissionService.php index d6b753e..c5142fc 100644 --- a/wallee-sdk/lib/Service/PermissionService.php +++ b/wallee-sdk/lib/Service/PermissionService.php @@ -1,10 +1,8 @@ apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/permission/all"; + $resourcePath = '/permission/all'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -131,20 +131,31 @@ public function allWithHttpInfo() { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Permission[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Permission[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Permission[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -177,30 +188,30 @@ public function read($id) { */ public function readWithHttpInfo($id) { // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($id !== null) { + $queryParams = []; + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/permission/read"; + $resourcePath = '/permission/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -223,20 +234,31 @@ public function readWithHttpInfo($id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Permission', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Permission', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Permission', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/RefundCommentService.php b/wallee-sdk/lib/Service/RefundCommentService.php new file mode 100644 index 0000000..551dff0 --- /dev/null +++ b/wallee-sdk/lib/Service/RefundCommentService.php @@ -0,0 +1,865 @@ +apiClient = $apiClient; + } + + /** + * Returns the API client instance. + * + * @return ApiClient + */ + public function getApiClient() { + return $this->apiClient; + } + + + /** + * Operation all + * + * Find by refund + * + * @param int $space_id (required) + * @param int $refund_id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\RefundComment[] + */ + public function all($space_id, $refund_id) { + return $this->allWithHttpInfo($space_id, $refund_id)->getData(); + } + + /** + * Operation allWithHttpInfo + * + * Find by refund + * + * @param int $space_id (required) + * @param int $refund_id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function allWithHttpInfo($space_id, $refund_id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling all'); + } + // verify the required parameter 'refund_id' is set + if (is_null($refund_id)) { + throw new \InvalidArgumentException('Missing the required parameter $refund_id when calling all'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($refund_id)) { + $queryParams['refundId'] = $this->apiClient->getSerializer()->toQueryValue($refund_id); + } + + // path params + $resourcePath = '/refund-comment/all'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\RefundComment[]', + '/refund-comment/all' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\RefundComment[]', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\RefundComment[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation create + * + * Create + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\RefundCommentCreate $entity (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\RefundComment + */ + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); + } + + /** + * Operation createWithHttpInfo + * + * Create + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\RefundCommentCreate $entity (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); + } + // verify the required parameter 'entity' is set + if (is_null($entity)) { + throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/refund-comment/create'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($entity)) { + $tempBody = $entity; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\RefundComment', + '/refund-comment/create' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\RefundComment', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\RefundComment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation delete + * + * Delete + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return void + */ + public function delete($space_id, $id) { + return $this->deleteWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation deleteWithHttpInfo + * + * Delete + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function deleteWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling delete'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/refund-comment/delete'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + null, + '/refund-comment/delete' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders()); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation pin + * + * Pin + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return void + */ + public function pin($space_id, $id) { + return $this->pinWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation pinWithHttpInfo + * + * Pin + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function pinWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling pin'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling pin'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/refund-comment/pin'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + null, + '/refund-comment/pin' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders()); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation read + * + * Read + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\RefundComment + */ + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation readWithHttpInfo + * + * Read + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/refund-comment/read'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\RefundComment', + '/refund-comment/read' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\RefundComment', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\RefundComment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation unpin + * + * Unpin + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return void + */ + public function unpin($space_id, $id) { + return $this->unpinWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation unpinWithHttpInfo + * + * Unpin + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function unpinWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling unpin'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling unpin'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/refund-comment/unpin'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + null, + '/refund-comment/unpin' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders()); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation update + * + * Update + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\RefundCommentActive $entity (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\RefundComment + */ + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); + } + + /** + * Operation updateWithHttpInfo + * + * Update + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\RefundCommentActive $entity (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); + } + // verify the required parameter 'entity' is set + if (is_null($entity)) { + throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/refund-comment/update'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($entity)) { + $tempBody = $entity; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\RefundComment', + '/refund-comment/update' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\RefundComment', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\RefundComment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + +} diff --git a/wallee-sdk/lib/Service/RefundService.php b/wallee-sdk/lib/Service/RefundService.php index dc0115c..b190851 100644 --- a/wallee-sdk/lib/Service/RefundService.php +++ b/wallee-sdk/lib/Service/RefundService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/refund/count"; + $resourcePath = '/refund/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * fail * - * @param int $spaceId (required) - * @param int $refundId The id of the refund which should be marked as failed. (required) + * @param int $space_id (required) + * @param int $refund_id The id of the refund which should be marked as failed. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\Refund */ - public function fail($spaceId, $refundId) { - return $this->failWithHttpInfo($spaceId, $refundId)->getData(); + public function fail($space_id, $refund_id) { + return $this->failWithHttpInfo($space_id, $refund_id)->getData(); } /** @@ -186,46 +197,46 @@ public function fail($spaceId, $refundId) { * * fail * - * @param int $spaceId (required) - * @param int $refundId The id of the refund which should be marked as failed. (required) + * @param int $space_id (required) + * @param int $refund_id The id of the refund which should be marked as failed. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function failWithHttpInfo($spaceId, $refundId) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling fail'); + public function failWithHttpInfo($space_id, $refund_id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling fail'); } - // verify the required parameter 'refundId' is set - if ($refundId === null) { - throw new \InvalidArgumentException('Missing the required parameter $refundId when calling fail'); + // verify the required parameter 'refund_id' is set + if (is_null($refund_id)) { + throw new \InvalidArgumentException('Missing the required parameter $refund_id when calling fail'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($refundId !== null) { - $queryParams['refundId'] = $this->apiClient->getSerializer()->toQueryValue($refundId); + if (!is_null($refund_id)) { + $queryParams['refundId'] = $this->apiClient->getSerializer()->toQueryValue($refund_id); } // path params - $resourcePath = "/refund/fail"; + $resourcePath = '/refund/fail'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -248,20 +259,31 @@ public function failWithHttpInfo($spaceId, $refundId) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Refund', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Refund', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Refund', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -271,15 +293,15 @@ public function failWithHttpInfo($spaceId, $refundId) { * * getRefundDocument * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the refund to get the document for. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\RenderedDocument */ - public function getRefundDocument($spaceId, $id) { - return $this->getRefundDocumentWithHttpInfo($spaceId, $id)->getData(); + public function getRefundDocument($space_id, $id) { + return $this->getRefundDocumentWithHttpInfo($space_id, $id)->getData(); } /** @@ -287,46 +309,46 @@ public function getRefundDocument($spaceId, $id) { * * getRefundDocument * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the refund to get the document for. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function getRefundDocumentWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling getRefundDocument'); + public function getRefundDocumentWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling getRefundDocument'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling getRefundDocument'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/refund/getRefundDocument"; + $resourcePath = '/refund/getRefundDocument'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -349,20 +371,31 @@ public function getRefundDocumentWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\RenderedDocument', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\RenderedDocument', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\RenderedDocument', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -372,16 +405,16 @@ public function getRefundDocumentWithHttpInfo($spaceId, $id) { * * getRefundDocumentWithTargetMediaType * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the refund to get the document for. (required) - * @param int $targetMediaTypeId The id of the target media type for which the refund should be generated for. (required) + * @param int $target_media_type_id The id of the target media type for which the refund should be generated for. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\RenderedDocument */ - public function getRefundDocumentWithTargetMediaType($spaceId, $id, $targetMediaTypeId) { - return $this->getRefundDocumentWithTargetMediaTypeWithHttpInfo($spaceId, $id, $targetMediaTypeId)->getData(); + public function getRefundDocumentWithTargetMediaType($space_id, $id, $target_media_type_id) { + return $this->getRefundDocumentWithTargetMediaTypeWithHttpInfo($space_id, $id, $target_media_type_id)->getData(); } /** @@ -389,54 +422,54 @@ public function getRefundDocumentWithTargetMediaType($spaceId, $id, $targetMedia * * getRefundDocumentWithTargetMediaType * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the refund to get the document for. (required) - * @param int $targetMediaTypeId The id of the target media type for which the refund should be generated for. (required) + * @param int $target_media_type_id The id of the target media type for which the refund should be generated for. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function getRefundDocumentWithTargetMediaTypeWithHttpInfo($spaceId, $id, $targetMediaTypeId) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling getRefundDocumentWithTargetMediaType'); + public function getRefundDocumentWithTargetMediaTypeWithHttpInfo($space_id, $id, $target_media_type_id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling getRefundDocumentWithTargetMediaType'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling getRefundDocumentWithTargetMediaType'); } - // verify the required parameter 'targetMediaTypeId' is set - if ($targetMediaTypeId === null) { - throw new \InvalidArgumentException('Missing the required parameter $targetMediaTypeId when calling getRefundDocumentWithTargetMediaType'); + // verify the required parameter 'target_media_type_id' is set + if (is_null($target_media_type_id)) { + throw new \InvalidArgumentException('Missing the required parameter $target_media_type_id when calling getRefundDocumentWithTargetMediaType'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } - if ($targetMediaTypeId !== null) { - $queryParams['targetMediaTypeId'] = $this->apiClient->getSerializer()->toQueryValue($targetMediaTypeId); + if (!is_null($target_media_type_id)) { + $queryParams['targetMediaTypeId'] = $this->apiClient->getSerializer()->toQueryValue($target_media_type_id); } // path params - $resourcePath = "/refund/getRefundDocumentWithTargetMediaType"; + $resourcePath = '/refund/getRefundDocumentWithTargetMediaType'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -459,20 +492,31 @@ public function getRefundDocumentWithTargetMediaTypeWithHttpInfo($spaceId, $id, return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\RenderedDocument', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\RenderedDocument', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\RenderedDocument', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -482,15 +526,15 @@ public function getRefundDocumentWithTargetMediaTypeWithHttpInfo($spaceId, $id, * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the refund which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\Refund */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -498,46 +542,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the refund which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/refund/read"; + $resourcePath = '/refund/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -560,20 +604,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Refund', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Refund', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Refund', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -583,15 +638,15 @@ public function readWithHttpInfo($spaceId, $id) { * * create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\RefundCreate $refund The refund object which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\Refund */ - public function refund($spaceId, $refund) { - return $this->refundWithHttpInfo($spaceId, $refund)->getData(); + public function refund($space_id, $refund) { + return $this->refundWithHttpInfo($space_id, $refund)->getData(); } /** @@ -599,43 +654,43 @@ public function refund($spaceId, $refund) { * * create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\RefundCreate $refund The refund object which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function refundWithHttpInfo($spaceId, $refund) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling refund'); + public function refundWithHttpInfo($space_id, $refund) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling refund'); } // verify the required parameter 'refund' is set - if ($refund === null) { + if (is_null($refund)) { throw new \InvalidArgumentException('Missing the required parameter $refund when calling refund'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/refund/refund"; + $resourcePath = '/refund/refund'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($refund)) { @@ -663,20 +718,31 @@ public function refundWithHttpInfo($spaceId, $refund) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Refund', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Refund', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Refund', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -686,15 +752,15 @@ public function refundWithHttpInfo($spaceId, $refund) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the refunds which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\Refund[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -702,43 +768,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the refunds which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/refund/search"; + $resourcePath = '/refund/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -766,20 +832,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Refund[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Refund[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Refund[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -789,15 +866,15 @@ public function searchWithHttpInfo($spaceId, $query) { * * succeed * - * @param int $spaceId (required) - * @param int $refundId The id of the refund which should be marked as successful. (required) + * @param int $space_id (required) + * @param int $refund_id The id of the refund which should be marked as successful. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\Refund */ - public function succeed($spaceId, $refundId) { - return $this->succeedWithHttpInfo($spaceId, $refundId)->getData(); + public function succeed($space_id, $refund_id) { + return $this->succeedWithHttpInfo($space_id, $refund_id)->getData(); } /** @@ -805,46 +882,46 @@ public function succeed($spaceId, $refundId) { * * succeed * - * @param int $spaceId (required) - * @param int $refundId The id of the refund which should be marked as successful. (required) + * @param int $space_id (required) + * @param int $refund_id The id of the refund which should be marked as successful. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function succeedWithHttpInfo($spaceId, $refundId) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling succeed'); + public function succeedWithHttpInfo($space_id, $refund_id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling succeed'); } - // verify the required parameter 'refundId' is set - if ($refundId === null) { - throw new \InvalidArgumentException('Missing the required parameter $refundId when calling succeed'); + // verify the required parameter 'refund_id' is set + if (is_null($refund_id)) { + throw new \InvalidArgumentException('Missing the required parameter $refund_id when calling succeed'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($refundId !== null) { - $queryParams['refundId'] = $this->apiClient->getSerializer()->toQueryValue($refundId); + if (!is_null($refund_id)) { + $queryParams['refundId'] = $this->apiClient->getSerializer()->toQueryValue($refund_id); } // path params - $resourcePath = "/refund/succeed"; + $resourcePath = '/refund/succeed'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -867,20 +944,31 @@ public function succeedWithHttpInfo($spaceId, $refundId) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Refund', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Refund', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Refund', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/SpaceService.php b/wallee-sdk/lib/Service/SpaceService.php index 3637a16..7d11fc9 100644 --- a/wallee-sdk/lib/Service/SpaceService.php +++ b/wallee-sdk/lib/Service/SpaceService.php @@ -1,10 +1,8 @@ apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/space/count"; + $resourcePath = '/space/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -138,20 +138,31 @@ public function countWithHttpInfo($filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -184,27 +195,27 @@ public function create($entity) { */ public function createWithHttpInfo($entity) { // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/space/create"; + $resourcePath = '/space/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -232,20 +243,31 @@ public function createWithHttpInfo($entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Space', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Space', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Space', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -278,27 +300,27 @@ public function delete($id) { */ public function deleteWithHttpInfo($id) { // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/space/delete"; + $resourcePath = '/space/delete'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($id)) { @@ -326,20 +348,31 @@ public function deleteWithHttpInfo($id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -372,30 +405,30 @@ public function read($id) { */ public function readWithHttpInfo($id) { // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($id !== null) { + $queryParams = []; + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/space/read"; + $resourcePath = '/space/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -418,20 +451,31 @@ public function readWithHttpInfo($id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Space', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Space', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Space', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -464,27 +508,27 @@ public function search($query) { */ public function searchWithHttpInfo($query) { // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/space/search"; + $resourcePath = '/space/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -512,20 +556,31 @@ public function searchWithHttpInfo($query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Space[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Space[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Space[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -558,27 +613,27 @@ public function update($entity) { */ public function updateWithHttpInfo($entity) { // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/space/update"; + $resourcePath = '/space/update'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -606,24 +661,39 @@ public function updateWithHttpInfo($entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Space', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Space', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Space', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/StaticValueService.php b/wallee-sdk/lib/Service/StaticValueService.php index 60b19f3..7971786 100644 --- a/wallee-sdk/lib/Service/StaticValueService.php +++ b/wallee-sdk/lib/Service/StaticValueService.php @@ -1,10 +1,8 @@ apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); + $queryParams = []; // path params - $resourcePath = "/static-value-service/all"; + $resourcePath = '/static-value-service/all'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -131,20 +131,31 @@ public function allWithHttpInfo() { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\StaticValue[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\StaticValue[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\StaticValue[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -177,30 +188,30 @@ public function read($id) { */ public function readWithHttpInfo($id) { // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($id !== null) { + $queryParams = []; + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/static-value-service/read"; + $resourcePath = '/static-value-service/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -223,20 +234,31 @@ public function readWithHttpInfo($id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\StaticValue', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\StaticValue', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\StaticValue', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/SubscriberService.php b/wallee-sdk/lib/Service/SubscriberService.php index 0710445..b2d4332 100644 --- a/wallee-sdk/lib/Service/SubscriberService.php +++ b/wallee-sdk/lib/Service/SubscriberService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscriber/count"; + $resourcePath = '/subscriber/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriberCreate $entity The customer object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriberCreate */ - public function create($spaceId, $entity) { - return $this->createWithHttpInfo($spaceId, $entity)->getData(); + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); } /** @@ -186,43 +197,43 @@ public function create($spaceId, $entity) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriberCreate $entity The customer object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscriber/create"; + $resourcePath = '/subscriber/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -250,20 +261,31 @@ public function createWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriberCreate', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriberCreate', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriberCreate', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -273,15 +295,15 @@ public function createWithHttpInfo($spaceId, $entity) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return void */ - public function delete($spaceId, $id) { - return $this->deleteWithHttpInfo($spaceId, $id)->getData(); + public function delete($space_id, $id) { + return $this->deleteWithHttpInfo($space_id, $id)->getData(); } /** @@ -289,43 +311,43 @@ public function delete($spaceId, $id) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function deleteWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling delete'); + public function deleteWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling delete'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscriber/delete"; + $resourcePath = '/subscriber/delete'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($id)) { @@ -353,20 +375,31 @@ public function deleteWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -376,15 +409,15 @@ public function deleteWithHttpInfo($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the customer which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\Subscriber */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -392,46 +425,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the customer which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/subscriber/read"; + $resourcePath = '/subscriber/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -454,20 +487,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Subscriber', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Subscriber', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Subscriber', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -477,15 +521,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the customer which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\Subscriber[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -493,43 +537,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the customer which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscriber/search"; + $resourcePath = '/subscriber/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -557,20 +601,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Subscriber[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Subscriber[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Subscriber[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -580,15 +635,15 @@ public function searchWithHttpInfo($spaceId, $query) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriberUpdate $entity The customer with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\Subscriber */ - public function update($spaceId, $entity) { - return $this->updateWithHttpInfo($spaceId, $entity)->getData(); + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); } /** @@ -596,43 +651,43 @@ public function update($spaceId, $entity) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriberUpdate $entity The customer with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function updateWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling update'); + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscriber/update"; + $resourcePath = '/subscriber/update'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -660,24 +715,39 @@ public function updateWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Subscriber', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Subscriber', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Subscriber', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/SubscriptionAffiliateService.php b/wallee-sdk/lib/Service/SubscriptionAffiliateService.php index 77d3ef3..3a41ba7 100644 --- a/wallee-sdk/lib/Service/SubscriptionAffiliateService.php +++ b/wallee-sdk/lib/Service/SubscriptionAffiliateService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-affiliate/count"; + $resourcePath = '/subscription-affiliate/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionAffiliateCreate $entity The subscription affiliate object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionAffiliate */ - public function create($spaceId, $entity) { - return $this->createWithHttpInfo($spaceId, $entity)->getData(); + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); } /** @@ -186,43 +197,43 @@ public function create($spaceId, $entity) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionAffiliateCreate $entity The subscription affiliate object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-affiliate/create"; + $resourcePath = '/subscription-affiliate/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -250,20 +261,31 @@ public function createWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionAffiliate', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionAffiliate', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionAffiliate', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -273,15 +295,15 @@ public function createWithHttpInfo($spaceId, $entity) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return void */ - public function delete($spaceId, $id) { - return $this->deleteWithHttpInfo($spaceId, $id)->getData(); + public function delete($space_id, $id) { + return $this->deleteWithHttpInfo($space_id, $id)->getData(); } /** @@ -289,43 +311,43 @@ public function delete($spaceId, $id) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function deleteWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling delete'); + public function deleteWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling delete'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-affiliate/delete"; + $resourcePath = '/subscription-affiliate/delete'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($id)) { @@ -353,20 +375,31 @@ public function deleteWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -376,15 +409,15 @@ public function deleteWithHttpInfo($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the subscription affiliate case which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionAffiliate */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -392,46 +425,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the subscription affiliate case which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/subscription-affiliate/read"; + $resourcePath = '/subscription-affiliate/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -454,20 +487,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionAffiliate', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionAffiliate', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionAffiliate', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -477,15 +521,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the affiliates which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionAffiliate[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -493,43 +537,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the affiliates which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-affiliate/search"; + $resourcePath = '/subscription-affiliate/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -557,20 +601,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionAffiliate[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionAffiliate[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionAffiliate[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -580,15 +635,15 @@ public function searchWithHttpInfo($spaceId, $query) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionAffiliateUpdate $entity The object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionAffiliate */ - public function update($spaceId, $entity) { - return $this->updateWithHttpInfo($spaceId, $entity)->getData(); + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); } /** @@ -596,43 +651,43 @@ public function update($spaceId, $entity) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionAffiliateUpdate $entity The object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function updateWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling update'); + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-affiliate/update"; + $resourcePath = '/subscription-affiliate/update'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -660,24 +715,39 @@ public function updateWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionAffiliate', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionAffiliate', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionAffiliate', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/SubscriptionChargeService.php b/wallee-sdk/lib/Service/SubscriptionChargeService.php index 415e927..1d4208f 100644 --- a/wallee-sdk/lib/Service/SubscriptionChargeService.php +++ b/wallee-sdk/lib/Service/SubscriptionChargeService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-charge/count"; + $resourcePath = '/subscription-charge/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionChargeCreate $charge (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionCharge */ - public function create($spaceId, $charge) { - return $this->createWithHttpInfo($spaceId, $charge)->getData(); + public function create($space_id, $charge) { + return $this->createWithHttpInfo($space_id, $charge)->getData(); } /** @@ -186,43 +197,43 @@ public function create($spaceId, $charge) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionChargeCreate $charge (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $charge) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $charge) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } // verify the required parameter 'charge' is set - if ($charge === null) { + if (is_null($charge)) { throw new \InvalidArgumentException('Missing the required parameter $charge when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-charge/create"; + $resourcePath = '/subscription-charge/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($charge)) { @@ -250,20 +261,31 @@ public function createWithHttpInfo($spaceId, $charge) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionCharge', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionCharge', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionCharge', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -273,15 +295,15 @@ public function createWithHttpInfo($spaceId, $charge) { * * discard * - * @param int $spaceId (required) - * @param int $chargeId (required) + * @param int $space_id (required) + * @param int $charge_id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionCharge */ - public function discard($spaceId, $chargeId) { - return $this->discardWithHttpInfo($spaceId, $chargeId)->getData(); + public function discard($space_id, $charge_id) { + return $this->discardWithHttpInfo($space_id, $charge_id)->getData(); } /** @@ -289,46 +311,46 @@ public function discard($spaceId, $chargeId) { * * discard * - * @param int $spaceId (required) - * @param int $chargeId (required) + * @param int $space_id (required) + * @param int $charge_id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function discardWithHttpInfo($spaceId, $chargeId) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling discard'); + public function discardWithHttpInfo($space_id, $charge_id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling discard'); } - // verify the required parameter 'chargeId' is set - if ($chargeId === null) { - throw new \InvalidArgumentException('Missing the required parameter $chargeId when calling discard'); + // verify the required parameter 'charge_id' is set + if (is_null($charge_id)) { + throw new \InvalidArgumentException('Missing the required parameter $charge_id when calling discard'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($chargeId !== null) { - $queryParams['chargeId'] = $this->apiClient->getSerializer()->toQueryValue($chargeId); + if (!is_null($charge_id)) { + $queryParams['chargeId'] = $this->apiClient->getSerializer()->toQueryValue($charge_id); } // path params - $resourcePath = "/subscription-charge/discard"; + $resourcePath = '/subscription-charge/discard'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -351,20 +373,31 @@ public function discardWithHttpInfo($spaceId, $chargeId) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionCharge', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionCharge', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionCharge', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -374,15 +407,15 @@ public function discardWithHttpInfo($spaceId, $chargeId) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the subscription charge which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionCharge */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -390,46 +423,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the subscription charge which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/subscription-charge/read"; + $resourcePath = '/subscription-charge/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -452,20 +485,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionCharge', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionCharge', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionCharge', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -475,15 +519,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the subscription charges which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionCharge[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -491,43 +535,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the subscription charges which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-charge/search"; + $resourcePath = '/subscription-charge/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -555,20 +599,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionCharge[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionCharge[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionCharge[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/SubscriptionLedgerEntryService.php b/wallee-sdk/lib/Service/SubscriptionLedgerEntryService.php index 88d898b..4dd6bc5 100644 --- a/wallee-sdk/lib/Service/SubscriptionLedgerEntryService.php +++ b/wallee-sdk/lib/Service/SubscriptionLedgerEntryService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-ledger-entry/count"; + $resourcePath = '/subscription-ledger-entry/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionLedgerEntryCreate $entry (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionLedgerEntry */ - public function create($spaceId, $entry) { - return $this->createWithHttpInfo($spaceId, $entry)->getData(); + public function create($space_id, $entry) { + return $this->createWithHttpInfo($space_id, $entry)->getData(); } /** @@ -186,43 +197,43 @@ public function create($spaceId, $entry) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionLedgerEntryCreate $entry (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $entry) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $entry) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } // verify the required parameter 'entry' is set - if ($entry === null) { + if (is_null($entry)) { throw new \InvalidArgumentException('Missing the required parameter $entry when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-ledger-entry/create"; + $resourcePath = '/subscription-ledger-entry/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entry)) { @@ -250,20 +261,31 @@ public function createWithHttpInfo($spaceId, $entry) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionLedgerEntry', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionLedgerEntry', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionLedgerEntry', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -273,15 +295,15 @@ public function createWithHttpInfo($spaceId, $entry) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the subscription charge which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionLedgerEntry */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -289,46 +311,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the subscription charge which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/subscription-ledger-entry/read"; + $resourcePath = '/subscription-ledger-entry/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -351,20 +373,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionLedgerEntry', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionLedgerEntry', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionLedgerEntry', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -374,15 +407,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the subscription charges which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionLedgerEntry[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -390,43 +423,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the subscription charges which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-ledger-entry/search"; + $resourcePath = '/subscription-ledger-entry/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -454,20 +487,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionLedgerEntry[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionLedgerEntry[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionLedgerEntry[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/SubscriptionMetricService.php b/wallee-sdk/lib/Service/SubscriptionMetricService.php index 53f2374..bb1baf2 100644 --- a/wallee-sdk/lib/Service/SubscriptionMetricService.php +++ b/wallee-sdk/lib/Service/SubscriptionMetricService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-metric/count"; + $resourcePath = '/subscription-metric/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionMetricCreate $entity The metric object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionMetric */ - public function create($spaceId, $entity) { - return $this->createWithHttpInfo($spaceId, $entity)->getData(); + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); } /** @@ -186,43 +197,43 @@ public function create($spaceId, $entity) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionMetricCreate $entity The metric object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-metric/create"; + $resourcePath = '/subscription-metric/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -250,20 +261,31 @@ public function createWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionMetric', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionMetric', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionMetric', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -273,15 +295,15 @@ public function createWithHttpInfo($spaceId, $entity) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the metric which should be deleted. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return void */ - public function delete($spaceId, $id) { - return $this->deleteWithHttpInfo($spaceId, $id)->getData(); + public function delete($space_id, $id) { + return $this->deleteWithHttpInfo($space_id, $id)->getData(); } /** @@ -289,43 +311,43 @@ public function delete($spaceId, $id) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the metric which should be deleted. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function deleteWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling delete'); + public function deleteWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling delete'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-metric/delete"; + $resourcePath = '/subscription-metric/delete'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($id)) { @@ -353,20 +375,31 @@ public function deleteWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -376,15 +409,15 @@ public function deleteWithHttpInfo($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the metric which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionMetric */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -392,46 +425,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the metric which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/subscription-metric/read"; + $resourcePath = '/subscription-metric/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -454,20 +487,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionMetric', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionMetric', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionMetric', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -477,15 +521,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the metric which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionMetric[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -493,43 +537,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the metric which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-metric/search"; + $resourcePath = '/subscription-metric/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -557,20 +601,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionMetric[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionMetric[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionMetric[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -580,15 +635,15 @@ public function searchWithHttpInfo($spaceId, $query) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionMetricActive $entity The products metric with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionMetric */ - public function update($spaceId, $entity) { - return $this->updateWithHttpInfo($spaceId, $entity)->getData(); + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); } /** @@ -596,43 +651,43 @@ public function update($spaceId, $entity) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionMetricActive $entity The products metric with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function updateWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling update'); + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-metric/update"; + $resourcePath = '/subscription-metric/update'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -660,24 +715,39 @@ public function updateWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionMetric', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionMetric', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionMetric', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/SubscriptionMetricUsageService.php b/wallee-sdk/lib/Service/SubscriptionMetricUsageService.php index 1deb188..c0390fe 100644 --- a/wallee-sdk/lib/Service/SubscriptionMetricUsageService.php +++ b/wallee-sdk/lib/Service/SubscriptionMetricUsageService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-metric-usage/count"; + $resourcePath = '/subscription-metric-usage/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) - * @param \Wallee\Sdk\Model\SubscriptionMetricUsageReportCreate $usageReport The usage report which should be created. (required) + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\SubscriptionMetricUsageReportCreate $usage_report The usage report which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionMetricUsageReport */ - public function create($spaceId, $usageReport) { - return $this->createWithHttpInfo($spaceId, $usageReport)->getData(); + public function create($space_id, $usage_report) { + return $this->createWithHttpInfo($space_id, $usage_report)->getData(); } /** @@ -186,47 +197,47 @@ public function create($spaceId, $usageReport) { * * Create * - * @param int $spaceId (required) - * @param \Wallee\Sdk\Model\SubscriptionMetricUsageReportCreate $usageReport The usage report which should be created. (required) + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\SubscriptionMetricUsageReportCreate $usage_report The usage report which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $usageReport) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $usage_report) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } - // verify the required parameter 'usageReport' is set - if ($usageReport === null) { - throw new \InvalidArgumentException('Missing the required parameter $usageReport when calling create'); + // verify the required parameter 'usage_report' is set + if (is_null($usage_report)) { + throw new \InvalidArgumentException('Missing the required parameter $usage_report when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-metric-usage/create"; + $resourcePath = '/subscription-metric-usage/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; - if (isset($usageReport)) { - $tempBody = $usageReport; + if (isset($usage_report)) { + $tempBody = $usage_report; } // for model (json/xml) @@ -250,20 +261,31 @@ public function createWithHttpInfo($spaceId, $usageReport) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionMetricUsageReport', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionMetricUsageReport', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionMetricUsageReport', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -273,15 +295,15 @@ public function createWithHttpInfo($spaceId, $usageReport) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the usage report which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionMetricUsageReport */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -289,46 +311,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the usage report which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/subscription-metric-usage/read"; + $resourcePath = '/subscription-metric-usage/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -351,20 +373,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionMetricUsageReport', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionMetricUsageReport', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionMetricUsageReport', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -374,15 +407,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the usage reports which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionMetricUsageReport[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -390,43 +423,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the usage reports which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-metric-usage/search"; + $resourcePath = '/subscription-metric-usage/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -454,20 +487,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionMetricUsageReport[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionMetricUsageReport[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionMetricUsageReport[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/SubscriptionPeriodBillService.php b/wallee-sdk/lib/Service/SubscriptionPeriodBillService.php index e882319..b1f17ab 100644 --- a/wallee-sdk/lib/Service/SubscriptionPeriodBillService.php +++ b/wallee-sdk/lib/Service/SubscriptionPeriodBillService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-period-bill/count"; + $resourcePath = '/subscription-period-bill/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the subscription period bill which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException - * @return \Wallee\Sdk\Model\SubscriptionVersion + * @return \Wallee\Sdk\Model\SubscriptionPeriodBill */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -186,46 +197,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the subscription period bill which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/subscription-period-bill/read"; + $resourcePath = '/subscription-period-bill/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -242,26 +253,37 @@ public function readWithHttpInfo($spaceId, $id) { $queryParams, $httpBody, $headerParams, - '\Wallee\Sdk\Model\SubscriptionVersion', + '\Wallee\Sdk\Model\SubscriptionPeriodBill', '/subscription-period-bill/read' ); - return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionVersion', $response->getHeaders())); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionPeriodBill', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionVersion', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionPeriodBill', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -271,15 +293,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the subscription period bills which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException - * @return \Wallee\Sdk\Model\SubscriptionVersion[] + * @return \Wallee\Sdk\Model\SubscriptionPeriodBill[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -287,43 +309,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the subscription period bills which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-period-bill/search"; + $resourcePath = '/subscription-period-bill/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -345,26 +367,37 @@ public function searchWithHttpInfo($spaceId, $query) { $queryParams, $httpBody, $headerParams, - '\Wallee\Sdk\Model\SubscriptionVersion[]', + '\Wallee\Sdk\Model\SubscriptionPeriodBill[]', '/subscription-period-bill/search' ); - return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionVersion[]', $response->getHeaders())); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionPeriodBill[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionVersion[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionPeriodBill[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/SubscriptionProductComponentGroupService.php b/wallee-sdk/lib/Service/SubscriptionProductComponentGroupService.php index faf13fb..41b478e 100644 --- a/wallee-sdk/lib/Service/SubscriptionProductComponentGroupService.php +++ b/wallee-sdk/lib/Service/SubscriptionProductComponentGroupService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-component-group/count"; + $resourcePath = '/subscription-product-component-group/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionProductComponentGroupUpdate $entity The product component group object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionProductComponentGroup */ - public function create($spaceId, $entity) { - return $this->createWithHttpInfo($spaceId, $entity)->getData(); + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); } /** @@ -186,43 +197,43 @@ public function create($spaceId, $entity) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionProductComponentGroupUpdate $entity The product component group object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-component-group/create"; + $resourcePath = '/subscription-product-component-group/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -250,20 +261,31 @@ public function createWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProductComponentGroup', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProductComponentGroup', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProductComponentGroup', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -273,15 +295,15 @@ public function createWithHttpInfo($spaceId, $entity) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return void */ - public function delete($spaceId, $id) { - return $this->deleteWithHttpInfo($spaceId, $id)->getData(); + public function delete($space_id, $id) { + return $this->deleteWithHttpInfo($space_id, $id)->getData(); } /** @@ -289,43 +311,43 @@ public function delete($spaceId, $id) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function deleteWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling delete'); + public function deleteWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling delete'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-component-group/delete"; + $resourcePath = '/subscription-product-component-group/delete'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($id)) { @@ -353,20 +375,31 @@ public function deleteWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -376,15 +409,15 @@ public function deleteWithHttpInfo($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the product component group which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionProductComponentGroup */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -392,46 +425,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the product component group which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/subscription-product-component-group/read"; + $resourcePath = '/subscription-product-component-group/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -454,20 +487,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProductComponentGroup', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProductComponentGroup', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProductComponentGroup', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -477,15 +521,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the product component groups which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionProductComponentGroup[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -493,43 +537,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the product component groups which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-component-group/search"; + $resourcePath = '/subscription-product-component-group/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -557,20 +601,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProductComponentGroup[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProductComponentGroup[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProductComponentGroup[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -580,15 +635,15 @@ public function searchWithHttpInfo($spaceId, $query) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionProductComponentGroupUpdate $entity The product component group object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionProductComponentGroup */ - public function update($spaceId, $entity) { - return $this->updateWithHttpInfo($spaceId, $entity)->getData(); + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); } /** @@ -596,43 +651,43 @@ public function update($spaceId, $entity) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionProductComponentGroupUpdate $entity The product component group object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function updateWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling update'); + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-component-group/update"; + $resourcePath = '/subscription-product-component-group/update'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -660,24 +715,39 @@ public function updateWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProductComponentGroup', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProductComponentGroup', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProductComponentGroup', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/SubscriptionProductComponentService.php b/wallee-sdk/lib/Service/SubscriptionProductComponentService.php index a549f34..b9a3546 100644 --- a/wallee-sdk/lib/Service/SubscriptionProductComponentService.php +++ b/wallee-sdk/lib/Service/SubscriptionProductComponentService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-component/count"; + $resourcePath = '/subscription-product-component/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionProductComponentUpdate $entity The product component object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionProductComponent */ - public function create($spaceId, $entity) { - return $this->createWithHttpInfo($spaceId, $entity)->getData(); + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); } /** @@ -186,43 +197,43 @@ public function create($spaceId, $entity) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionProductComponentUpdate $entity The product component object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-component/create"; + $resourcePath = '/subscription-product-component/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -250,20 +261,31 @@ public function createWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProductComponent', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProductComponent', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProductComponent', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -273,15 +295,15 @@ public function createWithHttpInfo($spaceId, $entity) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return void */ - public function delete($spaceId, $id) { - return $this->deleteWithHttpInfo($spaceId, $id)->getData(); + public function delete($space_id, $id) { + return $this->deleteWithHttpInfo($space_id, $id)->getData(); } /** @@ -289,43 +311,43 @@ public function delete($spaceId, $id) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function deleteWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling delete'); + public function deleteWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling delete'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-component/delete"; + $resourcePath = '/subscription-product-component/delete'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($id)) { @@ -353,20 +375,31 @@ public function deleteWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -376,15 +409,15 @@ public function deleteWithHttpInfo($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the product component which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionProductComponent */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -392,46 +425,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the product component which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/subscription-product-component/read"; + $resourcePath = '/subscription-product-component/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -454,20 +487,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProductComponent', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProductComponent', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProductComponent', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -477,15 +521,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the product component which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionProductComponent[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -493,43 +537,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the product component which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-component/search"; + $resourcePath = '/subscription-product-component/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -557,20 +601,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProductComponent[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProductComponent[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProductComponent[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -580,15 +635,15 @@ public function searchWithHttpInfo($spaceId, $query) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionProductComponentUpdate $entity The product component object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionProductComponent */ - public function update($spaceId, $entity) { - return $this->updateWithHttpInfo($spaceId, $entity)->getData(); + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); } /** @@ -596,43 +651,43 @@ public function update($spaceId, $entity) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionProductComponentUpdate $entity The product component object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function updateWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling update'); + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-component/update"; + $resourcePath = '/subscription-product-component/update'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -660,24 +715,39 @@ public function updateWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProductComponent', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProductComponent', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProductComponent', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/SubscriptionProductFeeTierService.php b/wallee-sdk/lib/Service/SubscriptionProductFeeTierService.php index d93b300..5f1ba77 100644 --- a/wallee-sdk/lib/Service/SubscriptionProductFeeTierService.php +++ b/wallee-sdk/lib/Service/SubscriptionProductFeeTierService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-fee-tier/count"; + $resourcePath = '/subscription-product-fee-tier/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\ProductMeteredTierFeeUpdate $entity The metered fee tier object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ProductMeteredTierFee */ - public function create($spaceId, $entity) { - return $this->createWithHttpInfo($spaceId, $entity)->getData(); + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); } /** @@ -186,43 +197,43 @@ public function create($spaceId, $entity) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\ProductMeteredTierFeeUpdate $entity The metered fee tier object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-fee-tier/create"; + $resourcePath = '/subscription-product-fee-tier/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -250,20 +261,31 @@ public function createWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ProductMeteredTierFee', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ProductMeteredTierFee', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ProductMeteredTierFee', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -273,15 +295,15 @@ public function createWithHttpInfo($spaceId, $entity) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return void */ - public function delete($spaceId, $id) { - return $this->deleteWithHttpInfo($spaceId, $id)->getData(); + public function delete($space_id, $id) { + return $this->deleteWithHttpInfo($space_id, $id)->getData(); } /** @@ -289,43 +311,43 @@ public function delete($spaceId, $id) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function deleteWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling delete'); + public function deleteWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling delete'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-fee-tier/delete"; + $resourcePath = '/subscription-product-fee-tier/delete'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($id)) { @@ -353,20 +375,31 @@ public function deleteWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -376,15 +409,15 @@ public function deleteWithHttpInfo($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the metered fee tier which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ProductMeteredTierFee */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -392,46 +425,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the metered fee tier which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/subscription-product-fee-tier/read"; + $resourcePath = '/subscription-product-fee-tier/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -454,20 +487,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ProductMeteredTierFee', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ProductMeteredTierFee', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ProductMeteredTierFee', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -477,15 +521,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the metered fee tiers which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ProductMeteredTierFee[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -493,43 +537,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the metered fee tiers which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-fee-tier/search"; + $resourcePath = '/subscription-product-fee-tier/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -557,20 +601,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ProductMeteredTierFee[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ProductMeteredTierFee[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ProductMeteredTierFee[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -580,15 +635,15 @@ public function searchWithHttpInfo($spaceId, $query) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\ProductMeteredTierFeeUpdate $entity The metered fee tier object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ProductMeteredTierFee */ - public function update($spaceId, $entity) { - return $this->updateWithHttpInfo($spaceId, $entity)->getData(); + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); } /** @@ -596,43 +651,43 @@ public function update($spaceId, $entity) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\ProductMeteredTierFeeUpdate $entity The metered fee tier object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function updateWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling update'); + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-fee-tier/update"; + $resourcePath = '/subscription-product-fee-tier/update'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -660,24 +715,39 @@ public function updateWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ProductMeteredTierFee', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ProductMeteredTierFee', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ProductMeteredTierFee', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/SubscriptionProductMeteredFeeService.php b/wallee-sdk/lib/Service/SubscriptionProductMeteredFeeService.php index 9791a00..a815d78 100644 --- a/wallee-sdk/lib/Service/SubscriptionProductMeteredFeeService.php +++ b/wallee-sdk/lib/Service/SubscriptionProductMeteredFeeService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-metered-fee/count"; + $resourcePath = '/subscription-product-metered-fee/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\ProductMeteredFeeUpdate $entity The metered fee object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ProductMeteredFee */ - public function create($spaceId, $entity) { - return $this->createWithHttpInfo($spaceId, $entity)->getData(); + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); } /** @@ -186,43 +197,43 @@ public function create($spaceId, $entity) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\ProductMeteredFeeUpdate $entity The metered fee object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-metered-fee/create"; + $resourcePath = '/subscription-product-metered-fee/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -250,20 +261,31 @@ public function createWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ProductMeteredFee', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ProductMeteredFee', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ProductMeteredFee', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -273,15 +295,15 @@ public function createWithHttpInfo($spaceId, $entity) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return void */ - public function delete($spaceId, $id) { - return $this->deleteWithHttpInfo($spaceId, $id)->getData(); + public function delete($space_id, $id) { + return $this->deleteWithHttpInfo($space_id, $id)->getData(); } /** @@ -289,43 +311,43 @@ public function delete($spaceId, $id) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function deleteWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling delete'); + public function deleteWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling delete'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-metered-fee/delete"; + $resourcePath = '/subscription-product-metered-fee/delete'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($id)) { @@ -353,20 +375,31 @@ public function deleteWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -376,15 +409,15 @@ public function deleteWithHttpInfo($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the metered fee which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ProductMeteredFee */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -392,46 +425,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the metered fee which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/subscription-product-metered-fee/read"; + $resourcePath = '/subscription-product-metered-fee/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -454,20 +487,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ProductMeteredFee', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ProductMeteredFee', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ProductMeteredFee', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -477,15 +521,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the metered fees which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ProductMeteredFee[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -493,43 +537,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the metered fees which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-metered-fee/search"; + $resourcePath = '/subscription-product-metered-fee/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -557,20 +601,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ProductMeteredFee[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ProductMeteredFee[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ProductMeteredFee[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -580,15 +635,15 @@ public function searchWithHttpInfo($spaceId, $query) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\ProductMeteredFeeUpdate $entity The metered fee object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ProductMeteredFee */ - public function update($spaceId, $entity) { - return $this->updateWithHttpInfo($spaceId, $entity)->getData(); + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); } /** @@ -596,43 +651,43 @@ public function update($spaceId, $entity) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\ProductMeteredFeeUpdate $entity The metered fee object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function updateWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling update'); + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-metered-fee/update"; + $resourcePath = '/subscription-product-metered-fee/update'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -660,24 +715,39 @@ public function updateWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ProductMeteredFee', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ProductMeteredFee', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ProductMeteredFee', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/SubscriptionProductPeriodFeeService.php b/wallee-sdk/lib/Service/SubscriptionProductPeriodFeeService.php index 8597c3b..dcaee6f 100644 --- a/wallee-sdk/lib/Service/SubscriptionProductPeriodFeeService.php +++ b/wallee-sdk/lib/Service/SubscriptionProductPeriodFeeService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-period-fee/count"; + $resourcePath = '/subscription-product-period-fee/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\ProductPeriodFeeUpdate $entity The period fee object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ProductPeriodFee */ - public function create($spaceId, $entity) { - return $this->createWithHttpInfo($spaceId, $entity)->getData(); + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); } /** @@ -186,43 +197,43 @@ public function create($spaceId, $entity) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\ProductPeriodFeeUpdate $entity The period fee object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-period-fee/create"; + $resourcePath = '/subscription-product-period-fee/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -250,20 +261,31 @@ public function createWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ProductPeriodFee', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ProductPeriodFee', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ProductPeriodFee', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -273,15 +295,15 @@ public function createWithHttpInfo($spaceId, $entity) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return void */ - public function delete($spaceId, $id) { - return $this->deleteWithHttpInfo($spaceId, $id)->getData(); + public function delete($space_id, $id) { + return $this->deleteWithHttpInfo($space_id, $id)->getData(); } /** @@ -289,43 +311,43 @@ public function delete($spaceId, $id) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function deleteWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling delete'); + public function deleteWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling delete'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-period-fee/delete"; + $resourcePath = '/subscription-product-period-fee/delete'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($id)) { @@ -353,20 +375,31 @@ public function deleteWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -376,15 +409,15 @@ public function deleteWithHttpInfo($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the period fee which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ProductPeriodFee */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -392,46 +425,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the period fee which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/subscription-product-period-fee/read"; + $resourcePath = '/subscription-product-period-fee/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -454,20 +487,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ProductPeriodFee', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ProductPeriodFee', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ProductPeriodFee', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -477,15 +521,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the period fees which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ProductPeriodFee[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -493,43 +537,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the period fees which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-period-fee/search"; + $resourcePath = '/subscription-product-period-fee/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -557,20 +601,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ProductPeriodFee[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ProductPeriodFee[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ProductPeriodFee[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -580,15 +635,15 @@ public function searchWithHttpInfo($spaceId, $query) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\ProductPeriodFeeUpdate $entity The period fee object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ProductPeriodFee */ - public function update($spaceId, $entity) { - return $this->updateWithHttpInfo($spaceId, $entity)->getData(); + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); } /** @@ -596,43 +651,43 @@ public function update($spaceId, $entity) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\ProductPeriodFeeUpdate $entity The period fee object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function updateWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling update'); + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-period-fee/update"; + $resourcePath = '/subscription-product-period-fee/update'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -660,24 +715,39 @@ public function updateWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ProductPeriodFee', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ProductPeriodFee', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ProductPeriodFee', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/SubscriptionProductRetirementService.php b/wallee-sdk/lib/Service/SubscriptionProductRetirementService.php index 2194cde..593fc5d 100644 --- a/wallee-sdk/lib/Service/SubscriptionProductRetirementService.php +++ b/wallee-sdk/lib/Service/SubscriptionProductRetirementService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-retirement/count"; + $resourcePath = '/subscription-product-retirement/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionProductRetirementCreate $retirement (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionProductRetirement */ - public function create($spaceId, $retirement) { - return $this->createWithHttpInfo($spaceId, $retirement)->getData(); + public function create($space_id, $retirement) { + return $this->createWithHttpInfo($space_id, $retirement)->getData(); } /** @@ -186,43 +197,43 @@ public function create($spaceId, $retirement) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionProductRetirementCreate $retirement (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $retirement) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $retirement) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } // verify the required parameter 'retirement' is set - if ($retirement === null) { + if (is_null($retirement)) { throw new \InvalidArgumentException('Missing the required parameter $retirement when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-retirement/create"; + $resourcePath = '/subscription-product-retirement/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($retirement)) { @@ -250,20 +261,31 @@ public function createWithHttpInfo($spaceId, $retirement) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProductRetirement', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProductRetirement', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProductRetirement', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -273,15 +295,15 @@ public function createWithHttpInfo($spaceId, $retirement) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the retirement which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionProductRetirement */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -289,46 +311,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the retirement which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/subscription-product-retirement/read"; + $resourcePath = '/subscription-product-retirement/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -351,20 +373,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProductRetirement', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProductRetirement', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProductRetirement', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -374,15 +407,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the product retirements which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionProductRetirement[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -390,43 +423,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the product retirements which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-retirement/search"; + $resourcePath = '/subscription-product-retirement/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -454,20 +487,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProductRetirement[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProductRetirement[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProductRetirement[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/SubscriptionProductService.php b/wallee-sdk/lib/Service/SubscriptionProductService.php index 460d4bd..d1f1419 100644 --- a/wallee-sdk/lib/Service/SubscriptionProductService.php +++ b/wallee-sdk/lib/Service/SubscriptionProductService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product/count"; + $resourcePath = '/subscription-product/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionProductCreate $entity The product object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionProduct */ - public function create($spaceId, $entity) { - return $this->createWithHttpInfo($spaceId, $entity)->getData(); + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); } /** @@ -186,43 +197,43 @@ public function create($spaceId, $entity) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionProductCreate $entity The product object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product/create"; + $resourcePath = '/subscription-product/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -250,20 +261,31 @@ public function createWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProduct', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProduct', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProduct', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -273,15 +295,15 @@ public function createWithHttpInfo($spaceId, $entity) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the product which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionProduct */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -289,46 +311,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the product which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/subscription-product/read"; + $resourcePath = '/subscription-product/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -351,20 +373,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProduct', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProduct', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProduct', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -374,15 +407,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the products which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionProduct[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -390,43 +423,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the products which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product/search"; + $resourcePath = '/subscription-product/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -454,20 +487,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProduct[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProduct[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProduct[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -477,15 +521,15 @@ public function searchWithHttpInfo($spaceId, $query) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionProductActive $entity The products object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionProduct */ - public function update($spaceId, $entity) { - return $this->updateWithHttpInfo($spaceId, $entity)->getData(); + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); } /** @@ -493,43 +537,43 @@ public function update($spaceId, $entity) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionProductActive $entity The products object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function updateWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling update'); + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product/update"; + $resourcePath = '/subscription-product/update'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -557,24 +601,39 @@ public function updateWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProduct', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProduct', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProduct', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/SubscriptionProductSetupFeeService.php b/wallee-sdk/lib/Service/SubscriptionProductSetupFeeService.php index 6b67ff6..5d08f5e 100644 --- a/wallee-sdk/lib/Service/SubscriptionProductSetupFeeService.php +++ b/wallee-sdk/lib/Service/SubscriptionProductSetupFeeService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-setup-fee/count"; + $resourcePath = '/subscription-product-setup-fee/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\ProductSetupFeeUpdate $entity The setup fee object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ProductSetupFee */ - public function create($spaceId, $entity) { - return $this->createWithHttpInfo($spaceId, $entity)->getData(); + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); } /** @@ -186,43 +197,43 @@ public function create($spaceId, $entity) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\ProductSetupFeeUpdate $entity The setup fee object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-setup-fee/create"; + $resourcePath = '/subscription-product-setup-fee/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -250,20 +261,31 @@ public function createWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ProductSetupFee', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ProductSetupFee', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ProductSetupFee', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -273,15 +295,15 @@ public function createWithHttpInfo($spaceId, $entity) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return void */ - public function delete($spaceId, $id) { - return $this->deleteWithHttpInfo($spaceId, $id)->getData(); + public function delete($space_id, $id) { + return $this->deleteWithHttpInfo($space_id, $id)->getData(); } /** @@ -289,43 +311,43 @@ public function delete($spaceId, $id) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function deleteWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling delete'); + public function deleteWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling delete'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-setup-fee/delete"; + $resourcePath = '/subscription-product-setup-fee/delete'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($id)) { @@ -353,20 +375,31 @@ public function deleteWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -376,15 +409,15 @@ public function deleteWithHttpInfo($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the setup fee which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ProductSetupFee */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -392,46 +425,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the setup fee which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/subscription-product-setup-fee/read"; + $resourcePath = '/subscription-product-setup-fee/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -454,20 +487,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ProductSetupFee', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ProductSetupFee', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ProductSetupFee', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -477,15 +521,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the setup fees which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ProductSetupFee[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -493,43 +537,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the setup fees which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-setup-fee/search"; + $resourcePath = '/subscription-product-setup-fee/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -557,20 +601,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ProductSetupFee[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ProductSetupFee[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ProductSetupFee[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -580,15 +635,15 @@ public function searchWithHttpInfo($spaceId, $query) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\ProductSetupFeeUpdate $entity The setup fee object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\ProductSetupFee */ - public function update($spaceId, $entity) { - return $this->updateWithHttpInfo($spaceId, $entity)->getData(); + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); } /** @@ -596,43 +651,43 @@ public function update($spaceId, $entity) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\ProductSetupFeeUpdate $entity The setup fee object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function updateWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling update'); + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-setup-fee/update"; + $resourcePath = '/subscription-product-setup-fee/update'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -660,24 +715,39 @@ public function updateWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\ProductSetupFee', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ProductSetupFee', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ProductSetupFee', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/SubscriptionProductVersionRetirementService.php b/wallee-sdk/lib/Service/SubscriptionProductVersionRetirementService.php index 2fb6b31..a4fcceb 100644 --- a/wallee-sdk/lib/Service/SubscriptionProductVersionRetirementService.php +++ b/wallee-sdk/lib/Service/SubscriptionProductVersionRetirementService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-version-retirement/count"; + $resourcePath = '/subscription-product-version-retirement/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionProductVersionRetirementCreate $retirement (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionProductVersionRetirement */ - public function create($spaceId, $retirement) { - return $this->createWithHttpInfo($spaceId, $retirement)->getData(); + public function create($space_id, $retirement) { + return $this->createWithHttpInfo($space_id, $retirement)->getData(); } /** @@ -186,43 +197,43 @@ public function create($spaceId, $retirement) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionProductVersionRetirementCreate $retirement (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $retirement) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $retirement) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } // verify the required parameter 'retirement' is set - if ($retirement === null) { + if (is_null($retirement)) { throw new \InvalidArgumentException('Missing the required parameter $retirement when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-version-retirement/create"; + $resourcePath = '/subscription-product-version-retirement/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($retirement)) { @@ -250,20 +261,31 @@ public function createWithHttpInfo($spaceId, $retirement) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProductVersionRetirement', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProductVersionRetirement', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProductVersionRetirement', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -273,15 +295,15 @@ public function createWithHttpInfo($spaceId, $retirement) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the retirement which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionProductVersionRetirement */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -289,46 +311,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the retirement which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/subscription-product-version-retirement/read"; + $resourcePath = '/subscription-product-version-retirement/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -351,20 +373,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProductVersionRetirement', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProductVersionRetirement', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProductVersionRetirement', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -374,15 +407,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the product version retirements which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionProductVersionRetirement[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -390,43 +423,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the product version retirements which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-version-retirement/search"; + $resourcePath = '/subscription-product-version-retirement/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -454,20 +487,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProductVersionRetirement[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProductVersionRetirement[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProductVersionRetirement[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/SubscriptionProductVersionService.php b/wallee-sdk/lib/Service/SubscriptionProductVersionService.php index 0e8bb88..548f17f 100644 --- a/wallee-sdk/lib/Service/SubscriptionProductVersionService.php +++ b/wallee-sdk/lib/Service/SubscriptionProductVersionService.php @@ -1,10 +1,8 @@ activateWithHttpInfo($spaceId, $productVersionId)->getData(); + public function activate($space_id, $product_version_id) { + return $this->activateWithHttpInfo($space_id, $product_version_id)->getData(); } /** @@ -87,46 +87,46 @@ public function activate($spaceId, $productVersionId) { * * activate * - * @param int $spaceId (required) - * @param int $productVersionId The product version id identifies the product version which should be activated. (required) + * @param int $space_id (required) + * @param int $product_version_id The product version id identifies the product version which should be activated. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function activateWithHttpInfo($spaceId, $productVersionId) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling activate'); + public function activateWithHttpInfo($space_id, $product_version_id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling activate'); } - // verify the required parameter 'productVersionId' is set - if ($productVersionId === null) { - throw new \InvalidArgumentException('Missing the required parameter $productVersionId when calling activate'); + // verify the required parameter 'product_version_id' is set + if (is_null($product_version_id)) { + throw new \InvalidArgumentException('Missing the required parameter $product_version_id when calling activate'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($productVersionId !== null) { - $queryParams['productVersionId'] = $this->apiClient->getSerializer()->toQueryValue($productVersionId); + if (!is_null($product_version_id)) { + $queryParams['productVersionId'] = $this->apiClient->getSerializer()->toQueryValue($product_version_id); } // path params - $resourcePath = "/subscription-product-version/activate"; + $resourcePath = '/subscription-product-version/activate'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -149,20 +149,31 @@ public function activateWithHttpInfo($spaceId, $productVersionId) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProductVersion', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProductVersion', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProductVersion', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -172,15 +183,15 @@ public function activateWithHttpInfo($spaceId, $productVersionId) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return int */ - public function count($spaceId, $filter = null) { - return $this->countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -188,39 +199,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-version/count"; + $resourcePath = '/subscription-product-version/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -248,20 +259,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -271,15 +293,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionProductVersionPending $entity The product version object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionProductVersion */ - public function create($spaceId, $entity) { - return $this->createWithHttpInfo($spaceId, $entity)->getData(); + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); } /** @@ -287,43 +309,43 @@ public function create($spaceId, $entity) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionProductVersionPending $entity The product version object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-version/create"; + $resourcePath = '/subscription-product-version/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -351,20 +373,31 @@ public function createWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProductVersion', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProductVersion', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProductVersion', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -374,15 +407,15 @@ public function createWithHttpInfo($spaceId, $entity) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the product version which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionProductVersion */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -390,46 +423,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the product version which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/subscription-product-version/read"; + $resourcePath = '/subscription-product-version/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -452,20 +485,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProductVersion', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProductVersion', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProductVersion', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -475,15 +519,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the product versions which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionProductVersion[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -491,43 +535,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the product versions which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-version/search"; + $resourcePath = '/subscription-product-version/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -555,20 +599,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProductVersion[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProductVersion[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProductVersion[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -578,15 +633,15 @@ public function searchWithHttpInfo($spaceId, $query) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionProductVersionPending $entity The product version object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionProductVersion */ - public function update($spaceId, $entity) { - return $this->updateWithHttpInfo($spaceId, $entity)->getData(); + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); } /** @@ -594,43 +649,43 @@ public function update($spaceId, $entity) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionProductVersionPending $entity The product version object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function updateWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling update'); + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-product-version/update"; + $resourcePath = '/subscription-product-version/update'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -658,24 +713,39 @@ public function updateWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionProductVersion', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionProductVersion', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionProductVersion', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/SubscriptionService.php b/wallee-sdk/lib/Service/SubscriptionService.php index 0d1a1c3..29e276d 100644 --- a/wallee-sdk/lib/Service/SubscriptionService.php +++ b/wallee-sdk/lib/Service/SubscriptionService.php @@ -1,10 +1,8 @@ applyChangesWithHttpInfo($spaceId, $request)->getData(); + public function applyChanges($space_id, $request) { + return $this->applyChangesWithHttpInfo($space_id, $request)->getData(); } /** @@ -87,43 +87,43 @@ public function applyChanges($spaceId, $request) { * * apply changes * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionChangeRequest $request (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function applyChangesWithHttpInfo($spaceId, $request) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling applyChanges'); + public function applyChangesWithHttpInfo($space_id, $request) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling applyChanges'); } // verify the required parameter 'request' is set - if ($request === null) { + if (is_null($request)) { throw new \InvalidArgumentException('Missing the required parameter $request when calling applyChanges'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription/applyChanges"; + $resourcePath = '/subscription/applyChanges'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($request)) { @@ -151,24 +151,39 @@ public function applyChangesWithHttpInfo($spaceId, $request) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionVersion', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionVersion', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionVersion', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -178,15 +193,15 @@ public function applyChangesWithHttpInfo($spaceId, $request) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return int */ - public function count($spaceId, $filter = null) { - return $this->countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -194,39 +209,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription/count"; + $resourcePath = '/subscription/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -254,20 +269,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -277,15 +303,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) - * @param \Wallee\Sdk\Model\SubscriptionCreateRequest $createRequest (required) + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\SubscriptionCreateRequest $create_request (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionVersion */ - public function create($spaceId, $createRequest) { - return $this->createWithHttpInfo($spaceId, $createRequest)->getData(); + public function create($space_id, $create_request) { + return $this->createWithHttpInfo($space_id, $create_request)->getData(); } /** @@ -293,47 +319,47 @@ public function create($spaceId, $createRequest) { * * Create * - * @param int $spaceId (required) - * @param \Wallee\Sdk\Model\SubscriptionCreateRequest $createRequest (required) + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\SubscriptionCreateRequest $create_request (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $createRequest) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $create_request) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } - // verify the required parameter 'createRequest' is set - if ($createRequest === null) { - throw new \InvalidArgumentException('Missing the required parameter $createRequest when calling create'); + // verify the required parameter 'create_request' is set + if (is_null($create_request)) { + throw new \InvalidArgumentException('Missing the required parameter $create_request when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription/create"; + $resourcePath = '/subscription/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; - if (isset($createRequest)) { - $tempBody = $createRequest; + if (isset($create_request)) { + $tempBody = $create_request; } // for model (json/xml) @@ -357,20 +383,31 @@ public function createWithHttpInfo($spaceId, $createRequest) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionVersion', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionVersion', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionVersion', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -380,15 +417,15 @@ public function createWithHttpInfo($spaceId, $createRequest) { * * initialize * - * @param int $spaceId (required) - * @param int $subscriptionId The provided subscription id will be used to lookup the subscription which should be initialized. (required) + * @param int $space_id (required) + * @param int $subscription_id The provided subscription id will be used to lookup the subscription which should be initialized. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionCharge */ - public function initialize($spaceId, $subscriptionId) { - return $this->initializeWithHttpInfo($spaceId, $subscriptionId)->getData(); + public function initialize($space_id, $subscription_id) { + return $this->initializeWithHttpInfo($space_id, $subscription_id)->getData(); } /** @@ -396,46 +433,46 @@ public function initialize($spaceId, $subscriptionId) { * * initialize * - * @param int $spaceId (required) - * @param int $subscriptionId The provided subscription id will be used to lookup the subscription which should be initialized. (required) + * @param int $space_id (required) + * @param int $subscription_id The provided subscription id will be used to lookup the subscription which should be initialized. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function initializeWithHttpInfo($spaceId, $subscriptionId) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling initialize'); + public function initializeWithHttpInfo($space_id, $subscription_id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling initialize'); } - // verify the required parameter 'subscriptionId' is set - if ($subscriptionId === null) { - throw new \InvalidArgumentException('Missing the required parameter $subscriptionId when calling initialize'); + // verify the required parameter 'subscription_id' is set + if (is_null($subscription_id)) { + throw new \InvalidArgumentException('Missing the required parameter $subscription_id when calling initialize'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($subscriptionId !== null) { - $queryParams['subscriptionId'] = $this->apiClient->getSerializer()->toQueryValue($subscriptionId); + if (!is_null($subscription_id)) { + $queryParams['subscriptionId'] = $this->apiClient->getSerializer()->toQueryValue($subscription_id); } // path params - $resourcePath = "/subscription/initialize"; + $resourcePath = '/subscription/initialize'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -458,20 +495,31 @@ public function initializeWithHttpInfo($spaceId, $subscriptionId) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionCharge', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionCharge', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionCharge', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -481,17 +529,17 @@ public function initializeWithHttpInfo($spaceId, $subscriptionId) { * * initializeSubscriberPresent * - * @param int $spaceId (required) - * @param int $subscriptionId (required) - * @param string $successUrl The subscriber will be redirected to the success URL when the transaction is successful. (optional) - * @param string $failedUrl The subscriber will be redirected to the fail URL when the transaction fails. (optional) + * @param int $space_id (required) + * @param int $subscription_id (required) + * @param string $success_url The subscriber will be redirected to the success URL when the transaction is successful. (optional) + * @param string $failed_url The subscriber will be redirected to the fail URL when the transaction fails. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionCharge */ - public function initializeSubscriberPresent($spaceId, $subscriptionId, $successUrl = null, $failedUrl = null) { - return $this->initializeSubscriberPresentWithHttpInfo($spaceId, $subscriptionId, $successUrl, $failedUrl)->getData(); + public function initializeSubscriberPresent($space_id, $subscription_id, $success_url = null, $failed_url = null) { + return $this->initializeSubscriberPresentWithHttpInfo($space_id, $subscription_id, $success_url, $failed_url)->getData(); } /** @@ -499,54 +547,54 @@ public function initializeSubscriberPresent($spaceId, $subscriptionId, $successU * * initializeSubscriberPresent * - * @param int $spaceId (required) - * @param int $subscriptionId (required) - * @param string $successUrl The subscriber will be redirected to the success URL when the transaction is successful. (optional) - * @param string $failedUrl The subscriber will be redirected to the fail URL when the transaction fails. (optional) + * @param int $space_id (required) + * @param int $subscription_id (required) + * @param string $success_url The subscriber will be redirected to the success URL when the transaction is successful. (optional) + * @param string $failed_url The subscriber will be redirected to the fail URL when the transaction fails. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function initializeSubscriberPresentWithHttpInfo($spaceId, $subscriptionId, $successUrl = null, $failedUrl = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling initializeSubscriberPresent'); + public function initializeSubscriberPresentWithHttpInfo($space_id, $subscription_id, $success_url = null, $failed_url = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling initializeSubscriberPresent'); } - // verify the required parameter 'subscriptionId' is set - if ($subscriptionId === null) { - throw new \InvalidArgumentException('Missing the required parameter $subscriptionId when calling initializeSubscriberPresent'); + // verify the required parameter 'subscription_id' is set + if (is_null($subscription_id)) { + throw new \InvalidArgumentException('Missing the required parameter $subscription_id when calling initializeSubscriberPresent'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($subscriptionId !== null) { - $queryParams['subscriptionId'] = $this->apiClient->getSerializer()->toQueryValue($subscriptionId); + if (!is_null($subscription_id)) { + $queryParams['subscriptionId'] = $this->apiClient->getSerializer()->toQueryValue($subscription_id); } - if ($successUrl !== null) { - $queryParams['successUrl'] = $this->apiClient->getSerializer()->toQueryValue($successUrl); + if (!is_null($success_url)) { + $queryParams['successUrl'] = $this->apiClient->getSerializer()->toQueryValue($success_url); } - if ($failedUrl !== null) { - $queryParams['failedUrl'] = $this->apiClient->getSerializer()->toQueryValue($failedUrl); + if (!is_null($failed_url)) { + $queryParams['failedUrl'] = $this->apiClient->getSerializer()->toQueryValue($failed_url); } // path params - $resourcePath = "/subscription/initializeSubscriberPresent"; + $resourcePath = '/subscription/initializeSubscriberPresent'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -569,24 +617,39 @@ public function initializeSubscriberPresentWithHttpInfo($spaceId, $subscriptionI return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionCharge', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionCharge', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionCharge', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -596,15 +659,15 @@ public function initializeSubscriberPresentWithHttpInfo($spaceId, $subscriptionI * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the subscription which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\Subscription */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -612,46 +675,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the subscription which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/subscription/read"; + $resourcePath = '/subscription/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -674,20 +737,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Subscription', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Subscription', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Subscription', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -697,15 +771,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the subscriptions which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\Subscription[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -713,43 +787,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the subscriptions which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription/search"; + $resourcePath = '/subscription/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -777,20 +851,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Subscription[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Subscription[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Subscription[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -800,16 +885,16 @@ public function searchWithHttpInfo($spaceId, $query) { * * Search Subscription Invoices * - * @param int $spaceId (required) - * @param int $subscriptionId The id of the subscription for which the invoices should be searched for. (required) + * @param int $space_id (required) + * @param int $subscription_id The id of the subscription for which the invoices should be searched for. (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the invoices which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\TransactionInvoice[] */ - public function searchSubscriptionInvoices($spaceId, $subscriptionId, $query) { - return $this->searchSubscriptionInvoicesWithHttpInfo($spaceId, $subscriptionId, $query)->getData(); + public function searchSubscriptionInvoices($space_id, $subscription_id, $query) { + return $this->searchSubscriptionInvoicesWithHttpInfo($space_id, $subscription_id, $query)->getData(); } /** @@ -817,51 +902,51 @@ public function searchSubscriptionInvoices($spaceId, $subscriptionId, $query) { * * Search Subscription Invoices * - * @param int $spaceId (required) - * @param int $subscriptionId The id of the subscription for which the invoices should be searched for. (required) + * @param int $space_id (required) + * @param int $subscription_id The id of the subscription for which the invoices should be searched for. (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the invoices which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchSubscriptionInvoicesWithHttpInfo($spaceId, $subscriptionId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling searchSubscriptionInvoices'); + public function searchSubscriptionInvoicesWithHttpInfo($space_id, $subscription_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling searchSubscriptionInvoices'); } - // verify the required parameter 'subscriptionId' is set - if ($subscriptionId === null) { - throw new \InvalidArgumentException('Missing the required parameter $subscriptionId when calling searchSubscriptionInvoices'); + // verify the required parameter 'subscription_id' is set + if (is_null($subscription_id)) { + throw new \InvalidArgumentException('Missing the required parameter $subscription_id when calling searchSubscriptionInvoices'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling searchSubscriptionInvoices'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($subscriptionId !== null) { - $queryParams['subscriptionId'] = $this->apiClient->getSerializer()->toQueryValue($subscriptionId); + if (!is_null($subscription_id)) { + $queryParams['subscriptionId'] = $this->apiClient->getSerializer()->toQueryValue($subscription_id); } // path params - $resourcePath = "/subscription/searchSubscriptionInvoices"; + $resourcePath = '/subscription/searchSubscriptionInvoices'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -889,20 +974,31 @@ public function searchSubscriptionInvoicesWithHttpInfo($spaceId, $subscriptionId return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionInvoice[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\TransactionInvoice[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionInvoice[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -912,16 +1008,16 @@ public function searchSubscriptionInvoicesWithHttpInfo($spaceId, $subscriptionId * * terminate * - * @param int $spaceId (required) - * @param int $subscriptionId The subscription id identifies the subscription which should be terminated. (required) - * @param bool $respectTerminationPeriod The respect termination period controls whether the termination period configured on the product version should be respected or if the operation should take effect immediately. (required) + * @param int $space_id (required) + * @param int $subscription_id The subscription id identifies the subscription which should be terminated. (required) + * @param bool $respect_termination_period The respect termination period controls whether the termination period configured on the product version should be respected or if the operation should take effect immediately. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return void */ - public function terminate($spaceId, $subscriptionId, $respectTerminationPeriod) { - return $this->terminateWithHttpInfo($spaceId, $subscriptionId, $respectTerminationPeriod)->getData(); + public function terminate($space_id, $subscription_id, $respect_termination_period) { + return $this->terminateWithHttpInfo($space_id, $subscription_id, $respect_termination_period)->getData(); } /** @@ -929,54 +1025,54 @@ public function terminate($spaceId, $subscriptionId, $respectTerminationPeriod) * * terminate * - * @param int $spaceId (required) - * @param int $subscriptionId The subscription id identifies the subscription which should be terminated. (required) - * @param bool $respectTerminationPeriod The respect termination period controls whether the termination period configured on the product version should be respected or if the operation should take effect immediately. (required) + * @param int $space_id (required) + * @param int $subscription_id The subscription id identifies the subscription which should be terminated. (required) + * @param bool $respect_termination_period The respect termination period controls whether the termination period configured on the product version should be respected or if the operation should take effect immediately. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function terminateWithHttpInfo($spaceId, $subscriptionId, $respectTerminationPeriod) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling terminate'); + public function terminateWithHttpInfo($space_id, $subscription_id, $respect_termination_period) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling terminate'); } - // verify the required parameter 'subscriptionId' is set - if ($subscriptionId === null) { - throw new \InvalidArgumentException('Missing the required parameter $subscriptionId when calling terminate'); + // verify the required parameter 'subscription_id' is set + if (is_null($subscription_id)) { + throw new \InvalidArgumentException('Missing the required parameter $subscription_id when calling terminate'); } - // verify the required parameter 'respectTerminationPeriod' is set - if ($respectTerminationPeriod === null) { - throw new \InvalidArgumentException('Missing the required parameter $respectTerminationPeriod when calling terminate'); + // verify the required parameter 'respect_termination_period' is set + if (is_null($respect_termination_period)) { + throw new \InvalidArgumentException('Missing the required parameter $respect_termination_period when calling terminate'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($subscriptionId !== null) { - $queryParams['subscriptionId'] = $this->apiClient->getSerializer()->toQueryValue($subscriptionId); + if (!is_null($subscription_id)) { + $queryParams['subscriptionId'] = $this->apiClient->getSerializer()->toQueryValue($subscription_id); } - if ($respectTerminationPeriod !== null) { - $queryParams['respectTerminationPeriod'] = $this->apiClient->getSerializer()->toQueryValue($respectTerminationPeriod); + if (!is_null($respect_termination_period)) { + $queryParams['respectTerminationPeriod'] = $this->apiClient->getSerializer()->toQueryValue($respect_termination_period); } // path params - $resourcePath = "/subscription/terminate"; + $resourcePath = '/subscription/terminate'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -999,16 +1095,23 @@ public function terminateWithHttpInfo($spaceId, $subscriptionId, $respectTermina return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1018,16 +1121,16 @@ public function terminateWithHttpInfo($spaceId, $subscriptionId, $respectTermina * * update product version * - * @param int $spaceId (required) - * @param int $subscriptionId The subscription id identifies the subscription which should be updated to the latest version. (required) - * @param bool $respectTerminationPeriod The subscription version may be retired. The respect termination period controls whether the termination period configured on the product version should be respected or if the operation should take effect immediately. (required) + * @param int $space_id (required) + * @param int $subscription_id The subscription id identifies the subscription which should be updated to the latest version. (required) + * @param bool $respect_termination_period The subscription version may be retired. The respect termination period controls whether the termination period configured on the product version should be respected or if the operation should take effect immediately. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionVersion */ - public function updateProductVersion($spaceId, $subscriptionId, $respectTerminationPeriod) { - return $this->updateProductVersionWithHttpInfo($spaceId, $subscriptionId, $respectTerminationPeriod)->getData(); + public function updateProductVersion($space_id, $subscription_id, $respect_termination_period) { + return $this->updateProductVersionWithHttpInfo($space_id, $subscription_id, $respect_termination_period)->getData(); } /** @@ -1035,54 +1138,54 @@ public function updateProductVersion($spaceId, $subscriptionId, $respectTerminat * * update product version * - * @param int $spaceId (required) - * @param int $subscriptionId The subscription id identifies the subscription which should be updated to the latest version. (required) - * @param bool $respectTerminationPeriod The subscription version may be retired. The respect termination period controls whether the termination period configured on the product version should be respected or if the operation should take effect immediately. (required) + * @param int $space_id (required) + * @param int $subscription_id The subscription id identifies the subscription which should be updated to the latest version. (required) + * @param bool $respect_termination_period The subscription version may be retired. The respect termination period controls whether the termination period configured on the product version should be respected or if the operation should take effect immediately. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function updateProductVersionWithHttpInfo($spaceId, $subscriptionId, $respectTerminationPeriod) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling updateProductVersion'); + public function updateProductVersionWithHttpInfo($space_id, $subscription_id, $respect_termination_period) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling updateProductVersion'); } - // verify the required parameter 'subscriptionId' is set - if ($subscriptionId === null) { - throw new \InvalidArgumentException('Missing the required parameter $subscriptionId when calling updateProductVersion'); + // verify the required parameter 'subscription_id' is set + if (is_null($subscription_id)) { + throw new \InvalidArgumentException('Missing the required parameter $subscription_id when calling updateProductVersion'); } - // verify the required parameter 'respectTerminationPeriod' is set - if ($respectTerminationPeriod === null) { - throw new \InvalidArgumentException('Missing the required parameter $respectTerminationPeriod when calling updateProductVersion'); + // verify the required parameter 'respect_termination_period' is set + if (is_null($respect_termination_period)) { + throw new \InvalidArgumentException('Missing the required parameter $respect_termination_period when calling updateProductVersion'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($subscriptionId !== null) { - $queryParams['subscriptionId'] = $this->apiClient->getSerializer()->toQueryValue($subscriptionId); + if (!is_null($subscription_id)) { + $queryParams['subscriptionId'] = $this->apiClient->getSerializer()->toQueryValue($subscription_id); } - if ($respectTerminationPeriod !== null) { - $queryParams['respectTerminationPeriod'] = $this->apiClient->getSerializer()->toQueryValue($respectTerminationPeriod); + if (!is_null($respect_termination_period)) { + $queryParams['respectTerminationPeriod'] = $this->apiClient->getSerializer()->toQueryValue($respect_termination_period); } // path params - $resourcePath = "/subscription/updateProductVersion"; + $resourcePath = '/subscription/updateProductVersion'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -1105,24 +1208,39 @@ public function updateProductVersionWithHttpInfo($spaceId, $subscriptionId, $res return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionVersion', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionVersion', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionVersion', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/SubscriptionSuspensionService.php b/wallee-sdk/lib/Service/SubscriptionSuspensionService.php index 54b1818..9b1a885 100644 --- a/wallee-sdk/lib/Service/SubscriptionSuspensionService.php +++ b/wallee-sdk/lib/Service/SubscriptionSuspensionService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-suspension/count"; + $resourcePath = '/subscription-suspension/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionSuspensionCreate $suspension (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionSuspension */ - public function create($spaceId, $suspension) { - return $this->createWithHttpInfo($spaceId, $suspension)->getData(); + public function create($space_id, $suspension) { + return $this->createWithHttpInfo($space_id, $suspension)->getData(); } /** @@ -186,43 +197,43 @@ public function create($spaceId, $suspension) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\SubscriptionSuspensionCreate $suspension (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $suspension) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $suspension) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } // verify the required parameter 'suspension' is set - if ($suspension === null) { + if (is_null($suspension)) { throw new \InvalidArgumentException('Missing the required parameter $suspension when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-suspension/create"; + $resourcePath = '/subscription-suspension/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($suspension)) { @@ -250,20 +261,31 @@ public function createWithHttpInfo($spaceId, $suspension) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionSuspension', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionSuspension', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionSuspension', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -273,15 +295,15 @@ public function createWithHttpInfo($spaceId, $suspension) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the suspension which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionSuspension */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -289,46 +311,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the suspension which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/subscription-suspension/read"; + $resourcePath = '/subscription-suspension/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -351,20 +373,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionSuspension', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionSuspension', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionSuspension', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -374,15 +407,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the subscription suspensions which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionSuspension[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -390,43 +423,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the subscription suspensions which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-suspension/search"; + $resourcePath = '/subscription-suspension/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -454,20 +487,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionSuspension[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionSuspension[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionSuspension[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -477,15 +521,15 @@ public function searchWithHttpInfo($spaceId, $query) { * * terminate * - * @param int $spaceId (required) - * @param int $suspensionId (required) + * @param int $space_id (required) + * @param int $suspension_id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionSuspension */ - public function terminate($spaceId, $suspensionId) { - return $this->terminateWithHttpInfo($spaceId, $suspensionId)->getData(); + public function terminate($space_id, $suspension_id) { + return $this->terminateWithHttpInfo($space_id, $suspension_id)->getData(); } /** @@ -493,46 +537,46 @@ public function terminate($spaceId, $suspensionId) { * * terminate * - * @param int $spaceId (required) - * @param int $suspensionId (required) + * @param int $space_id (required) + * @param int $suspension_id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function terminateWithHttpInfo($spaceId, $suspensionId) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling terminate'); + public function terminateWithHttpInfo($space_id, $suspension_id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling terminate'); } - // verify the required parameter 'suspensionId' is set - if ($suspensionId === null) { - throw new \InvalidArgumentException('Missing the required parameter $suspensionId when calling terminate'); + // verify the required parameter 'suspension_id' is set + if (is_null($suspension_id)) { + throw new \InvalidArgumentException('Missing the required parameter $suspension_id when calling terminate'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($suspensionId !== null) { - $queryParams['suspensionId'] = $this->apiClient->getSerializer()->toQueryValue($suspensionId); + if (!is_null($suspension_id)) { + $queryParams['suspensionId'] = $this->apiClient->getSerializer()->toQueryValue($suspension_id); } // path params - $resourcePath = "/subscription-suspension/terminate"; + $resourcePath = '/subscription-suspension/terminate'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -555,20 +599,31 @@ public function terminateWithHttpInfo($spaceId, $suspensionId) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionSuspension', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionSuspension', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionSuspension', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/SubscriptionVersionService.php b/wallee-sdk/lib/Service/SubscriptionVersionService.php index dda316b..53a2fa8 100644 --- a/wallee-sdk/lib/Service/SubscriptionVersionService.php +++ b/wallee-sdk/lib/Service/SubscriptionVersionService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-version/count"; + $resourcePath = '/subscription-version/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the subscription which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionVersion */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -186,46 +197,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the subscription which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/subscription-version/read"; + $resourcePath = '/subscription-version/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -248,20 +259,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionVersion', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionVersion', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionVersion', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -271,15 +293,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the subscriptions which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\SubscriptionVersion[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -287,43 +309,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the subscriptions which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/subscription-version/search"; + $resourcePath = '/subscription-version/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -351,20 +373,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\SubscriptionVersion[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\SubscriptionVersion[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\SubscriptionVersion[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/TokenService.php b/wallee-sdk/lib/Service/TokenService.php index 5c1607a..9606acc 100644 --- a/wallee-sdk/lib/Service/TokenService.php +++ b/wallee-sdk/lib/Service/TokenService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/token/count"; + $resourcePath = '/token/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\TokenCreate $entity The token object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\Token */ - public function create($spaceId, $entity) { - return $this->createWithHttpInfo($spaceId, $entity)->getData(); + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); } /** @@ -186,43 +197,43 @@ public function create($spaceId, $entity) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\TokenCreate $entity The token object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/token/create"; + $resourcePath = '/token/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -250,20 +261,31 @@ public function createWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Token', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Token', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Token', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -273,15 +295,15 @@ public function createWithHttpInfo($spaceId, $entity) { * * Create Transaction for Token Update * - * @param int $spaceId (required) - * @param int $tokenId The id of the token which should be updated. (required) + * @param int $space_id (required) + * @param int $token_id The id of the token which should be updated. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\Transaction */ - public function createTransactionForTokenUpdate($spaceId, $tokenId) { - return $this->createTransactionForTokenUpdateWithHttpInfo($spaceId, $tokenId)->getData(); + public function createTransactionForTokenUpdate($space_id, $token_id) { + return $this->createTransactionForTokenUpdateWithHttpInfo($space_id, $token_id)->getData(); } /** @@ -289,46 +311,46 @@ public function createTransactionForTokenUpdate($spaceId, $tokenId) { * * Create Transaction for Token Update * - * @param int $spaceId (required) - * @param int $tokenId The id of the token which should be updated. (required) + * @param int $space_id (required) + * @param int $token_id The id of the token which should be updated. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createTransactionForTokenUpdateWithHttpInfo($spaceId, $tokenId) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling createTransactionForTokenUpdate'); + public function createTransactionForTokenUpdateWithHttpInfo($space_id, $token_id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling createTransactionForTokenUpdate'); } - // verify the required parameter 'tokenId' is set - if ($tokenId === null) { - throw new \InvalidArgumentException('Missing the required parameter $tokenId when calling createTransactionForTokenUpdate'); + // verify the required parameter 'token_id' is set + if (is_null($token_id)) { + throw new \InvalidArgumentException('Missing the required parameter $token_id when calling createTransactionForTokenUpdate'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array()); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept([]); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($tokenId !== null) { - $queryParams['tokenId'] = $this->apiClient->getSerializer()->toQueryValue($tokenId); + if (!is_null($token_id)) { + $queryParams['tokenId'] = $this->apiClient->getSerializer()->toQueryValue($token_id); } // path params - $resourcePath = "/token/createTransactionForTokenUpdate"; + $resourcePath = '/token/createTransactionForTokenUpdate'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -351,20 +373,31 @@ public function createTransactionForTokenUpdateWithHttpInfo($spaceId, $tokenId) return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Transaction', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Transaction', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Transaction', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -374,15 +407,15 @@ public function createTransactionForTokenUpdateWithHttpInfo($spaceId, $tokenId) * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return void */ - public function delete($spaceId, $id) { - return $this->deleteWithHttpInfo($spaceId, $id)->getData(); + public function delete($space_id, $id) { + return $this->deleteWithHttpInfo($space_id, $id)->getData(); } /** @@ -390,43 +423,43 @@ public function delete($spaceId, $id) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function deleteWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling delete'); + public function deleteWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling delete'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/token/delete"; + $resourcePath = '/token/delete'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($id)) { @@ -454,20 +487,31 @@ public function deleteWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -477,15 +521,15 @@ public function deleteWithHttpInfo($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the token which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\Token */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -493,46 +537,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the token which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/token/read"; + $resourcePath = '/token/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -555,20 +599,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Token', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Token', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Token', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -578,15 +633,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the tokens which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\Token[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -594,43 +649,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the tokens which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/token/search"; + $resourcePath = '/token/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -658,20 +713,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Token[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Token[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Token[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -681,15 +747,15 @@ public function searchWithHttpInfo($spaceId, $query) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\TokenUpdate $entity The object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\Token */ - public function update($spaceId, $entity) { - return $this->updateWithHttpInfo($spaceId, $entity)->getData(); + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); } /** @@ -697,43 +763,43 @@ public function update($spaceId, $entity) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\TokenUpdate $entity The object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function updateWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling update'); + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/token/update"; + $resourcePath = '/token/update'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -761,24 +827,39 @@ public function updateWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Token', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Token', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Token', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/TokenVersionService.php b/wallee-sdk/lib/Service/TokenVersionService.php index 1581fef..dc8886c 100644 --- a/wallee-sdk/lib/Service/TokenVersionService.php +++ b/wallee-sdk/lib/Service/TokenVersionService.php @@ -1,10 +1,8 @@ activeVersionWithHttpInfo($spaceId, $id)->getData(); + public function activeVersion($space_id, $id) { + return $this->activeVersionWithHttpInfo($space_id, $id)->getData(); } /** @@ -87,46 +87,46 @@ public function activeVersion($spaceId, $id) { * * Active Version * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of a token for which you want to look up the current active token version. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function activeVersionWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling activeVersion'); + public function activeVersionWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling activeVersion'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling activeVersion'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/token-version/active-version"; + $resourcePath = '/token-version/active-version'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -149,20 +149,31 @@ public function activeVersionWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TokenVersion', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\TokenVersion', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TokenVersion', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -172,15 +183,15 @@ public function activeVersionWithHttpInfo($spaceId, $id) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return int */ - public function count($spaceId, $filter = null) { - return $this->countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -188,39 +199,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/token-version/count"; + $resourcePath = '/token-version/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -248,20 +259,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -271,15 +293,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the token version which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\TokenVersion */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -287,46 +309,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the token version which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/token-version/read"; + $resourcePath = '/token-version/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -349,20 +371,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TokenVersion', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\TokenVersion', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TokenVersion', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -372,15 +405,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the token versions which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\TokenVersion[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -388,43 +421,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the token versions which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/token-version/search"; + $resourcePath = '/token-version/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -452,20 +485,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TokenVersion[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\TokenVersion[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TokenVersion[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/TransactionCommentService.php b/wallee-sdk/lib/Service/TransactionCommentService.php new file mode 100644 index 0000000..05c5107 --- /dev/null +++ b/wallee-sdk/lib/Service/TransactionCommentService.php @@ -0,0 +1,865 @@ +apiClient = $apiClient; + } + + /** + * Returns the API client instance. + * + * @return ApiClient + */ + public function getApiClient() { + return $this->apiClient; + } + + + /** + * Operation all + * + * Find by transaction + * + * @param int $space_id (required) + * @param int $transaction_id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\TransactionComment[] + */ + public function all($space_id, $transaction_id) { + return $this->allWithHttpInfo($space_id, $transaction_id)->getData(); + } + + /** + * Operation allWithHttpInfo + * + * Find by transaction + * + * @param int $space_id (required) + * @param int $transaction_id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function allWithHttpInfo($space_id, $transaction_id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling all'); + } + // verify the required parameter 'transaction_id' is set + if (is_null($transaction_id)) { + throw new \InvalidArgumentException('Missing the required parameter $transaction_id when calling all'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($transaction_id)) { + $queryParams['transactionId'] = $this->apiClient->getSerializer()->toQueryValue($transaction_id); + } + + // path params + $resourcePath = '/transaction-comment/all'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\TransactionComment[]', + '/transaction-comment/all' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionComment[]', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionComment[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation create + * + * Create + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\TransactionCommentCreate $entity (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\TransactionComment + */ + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); + } + + /** + * Operation createWithHttpInfo + * + * Create + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\TransactionCommentCreate $entity (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); + } + // verify the required parameter 'entity' is set + if (is_null($entity)) { + throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/transaction-comment/create'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($entity)) { + $tempBody = $entity; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\TransactionComment', + '/transaction-comment/create' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionComment', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionComment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation delete + * + * Delete + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return void + */ + public function delete($space_id, $id) { + return $this->deleteWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation deleteWithHttpInfo + * + * Delete + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function deleteWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling delete'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/transaction-comment/delete'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + null, + '/transaction-comment/delete' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders()); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation pin + * + * Pin + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return void + */ + public function pin($space_id, $id) { + return $this->pinWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation pinWithHttpInfo + * + * Pin + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function pinWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling pin'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling pin'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/transaction-comment/pin'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + null, + '/transaction-comment/pin' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders()); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation read + * + * Read + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\TransactionComment + */ + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation readWithHttpInfo + * + * Read + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/transaction-comment/read'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\TransactionComment', + '/transaction-comment/read' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionComment', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionComment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation unpin + * + * Unpin + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return void + */ + public function unpin($space_id, $id) { + return $this->unpinWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation unpinWithHttpInfo + * + * Unpin + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function unpinWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling unpin'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling unpin'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/transaction-comment/unpin'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + null, + '/transaction-comment/unpin' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders()); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation update + * + * Update + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\TransactionCommentActive $entity (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\TransactionComment + */ + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); + } + + /** + * Operation updateWithHttpInfo + * + * Update + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\TransactionCommentActive $entity (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); + } + // verify the required parameter 'entity' is set + if (is_null($entity)) { + throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/transaction-comment/update'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($entity)) { + $tempBody = $entity; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\TransactionComment', + '/transaction-comment/update' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionComment', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionComment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + +} diff --git a/wallee-sdk/lib/Service/TransactionCompletionService.php b/wallee-sdk/lib/Service/TransactionCompletionService.php index 5fe839d..15449fa 100644 --- a/wallee-sdk/lib/Service/TransactionCompletionService.php +++ b/wallee-sdk/lib/Service/TransactionCompletionService.php @@ -1,10 +1,8 @@ completeOfflineWithHttpInfo($spaceId, $id)->getData(); + public function completeOffline($space_id, $id) { + return $this->completeOfflineWithHttpInfo($space_id, $id)->getData(); } /** @@ -87,46 +87,46 @@ public function completeOffline($spaceId, $id) { * * completeOffline * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction which should be completed. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function completeOfflineWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling completeOffline'); + public function completeOfflineWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling completeOffline'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling completeOffline'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/transaction-completion/completeOffline"; + $resourcePath = '/transaction-completion/completeOffline'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -149,20 +149,31 @@ public function completeOfflineWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionCompletion', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\TransactionCompletion', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionCompletion', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -172,15 +183,15 @@ public function completeOfflineWithHttpInfo($spaceId, $id) { * * completeOnline * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction which should be completed. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\TransactionCompletion */ - public function completeOnline($spaceId, $id) { - return $this->completeOnlineWithHttpInfo($spaceId, $id)->getData(); + public function completeOnline($space_id, $id) { + return $this->completeOnlineWithHttpInfo($space_id, $id)->getData(); } /** @@ -188,46 +199,46 @@ public function completeOnline($spaceId, $id) { * * completeOnline * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction which should be completed. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function completeOnlineWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling completeOnline'); + public function completeOnlineWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling completeOnline'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling completeOnline'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/transaction-completion/completeOnline"; + $resourcePath = '/transaction-completion/completeOnline'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -250,20 +261,259 @@ public function completeOnlineWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionCompletion', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\TransactionCompletion', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionCompletion', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation completePartiallyOffline + * + * completePartiallyOffline + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\TransactionCompletionRequest $completion (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\TransactionCompletion + */ + public function completePartiallyOffline($space_id, $completion) { + return $this->completePartiallyOfflineWithHttpInfo($space_id, $completion)->getData(); + } + + /** + * Operation completePartiallyOfflineWithHttpInfo + * + * completePartiallyOffline + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\TransactionCompletionRequest $completion (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function completePartiallyOfflineWithHttpInfo($space_id, $completion) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling completePartiallyOffline'); + } + // verify the required parameter 'completion' is set + if (is_null($completion)) { + throw new \InvalidArgumentException('Missing the required parameter $completion when calling completePartiallyOffline'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/transaction-completion/completePartiallyOffline'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($completion)) { + $tempBody = $completion; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\TransactionCompletion', + '/transaction-completion/completePartiallyOffline' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionCompletion', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionCompletion', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } + throw $e; + } + } + + /** + * Operation completePartiallyOnline + * + * completePartiallyOnline + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\TransactionCompletionRequest $completion (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\TransactionCompletion + */ + public function completePartiallyOnline($space_id, $completion) { + return $this->completePartiallyOnlineWithHttpInfo($space_id, $completion)->getData(); + } + + /** + * Operation completePartiallyOnlineWithHttpInfo + * + * completePartiallyOnline + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\TransactionCompletionRequest $completion (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function completePartiallyOnlineWithHttpInfo($space_id, $completion) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling completePartiallyOnline'); + } + // verify the required parameter 'completion' is set + if (is_null($completion)) { + throw new \InvalidArgumentException('Missing the required parameter $completion when calling completePartiallyOnline'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/transaction-completion/completePartiallyOnline'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($completion)) { + $tempBody = $completion; + } + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\TransactionCompletion', + '/transaction-completion/completePartiallyOnline' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionCompletion', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionCompletion', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } throw $e; } } @@ -273,15 +523,15 @@ public function completeOnlineWithHttpInfo($spaceId, $id) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return int */ - public function count($spaceId, $filter = null) { - return $this->countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -289,39 +539,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/transaction-completion/count"; + $resourcePath = '/transaction-completion/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -349,20 +599,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -372,15 +633,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction completions which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\TransactionCompletion */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -388,46 +649,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction completions which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/transaction-completion/read"; + $resourcePath = '/transaction-completion/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -450,20 +711,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionCompletion', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\TransactionCompletion', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionCompletion', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -473,15 +745,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the transaction completions which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\TransactionCompletion[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -489,43 +761,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the transaction completions which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/transaction-completion/search"; + $resourcePath = '/transaction-completion/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -553,20 +825,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionCompletion[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\TransactionCompletion[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionCompletion[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/TransactionIframeService.php b/wallee-sdk/lib/Service/TransactionIframeService.php new file mode 100644 index 0000000..c5f8224 --- /dev/null +++ b/wallee-sdk/lib/Service/TransactionIframeService.php @@ -0,0 +1,189 @@ +apiClient = $apiClient; + } + + /** + * Returns the API client instance. + * + * @return ApiClient + */ + public function getApiClient() { + return $this->apiClient; + } + + + /** + * Operation javascriptUrl + * + * Build JavaScript URL + * + * @param int $space_id (required) + * @param int $id The id of the transaction which should be returned. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return string + */ + public function javascriptUrl($space_id, $id) { + return $this->javascriptUrlWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation javascriptUrlWithHttpInfo + * + * Build JavaScript URL + * + * @param int $space_id (required) + * @param int $id The id of the transaction which should be returned. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function javascriptUrlWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling javascriptUrl'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling javascriptUrl'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json', 'text/plain;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/transaction-iframe/javascript-url'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + 'string', + '/transaction-iframe/javascript-url' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'string', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + +} diff --git a/wallee-sdk/lib/Service/TransactionInvoiceCommentService.php b/wallee-sdk/lib/Service/TransactionInvoiceCommentService.php new file mode 100644 index 0000000..cb9e45e --- /dev/null +++ b/wallee-sdk/lib/Service/TransactionInvoiceCommentService.php @@ -0,0 +1,865 @@ +apiClient = $apiClient; + } + + /** + * Returns the API client instance. + * + * @return ApiClient + */ + public function getApiClient() { + return $this->apiClient; + } + + + /** + * Operation all + * + * Find by invoice + * + * @param int $space_id (required) + * @param int $invoice_id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\TransactionInvoiceComment[] + */ + public function all($space_id, $invoice_id) { + return $this->allWithHttpInfo($space_id, $invoice_id)->getData(); + } + + /** + * Operation allWithHttpInfo + * + * Find by invoice + * + * @param int $space_id (required) + * @param int $invoice_id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function allWithHttpInfo($space_id, $invoice_id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling all'); + } + // verify the required parameter 'invoice_id' is set + if (is_null($invoice_id)) { + throw new \InvalidArgumentException('Missing the required parameter $invoice_id when calling all'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($invoice_id)) { + $queryParams['invoiceId'] = $this->apiClient->getSerializer()->toQueryValue($invoice_id); + } + + // path params + $resourcePath = '/transaction-invoice-comment/all'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\TransactionInvoiceComment[]', + '/transaction-invoice-comment/all' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionInvoiceComment[]', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionInvoiceComment[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation create + * + * Create + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\TransactionInvoiceCommentCreate $entity (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\TransactionInvoiceComment + */ + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); + } + + /** + * Operation createWithHttpInfo + * + * Create + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\TransactionInvoiceCommentCreate $entity (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); + } + // verify the required parameter 'entity' is set + if (is_null($entity)) { + throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/transaction-invoice-comment/create'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($entity)) { + $tempBody = $entity; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\TransactionInvoiceComment', + '/transaction-invoice-comment/create' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionInvoiceComment', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionInvoiceComment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation delete + * + * Delete + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return void + */ + public function delete($space_id, $id) { + return $this->deleteWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation deleteWithHttpInfo + * + * Delete + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function deleteWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling delete'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/transaction-invoice-comment/delete'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + null, + '/transaction-invoice-comment/delete' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders()); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation pin + * + * Pin + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return void + */ + public function pin($space_id, $id) { + return $this->pinWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation pinWithHttpInfo + * + * Pin + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function pinWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling pin'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling pin'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/transaction-invoice-comment/pin'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + null, + '/transaction-invoice-comment/pin' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders()); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation read + * + * Read + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\TransactionInvoiceComment + */ + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation readWithHttpInfo + * + * Read + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/transaction-invoice-comment/read'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\TransactionInvoiceComment', + '/transaction-invoice-comment/read' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionInvoiceComment', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionInvoiceComment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation unpin + * + * Unpin + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return void + */ + public function unpin($space_id, $id) { + return $this->unpinWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation unpinWithHttpInfo + * + * Unpin + * + * @param int $space_id (required) + * @param int $id (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function unpinWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling unpin'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling unpin'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/transaction-invoice-comment/unpin'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + null, + '/transaction-invoice-comment/unpin' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders()); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation update + * + * Update + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\TransactionInvoiceCommentActive $entity (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return \Wallee\Sdk\Model\TransactionInvoiceComment + */ + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); + } + + /** + * Operation updateWithHttpInfo + * + * Update + * + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\TransactionInvoiceCommentActive $entity (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); + } + // verify the required parameter 'entity' is set + if (is_null($entity)) { + throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + + // path params + $resourcePath = '/transaction-invoice-comment/update'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + // body params + $tempBody = null; + if (isset($entity)) { + $tempBody = $entity; + } + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Wallee\Sdk\Model\TransactionInvoiceComment', + '/transaction-invoice-comment/update' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionInvoiceComment', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionInvoiceComment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + +} diff --git a/wallee-sdk/lib/Service/TransactionInvoiceService.php b/wallee-sdk/lib/Service/TransactionInvoiceService.php index c584029..becc0f0 100644 --- a/wallee-sdk/lib/Service/TransactionInvoiceService.php +++ b/wallee-sdk/lib/Service/TransactionInvoiceService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/transaction-invoice/count"; + $resourcePath = '/transaction-invoice/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * getInvoiceDocument * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction invoice to get the document for. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\RenderedDocument */ - public function getInvoiceDocument($spaceId, $id) { - return $this->getInvoiceDocumentWithHttpInfo($spaceId, $id)->getData(); + public function getInvoiceDocument($space_id, $id) { + return $this->getInvoiceDocumentWithHttpInfo($space_id, $id)->getData(); } /** @@ -186,46 +197,46 @@ public function getInvoiceDocument($spaceId, $id) { * * getInvoiceDocument * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction invoice to get the document for. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function getInvoiceDocumentWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling getInvoiceDocument'); + public function getInvoiceDocumentWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling getInvoiceDocument'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling getInvoiceDocument'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/transaction-invoice/getInvoiceDocument"; + $resourcePath = '/transaction-invoice/getInvoiceDocument'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -248,20 +259,31 @@ public function getInvoiceDocumentWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\RenderedDocument', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\RenderedDocument', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\RenderedDocument', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -271,16 +293,16 @@ public function getInvoiceDocumentWithHttpInfo($spaceId, $id) { * * getInvoiceDocumentWithTargetMediaType * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction invoice to get the document for. (required) - * @param int $targetMediaTypeId The id of the target media type for which the invoice should be generated for. (required) + * @param int $target_media_type_id The id of the target media type for which the invoice should be generated for. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\RenderedDocument */ - public function getInvoiceDocumentWithTargetMediaType($spaceId, $id, $targetMediaTypeId) { - return $this->getInvoiceDocumentWithTargetMediaTypeWithHttpInfo($spaceId, $id, $targetMediaTypeId)->getData(); + public function getInvoiceDocumentWithTargetMediaType($space_id, $id, $target_media_type_id) { + return $this->getInvoiceDocumentWithTargetMediaTypeWithHttpInfo($space_id, $id, $target_media_type_id)->getData(); } /** @@ -288,54 +310,54 @@ public function getInvoiceDocumentWithTargetMediaType($spaceId, $id, $targetMedi * * getInvoiceDocumentWithTargetMediaType * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction invoice to get the document for. (required) - * @param int $targetMediaTypeId The id of the target media type for which the invoice should be generated for. (required) + * @param int $target_media_type_id The id of the target media type for which the invoice should be generated for. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function getInvoiceDocumentWithTargetMediaTypeWithHttpInfo($spaceId, $id, $targetMediaTypeId) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling getInvoiceDocumentWithTargetMediaType'); + public function getInvoiceDocumentWithTargetMediaTypeWithHttpInfo($space_id, $id, $target_media_type_id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling getInvoiceDocumentWithTargetMediaType'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling getInvoiceDocumentWithTargetMediaType'); } - // verify the required parameter 'targetMediaTypeId' is set - if ($targetMediaTypeId === null) { - throw new \InvalidArgumentException('Missing the required parameter $targetMediaTypeId when calling getInvoiceDocumentWithTargetMediaType'); + // verify the required parameter 'target_media_type_id' is set + if (is_null($target_media_type_id)) { + throw new \InvalidArgumentException('Missing the required parameter $target_media_type_id when calling getInvoiceDocumentWithTargetMediaType'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } - if ($targetMediaTypeId !== null) { - $queryParams['targetMediaTypeId'] = $this->apiClient->getSerializer()->toQueryValue($targetMediaTypeId); + if (!is_null($target_media_type_id)) { + $queryParams['targetMediaTypeId'] = $this->apiClient->getSerializer()->toQueryValue($target_media_type_id); } // path params - $resourcePath = "/transaction-invoice/getInvoiceDocumentWithTargetMediaType"; + $resourcePath = '/transaction-invoice/getInvoiceDocumentWithTargetMediaType'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -358,20 +380,31 @@ public function getInvoiceDocumentWithTargetMediaTypeWithHttpInfo($spaceId, $id, return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\RenderedDocument', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\RenderedDocument', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\RenderedDocument', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -381,15 +414,15 @@ public function getInvoiceDocumentWithTargetMediaTypeWithHttpInfo($spaceId, $id, * * isReplacementPossible * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The invoice which should be checked if a replacement is possible. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return bool */ - public function isReplacementPossible($spaceId, $id) { - return $this->isReplacementPossibleWithHttpInfo($spaceId, $id)->getData(); + public function isReplacementPossible($space_id, $id) { + return $this->isReplacementPossibleWithHttpInfo($space_id, $id)->getData(); } /** @@ -397,46 +430,46 @@ public function isReplacementPossible($spaceId, $id) { * * isReplacementPossible * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The invoice which should be checked if a replacement is possible. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function isReplacementPossibleWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling isReplacementPossible'); + public function isReplacementPossibleWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling isReplacementPossible'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling isReplacementPossible'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/transaction-invoice/isReplacementPossible"; + $resourcePath = '/transaction-invoice/isReplacementPossible'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -459,20 +492,31 @@ public function isReplacementPossibleWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'bool', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'bool', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'bool', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -482,15 +526,15 @@ public function isReplacementPossibleWithHttpInfo($spaceId, $id) { * * Mark as Derecognized * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction invoice which should be marked as derecognized. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\TransactionInvoice */ - public function markAsDerecognized($spaceId, $id) { - return $this->markAsDerecognizedWithHttpInfo($spaceId, $id)->getData(); + public function markAsDerecognized($space_id, $id) { + return $this->markAsDerecognizedWithHttpInfo($space_id, $id)->getData(); } /** @@ -498,46 +542,46 @@ public function markAsDerecognized($spaceId, $id) { * * Mark as Derecognized * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction invoice which should be marked as derecognized. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function markAsDerecognizedWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling markAsDerecognized'); + public function markAsDerecognizedWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling markAsDerecognized'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling markAsDerecognized'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/transaction-invoice/markAsDerecognized"; + $resourcePath = '/transaction-invoice/markAsDerecognized'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -560,20 +604,31 @@ public function markAsDerecognizedWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionInvoice', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\TransactionInvoice', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionInvoice', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -583,15 +638,15 @@ public function markAsDerecognizedWithHttpInfo($spaceId, $id) { * * Mark as Paid * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction invoice which should be marked as paid. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\TransactionInvoice */ - public function markAsPaid($spaceId, $id) { - return $this->markAsPaidWithHttpInfo($spaceId, $id)->getData(); + public function markAsPaid($space_id, $id) { + return $this->markAsPaidWithHttpInfo($space_id, $id)->getData(); } /** @@ -599,46 +654,46 @@ public function markAsPaid($spaceId, $id) { * * Mark as Paid * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction invoice which should be marked as paid. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function markAsPaidWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling markAsPaid'); + public function markAsPaidWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling markAsPaid'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling markAsPaid'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/transaction-invoice/markAsPaid"; + $resourcePath = '/transaction-invoice/markAsPaid'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -661,20 +716,31 @@ public function markAsPaidWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionInvoice', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\TransactionInvoice', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionInvoice', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -684,15 +750,15 @@ public function markAsPaidWithHttpInfo($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction invoices which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\TransactionInvoice */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -700,46 +766,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction invoices which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/transaction-invoice/read"; + $resourcePath = '/transaction-invoice/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -762,20 +828,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionInvoice', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\TransactionInvoice', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionInvoice', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -785,7 +862,7 @@ public function readWithHttpInfo($spaceId, $id) { * * replace * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction invoices which should be replaced. (required) * @param \Wallee\Sdk\Model\TransactionInvoiceReplacement $replacement (required) * @throws \Wallee\Sdk\ApiException @@ -793,8 +870,8 @@ public function readWithHttpInfo($spaceId, $id) { * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\TransactionInvoice */ - public function replace($spaceId, $id, $replacement) { - return $this->replaceWithHttpInfo($spaceId, $id, $replacement)->getData(); + public function replace($space_id, $id, $replacement) { + return $this->replaceWithHttpInfo($space_id, $id, $replacement)->getData(); } /** @@ -802,7 +879,7 @@ public function replace($spaceId, $id, $replacement) { * * replace * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction invoices which should be replaced. (required) * @param \Wallee\Sdk\Model\TransactionInvoiceReplacement $replacement (required) * @throws \Wallee\Sdk\ApiException @@ -810,43 +887,43 @@ public function replace($spaceId, $id, $replacement) { * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function replaceWithHttpInfo($spaceId, $id, $replacement) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling replace'); + public function replaceWithHttpInfo($space_id, $id, $replacement) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling replace'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling replace'); } // verify the required parameter 'replacement' is set - if ($replacement === null) { + if (is_null($replacement)) { throw new \InvalidArgumentException('Missing the required parameter $replacement when calling replace'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/transaction-invoice/replace"; + $resourcePath = '/transaction-invoice/replace'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($replacement)) { @@ -874,20 +951,31 @@ public function replaceWithHttpInfo($spaceId, $id, $replacement) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionInvoice', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\TransactionInvoice', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionInvoice', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -897,15 +985,15 @@ public function replaceWithHttpInfo($spaceId, $id, $replacement) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the transaction invoices which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\TransactionInvoice[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -913,43 +1001,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the transaction invoices which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/transaction-invoice/search"; + $resourcePath = '/transaction-invoice/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -977,20 +1065,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionInvoice[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\TransactionInvoice[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionInvoice[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/TransactionMobileSdkService.php b/wallee-sdk/lib/Service/TransactionMobileSdkService.php new file mode 100644 index 0000000..a848c28 --- /dev/null +++ b/wallee-sdk/lib/Service/TransactionMobileSdkService.php @@ -0,0 +1,180 @@ +apiClient = $apiClient; + } + + /** + * Returns the API client instance. + * + * @return ApiClient + */ + public function getApiClient() { + return $this->apiClient; + } + + + /** + * Operation paymentFormUrl + * + * Build Mobile SDK URL + * + * @param string $credentials The credentials identifies the transaction and contains the security details which grants the access this operation. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return string + */ + public function paymentFormUrl($credentials) { + return $this->paymentFormUrlWithHttpInfo($credentials)->getData(); + } + + /** + * Operation paymentFormUrlWithHttpInfo + * + * Build Mobile SDK URL + * + * @param string $credentials The credentials identifies the transaction and contains the security details which grants the access this operation. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function paymentFormUrlWithHttpInfo($credentials) { + // verify the required parameter 'credentials' is set + if (is_null($credentials)) { + throw new \InvalidArgumentException('Missing the required parameter $credentials when calling paymentFormUrl'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json', 'text/plain;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); + + // query params + $queryParams = []; + if (!is_null($credentials)) { + $queryParams['credentials'] = $this->apiClient->getSerializer()->toQueryValue($credentials); + } + + // path params + $resourcePath = '/transaction-mobile-sdk/payment-form-url'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + 'string', + '/transaction-mobile-sdk/payment-form-url' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'string', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + +} diff --git a/wallee-sdk/lib/Service/TransactionPaymentPageService.php b/wallee-sdk/lib/Service/TransactionPaymentPageService.php new file mode 100644 index 0000000..126c5dd --- /dev/null +++ b/wallee-sdk/lib/Service/TransactionPaymentPageService.php @@ -0,0 +1,189 @@ +apiClient = $apiClient; + } + + /** + * Returns the API client instance. + * + * @return ApiClient + */ + public function getApiClient() { + return $this->apiClient; + } + + + /** + * Operation paymentPageUrl + * + * Build Payment Page URL + * + * @param int $space_id (required) + * @param int $id The id of the transaction which should be returned. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return string + */ + public function paymentPageUrl($space_id, $id) { + return $this->paymentPageUrlWithHttpInfo($space_id, $id)->getData(); + } + + /** + * Operation paymentPageUrlWithHttpInfo + * + * Build Payment Page URL + * + * @param int $space_id (required) + * @param int $id The id of the transaction which should be returned. (required) + * @throws \Wallee\Sdk\ApiException + * @throws \Wallee\Sdk\VersioningException + * @throws \Wallee\Sdk\Http\ConnectionException + * @return ApiResponse + */ + public function paymentPageUrlWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling paymentPageUrl'); + } + // verify the required parameter 'id' is set + if (is_null($id)) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling paymentPageUrl'); + } + // header params + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json', 'text/plain;charset=utf-8']); + if (!is_null($headerAccept)) { + $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; + } + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); + + // query params + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); + } + if (!is_null($id)) { + $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); + } + + // path params + $resourcePath = '/transaction-payment-page/payment-page-url'; + // default format to json + $resourcePath = str_replace('{format}', 'json', $resourcePath); + + // form params + $formParams = []; + + // for model (json/xml) + $httpBody = ''; + if (isset($tempBody)) { + $httpBody = $tempBody; // $tempBody is the method argument, if present + } elseif (!empty($formParams)) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + $response = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + 'string', + '/transaction-payment-page/payment-page-url' + ); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'string', $response->getHeaders())); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + +} diff --git a/wallee-sdk/lib/Service/TransactionService.php b/wallee-sdk/lib/Service/TransactionService.php index 9c96cc0..c125c1c 100644 --- a/wallee-sdk/lib/Service/TransactionService.php +++ b/wallee-sdk/lib/Service/TransactionService.php @@ -1,10 +1,8 @@ buildJavaScriptUrlWithHttpInfo($spaceId, $id)->getData(); - } - - /** - * Operation buildJavaScriptUrlWithHttpInfo - * - * Build JavaScript URL - * - * @param int $spaceId (required) - * @param int $id The id of the transaction which should be returned. (required) - * @throws \Wallee\Sdk\ApiException - * @throws \Wallee\Sdk\VersioningException - * @throws \Wallee\Sdk\Http\ConnectionException - * @return ApiResponse - */ - public function buildJavaScriptUrlWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling buildJavaScriptUrl'); - } - // verify the required parameter 'id' is set - if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling buildJavaScriptUrl'); - } - // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array()); - if ($headerAccept !== null) { - $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; - } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); - - // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); - } - if ($id !== null) { - $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); - } - - // path params - $resourcePath = "/transaction/buildJavaScriptUrl"; - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - - // form params - $formParams = array(); - - // for model (json/xml) - $httpBody = ''; - if (isset($tempBody)) { - $httpBody = $tempBody; // $tempBody is the method argument, if present - } elseif (!empty($formParams)) { - $httpBody = $formParams; // for HTTP post (form) - } - // make the API Call - try { - $response = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - 'string', - '/transaction/buildJavaScriptUrl' - ); - return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'string', $response->getHeaders())); - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - } - - throw $e; - } - } - - /** - * Operation buildMobileSdkUrlWithCredentials - * - * Build Mobile SDK URL with Credentials - * - * @param string $credentials The credentials identifies the transaction and contains the security details which grants the access this operation. (required) - * @throws \Wallee\Sdk\ApiException - * @throws \Wallee\Sdk\VersioningException - * @throws \Wallee\Sdk\Http\ConnectionException - * @return string - */ - public function buildMobileSdkUrlWithCredentials($credentials) { - return $this->buildMobileSdkUrlWithCredentialsWithHttpInfo($credentials)->getData(); - } - - /** - * Operation buildMobileSdkUrlWithCredentialsWithHttpInfo - * - * Build Mobile SDK URL with Credentials - * - * @param string $credentials The credentials identifies the transaction and contains the security details which grants the access this operation. (required) - * @throws \Wallee\Sdk\ApiException - * @throws \Wallee\Sdk\VersioningException - * @throws \Wallee\Sdk\Http\ConnectionException - * @return ApiResponse - */ - public function buildMobileSdkUrlWithCredentialsWithHttpInfo($credentials) { - // verify the required parameter 'credentials' is set - if ($credentials === null) { - throw new \InvalidArgumentException('Missing the required parameter $credentials when calling buildMobileSdkUrlWithCredentials'); - } - // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array()); - if ($headerAccept !== null) { - $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; - } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); - - // query params - $queryParams = array(); - if ($credentials !== null) { - $queryParams['credentials'] = $this->apiClient->getSerializer()->toQueryValue($credentials); - } - - // path params - $resourcePath = "/transaction/buildMobileSdkUrlWithCredentials"; - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - - // form params - $formParams = array(); - - // for model (json/xml) - $httpBody = ''; - if (isset($tempBody)) { - $httpBody = $tempBody; // $tempBody is the method argument, if present - } elseif (!empty($formParams)) { - $httpBody = $formParams; // for HTTP post (form) - } - // make the API Call - try { - $response = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - 'string', - '/transaction/buildMobileSdkUrlWithCredentials' - ); - return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'string', $response->getHeaders())); - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - } - - throw $e; - } - } - - /** - * Operation buildPaymentPageUrl - * - * Build Payment Page URL - * - * @param int $spaceId (required) - * @param int $id The id of the transaction which should be returned. (required) - * @throws \Wallee\Sdk\ApiException - * @throws \Wallee\Sdk\VersioningException - * @throws \Wallee\Sdk\Http\ConnectionException - * @return string - */ - public function buildPaymentPageUrl($spaceId, $id) { - return $this->buildPaymentPageUrlWithHttpInfo($spaceId, $id)->getData(); - } - - /** - * Operation buildPaymentPageUrlWithHttpInfo - * - * Build Payment Page URL - * - * @param int $spaceId (required) - * @param int $id The id of the transaction which should be returned. (required) - * @throws \Wallee\Sdk\ApiException - * @throws \Wallee\Sdk\VersioningException - * @throws \Wallee\Sdk\Http\ConnectionException - * @return ApiResponse - */ - public function buildPaymentPageUrlWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling buildPaymentPageUrl'); - } - // verify the required parameter 'id' is set - if ($id === null) { - throw new \InvalidArgumentException('Missing the required parameter $id when calling buildPaymentPageUrl'); - } - // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array()); - if ($headerAccept !== null) { - $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; - } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); - - // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); - } - if ($id !== null) { - $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); - } - - // path params - $resourcePath = "/transaction/buildPaymentPageUrl"; - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - - // form params - $formParams = array(); - - // for model (json/xml) - $httpBody = ''; - if (isset($tempBody)) { - $httpBody = $tempBody; // $tempBody is the method argument, if present - } elseif (!empty($formParams)) { - $httpBody = $formParams; // for HTTP post (form) - } - // make the API Call - try { - $response = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - 'string', - '/transaction/buildPaymentPageUrl' - ); - return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'string', $response->getHeaders())); - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - } - - throw $e; - } - } - /** * Operation confirm * * Confirm * - * @param int $spaceId (required) - * @param \Wallee\Sdk\Model\TransactionPending $transactionModel The transaction JSON object to update and confirm. (required) + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\TransactionPending $transaction_model The transaction JSON object to update and confirm. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\Transaction */ - public function confirm($spaceId, $transactionModel) { - return $this->confirmWithHttpInfo($spaceId, $transactionModel)->getData(); + public function confirm($space_id, $transaction_model) { + return $this->confirmWithHttpInfo($space_id, $transaction_model)->getData(); } /** @@ -393,47 +87,47 @@ public function confirm($spaceId, $transactionModel) { * * Confirm * - * @param int $spaceId (required) - * @param \Wallee\Sdk\Model\TransactionPending $transactionModel The transaction JSON object to update and confirm. (required) + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\TransactionPending $transaction_model The transaction JSON object to update and confirm. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function confirmWithHttpInfo($spaceId, $transactionModel) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling confirm'); + public function confirmWithHttpInfo($space_id, $transaction_model) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling confirm'); } - // verify the required parameter 'transactionModel' is set - if ($transactionModel === null) { - throw new \InvalidArgumentException('Missing the required parameter $transactionModel when calling confirm'); + // verify the required parameter 'transaction_model' is set + if (is_null($transaction_model)) { + throw new \InvalidArgumentException('Missing the required parameter $transaction_model when calling confirm'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/transaction/confirm"; + $resourcePath = '/transaction/confirm'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; - if (isset($transactionModel)) { - $tempBody = $transactionModel; + if (isset($transaction_model)) { + $tempBody = $transaction_model; } // for model (json/xml) @@ -457,24 +151,39 @@ public function confirmWithHttpInfo($spaceId, $transactionModel) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Transaction', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Transaction', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Transaction', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -484,15 +193,15 @@ public function confirmWithHttpInfo($spaceId, $transactionModel) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return int */ - public function count($spaceId, $filter = null) { - return $this->countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -500,39 +209,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/transaction/count"; + $resourcePath = '/transaction/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -560,20 +269,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -583,15 +303,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\TransactionCreate $transaction The transaction object which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\Transaction */ - public function create($spaceId, $transaction) { - return $this->createWithHttpInfo($spaceId, $transaction)->getData(); + public function create($space_id, $transaction) { + return $this->createWithHttpInfo($space_id, $transaction)->getData(); } /** @@ -599,43 +319,43 @@ public function create($spaceId, $transaction) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\TransactionCreate $transaction The transaction object which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $transaction) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $transaction) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } // verify the required parameter 'transaction' is set - if ($transaction === null) { + if (is_null($transaction)) { throw new \InvalidArgumentException('Missing the required parameter $transaction when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/transaction/create"; + $resourcePath = '/transaction/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($transaction)) { @@ -663,20 +383,31 @@ public function createWithHttpInfo($spaceId, $transaction) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Transaction', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Transaction', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Transaction', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -686,15 +417,15 @@ public function createWithHttpInfo($spaceId, $transaction) { * * Create Transaction Credentials * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return string */ - public function createTransactionCredentials($spaceId, $id) { - return $this->createTransactionCredentialsWithHttpInfo($spaceId, $id)->getData(); + public function createTransactionCredentials($space_id, $id) { + return $this->createTransactionCredentialsWithHttpInfo($space_id, $id)->getData(); } /** @@ -702,46 +433,46 @@ public function createTransactionCredentials($spaceId, $id) { * * Create Transaction Credentials * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createTransactionCredentialsWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling createTransactionCredentials'); + public function createTransactionCredentialsWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling createTransactionCredentials'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling createTransactionCredentials'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array()); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept([]); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/transaction/createTransactionCredentials"; + $resourcePath = '/transaction/createTransactionCredentials'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -764,20 +495,31 @@ public function createTransactionCredentialsWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'string', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -788,14 +530,14 @@ public function createTransactionCredentialsWithHttpInfo($spaceId, $id) { * Delete One-Click Token with Credentials * * @param string $credentials The credentials identifies the transaction and contains the security details which grants the access this operation. (required) - * @param int $tokenId The token ID will be used to find the token which should be removed. (required) + * @param int $token_id The token ID will be used to find the token which should be removed. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return void */ - public function deleteOneClickTokenWithCredentials($credentials, $tokenId) { - return $this->deleteOneClickTokenWithCredentialsWithHttpInfo($credentials, $tokenId)->getData(); + public function deleteOneClickTokenWithCredentials($credentials, $token_id) { + return $this->deleteOneClickTokenWithCredentialsWithHttpInfo($credentials, $token_id)->getData(); } /** @@ -804,45 +546,45 @@ public function deleteOneClickTokenWithCredentials($credentials, $tokenId) { * Delete One-Click Token with Credentials * * @param string $credentials The credentials identifies the transaction and contains the security details which grants the access this operation. (required) - * @param int $tokenId The token ID will be used to find the token which should be removed. (required) + * @param int $token_id The token ID will be used to find the token which should be removed. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function deleteOneClickTokenWithCredentialsWithHttpInfo($credentials, $tokenId) { + public function deleteOneClickTokenWithCredentialsWithHttpInfo($credentials, $token_id) { // verify the required parameter 'credentials' is set - if ($credentials === null) { + if (is_null($credentials)) { throw new \InvalidArgumentException('Missing the required parameter $credentials when calling deleteOneClickTokenWithCredentials'); } - // verify the required parameter 'tokenId' is set - if ($tokenId === null) { - throw new \InvalidArgumentException('Missing the required parameter $tokenId when calling deleteOneClickTokenWithCredentials'); + // verify the required parameter 'token_id' is set + if (is_null($token_id)) { + throw new \InvalidArgumentException('Missing the required parameter $token_id when calling deleteOneClickTokenWithCredentials'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array()); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept([]); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($credentials !== null) { + $queryParams = []; + if (!is_null($credentials)) { $queryParams['credentials'] = $this->apiClient->getSerializer()->toQueryValue($credentials); } - if ($tokenId !== null) { - $queryParams['tokenId'] = $this->apiClient->getSerializer()->toQueryValue($tokenId); + if (!is_null($token_id)) { + $queryParams['tokenId'] = $this->apiClient->getSerializer()->toQueryValue($token_id); } // path params - $resourcePath = "/transaction/deleteOneClickTokenWithCredentials"; + $resourcePath = '/transaction/deleteOneClickTokenWithCredentials'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -865,16 +607,23 @@ public function deleteOneClickTokenWithCredentialsWithHttpInfo($credentials, $to return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -884,15 +633,15 @@ public function deleteOneClickTokenWithCredentialsWithHttpInfo($credentials, $to * * Export * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityExportRequest $request The request controls the entries which are exported. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return string */ - public function export($spaceId, $request) { - return $this->exportWithHttpInfo($spaceId, $request)->getData(); + public function export($space_id, $request) { + return $this->exportWithHttpInfo($space_id, $request)->getData(); } /** @@ -900,43 +649,43 @@ public function export($spaceId, $request) { * * Export * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityExportRequest $request The request controls the entries which are exported. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function exportWithHttpInfo($spaceId, $request) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling export'); + public function exportWithHttpInfo($space_id, $request) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling export'); } // verify the required parameter 'request' is set - if ($request === null) { + if (is_null($request)) { throw new \InvalidArgumentException('Missing the required parameter $request when calling export'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8', 'text/csv')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8', 'text/csv']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/transaction/export"; + $resourcePath = '/transaction/export'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($request)) { @@ -964,20 +713,31 @@ public function exportWithHttpInfo($spaceId, $request) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'string', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1010,30 +770,30 @@ public function fetchOneClickTokensWithCredentials($credentials) { */ public function fetchOneClickTokensWithCredentialsWithHttpInfo($credentials) { // verify the required parameter 'credentials' is set - if ($credentials === null) { + if (is_null($credentials)) { throw new \InvalidArgumentException('Missing the required parameter $credentials when calling fetchOneClickTokensWithCredentials'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array()); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept([]); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($credentials !== null) { + $queryParams = []; + if (!is_null($credentials)) { $queryParams['credentials'] = $this->apiClient->getSerializer()->toQueryValue($credentials); } // path params - $resourcePath = "/transaction/fetchOneClickTokensWithCredentials"; + $resourcePath = '/transaction/fetchOneClickTokensWithCredentials'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -1056,20 +816,31 @@ public function fetchOneClickTokensWithCredentialsWithHttpInfo($credentials) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TokenVersion[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\TokenVersion[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TokenVersion[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1079,15 +850,15 @@ public function fetchOneClickTokensWithCredentialsWithHttpInfo($credentials) { * * Fetch Possible Payment Methods * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\PaymentMethodConfiguration[] */ - public function fetchPossiblePaymentMethods($spaceId, $id) { - return $this->fetchPossiblePaymentMethodsWithHttpInfo($spaceId, $id)->getData(); + public function fetchPossiblePaymentMethods($space_id, $id) { + return $this->fetchPossiblePaymentMethodsWithHttpInfo($space_id, $id)->getData(); } /** @@ -1095,46 +866,46 @@ public function fetchPossiblePaymentMethods($spaceId, $id) { * * Fetch Possible Payment Methods * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function fetchPossiblePaymentMethodsWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling fetchPossiblePaymentMethods'); + public function fetchPossiblePaymentMethodsWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling fetchPossiblePaymentMethods'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling fetchPossiblePaymentMethods'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/transaction/fetchPossiblePaymentMethods"; + $resourcePath = '/transaction/fetchPossiblePaymentMethods'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -1157,20 +928,31 @@ public function fetchPossiblePaymentMethodsWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\PaymentMethodConfiguration[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\PaymentMethodConfiguration[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\PaymentMethodConfiguration[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1203,30 +985,30 @@ public function fetchPossiblePaymentMethodsWithCredentials($credentials) { */ public function fetchPossiblePaymentMethodsWithCredentialsWithHttpInfo($credentials) { // verify the required parameter 'credentials' is set - if ($credentials === null) { + if (is_null($credentials)) { throw new \InvalidArgumentException('Missing the required parameter $credentials when calling fetchPossiblePaymentMethodsWithCredentials'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($credentials !== null) { + $queryParams = []; + if (!is_null($credentials)) { $queryParams['credentials'] = $this->apiClient->getSerializer()->toQueryValue($credentials); } // path params - $resourcePath = "/transaction/fetchPossiblePaymentMethodsWithCredentials"; + $resourcePath = '/transaction/fetchPossiblePaymentMethodsWithCredentials'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -1249,20 +1031,31 @@ public function fetchPossiblePaymentMethodsWithCredentialsWithHttpInfo($credenti return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\PaymentMethodConfiguration[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\PaymentMethodConfiguration[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\PaymentMethodConfiguration[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1272,15 +1065,15 @@ public function fetchPossiblePaymentMethodsWithCredentialsWithHttpInfo($credenti * * getInvoiceDocument * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction to get the invoice document for. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\RenderedDocument */ - public function getInvoiceDocument($spaceId, $id) { - return $this->getInvoiceDocumentWithHttpInfo($spaceId, $id)->getData(); + public function getInvoiceDocument($space_id, $id) { + return $this->getInvoiceDocumentWithHttpInfo($space_id, $id)->getData(); } /** @@ -1288,46 +1081,46 @@ public function getInvoiceDocument($spaceId, $id) { * * getInvoiceDocument * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction to get the invoice document for. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function getInvoiceDocumentWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling getInvoiceDocument'); + public function getInvoiceDocumentWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling getInvoiceDocument'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling getInvoiceDocument'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/transaction/getInvoiceDocument"; + $resourcePath = '/transaction/getInvoiceDocument'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -1350,20 +1143,31 @@ public function getInvoiceDocumentWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\RenderedDocument', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\RenderedDocument', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\RenderedDocument', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1373,15 +1177,15 @@ public function getInvoiceDocumentWithHttpInfo($spaceId, $id) { * * getLatestTransactionLineItemVersion * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction to get the latest line item version for. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\TransactionLineItemVersion */ - public function getLatestTransactionLineItemVersion($spaceId, $id) { - return $this->getLatestTransactionLineItemVersionWithHttpInfo($spaceId, $id)->getData(); + public function getLatestTransactionLineItemVersion($space_id, $id) { + return $this->getLatestTransactionLineItemVersionWithHttpInfo($space_id, $id)->getData(); } /** @@ -1389,46 +1193,46 @@ public function getLatestTransactionLineItemVersion($spaceId, $id) { * * getLatestTransactionLineItemVersion * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction to get the latest line item version for. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function getLatestTransactionLineItemVersionWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling getLatestTransactionLineItemVersion'); + public function getLatestTransactionLineItemVersionWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling getLatestTransactionLineItemVersion'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling getLatestTransactionLineItemVersion'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/transaction/getLatestTransactionLineItemVersion"; + $resourcePath = '/transaction/getLatestTransactionLineItemVersion'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -1451,20 +1255,31 @@ public function getLatestTransactionLineItemVersionWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionLineItemVersion', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\TransactionLineItemVersion', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionLineItemVersion', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1474,15 +1289,15 @@ public function getLatestTransactionLineItemVersionWithHttpInfo($spaceId, $id) { * * getPackingSlip * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction to get the packing slip for. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\RenderedDocument */ - public function getPackingSlip($spaceId, $id) { - return $this->getPackingSlipWithHttpInfo($spaceId, $id)->getData(); + public function getPackingSlip($space_id, $id) { + return $this->getPackingSlipWithHttpInfo($space_id, $id)->getData(); } /** @@ -1490,46 +1305,46 @@ public function getPackingSlip($spaceId, $id) { * * getPackingSlip * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction to get the packing slip for. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function getPackingSlipWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling getPackingSlip'); + public function getPackingSlipWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling getPackingSlip'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling getPackingSlip'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/transaction/getPackingSlip"; + $resourcePath = '/transaction/getPackingSlip'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -1552,85 +1367,96 @@ public function getPackingSlipWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\RenderedDocument', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\RenderedDocument', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\RenderedDocument', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } /** - * Operation processOneClickTokenWithCredentials + * Operation processOneClickTokenAndRedirectWithCredentials * * Process One-Click Token with Credentials * * @param string $credentials The credentials identifies the transaction and contains the security details which grants the access this operation. (required) - * @param int $tokenId The token ID is used to load the corresponding token and to process the transaction with it. (required) + * @param int $token_id The token ID is used to load the corresponding token and to process the transaction with it. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException - * @return \Wallee\Sdk\Model\Transaction + * @return string */ - public function processOneClickTokenWithCredentials($credentials, $tokenId) { - return $this->processOneClickTokenWithCredentialsWithHttpInfo($credentials, $tokenId)->getData(); + public function processOneClickTokenAndRedirectWithCredentials($credentials, $token_id) { + return $this->processOneClickTokenAndRedirectWithCredentialsWithHttpInfo($credentials, $token_id)->getData(); } /** - * Operation processOneClickTokenWithCredentialsWithHttpInfo + * Operation processOneClickTokenAndRedirectWithCredentialsWithHttpInfo * * Process One-Click Token with Credentials * * @param string $credentials The credentials identifies the transaction and contains the security details which grants the access this operation. (required) - * @param int $tokenId The token ID is used to load the corresponding token and to process the transaction with it. (required) + * @param int $token_id The token ID is used to load the corresponding token and to process the transaction with it. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function processOneClickTokenWithCredentialsWithHttpInfo($credentials, $tokenId) { + public function processOneClickTokenAndRedirectWithCredentialsWithHttpInfo($credentials, $token_id) { // verify the required parameter 'credentials' is set - if ($credentials === null) { - throw new \InvalidArgumentException('Missing the required parameter $credentials when calling processOneClickTokenWithCredentials'); + if (is_null($credentials)) { + throw new \InvalidArgumentException('Missing the required parameter $credentials when calling processOneClickTokenAndRedirectWithCredentials'); } - // verify the required parameter 'tokenId' is set - if ($tokenId === null) { - throw new \InvalidArgumentException('Missing the required parameter $tokenId when calling processOneClickTokenWithCredentials'); + // verify the required parameter 'token_id' is set + if (is_null($token_id)) { + throw new \InvalidArgumentException('Missing the required parameter $token_id when calling processOneClickTokenAndRedirectWithCredentials'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array()); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept([]); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($credentials !== null) { + $queryParams = []; + if (!is_null($credentials)) { $queryParams['credentials'] = $this->apiClient->getSerializer()->toQueryValue($credentials); } - if ($tokenId !== null) { - $queryParams['tokenId'] = $this->apiClient->getSerializer()->toQueryValue($tokenId); + if (!is_null($token_id)) { + $queryParams['tokenId'] = $this->apiClient->getSerializer()->toQueryValue($token_id); } // path params - $resourcePath = "/transaction/processOneClickTokenWithCredentials"; + $resourcePath = '/transaction/processOneClickTokenAndRedirectWithCredentials'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -1647,26 +1473,37 @@ public function processOneClickTokenWithCredentialsWithHttpInfo($credentials, $t $queryParams, $httpBody, $headerParams, - '\Wallee\Sdk\Model\Transaction', - '/transaction/processOneClickTokenWithCredentials' + 'string', + '/transaction/processOneClickTokenAndRedirectWithCredentials' ); - return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Transaction', $response->getHeaders())); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'string', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Transaction', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1676,15 +1513,15 @@ public function processOneClickTokenWithCredentialsWithHttpInfo($credentials, $t * * Process Without User Interaction * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction which should be processed. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\Transaction */ - public function processWithoutUserInteraction($spaceId, $id) { - return $this->processWithoutUserInteractionWithHttpInfo($spaceId, $id)->getData(); + public function processWithoutUserInteraction($space_id, $id) { + return $this->processWithoutUserInteractionWithHttpInfo($space_id, $id)->getData(); } /** @@ -1692,46 +1529,46 @@ public function processWithoutUserInteraction($spaceId, $id) { * * Process Without User Interaction * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction which should be processed. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function processWithoutUserInteractionWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling processWithoutUserInteraction'); + public function processWithoutUserInteractionWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling processWithoutUserInteraction'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling processWithoutUserInteraction'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array()); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept([]); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/transaction/processWithoutUserInteraction"; + $resourcePath = '/transaction/processWithoutUserInteraction'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -1754,20 +1591,31 @@ public function processWithoutUserInteractionWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Transaction', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Transaction', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Transaction', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1777,15 +1625,15 @@ public function processWithoutUserInteractionWithHttpInfo($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\Transaction */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -1793,46 +1641,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/transaction/read"; + $resourcePath = '/transaction/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -1855,20 +1703,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Transaction', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Transaction', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Transaction', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1901,30 +1760,30 @@ public function readWithCredentials($credentials) { */ public function readWithCredentialsWithHttpInfo($credentials) { // verify the required parameter 'credentials' is set - if ($credentials === null) { + if (is_null($credentials)) { throw new \InvalidArgumentException('Missing the required parameter $credentials when calling readWithCredentials'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($credentials !== null) { + $queryParams = []; + if (!is_null($credentials)) { $queryParams['credentials'] = $this->apiClient->getSerializer()->toQueryValue($credentials); } // path params - $resourcePath = "/transaction/readWithCredentials"; + $resourcePath = '/transaction/readWithCredentials'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -1947,20 +1806,31 @@ public function readWithCredentialsWithHttpInfo($credentials) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Transaction', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Transaction', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Transaction', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1970,15 +1840,15 @@ public function readWithCredentialsWithHttpInfo($credentials) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the transactions which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\Transaction[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -1986,43 +1856,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the transactions which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/transaction/search"; + $resourcePath = '/transaction/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -2050,20 +1920,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Transaction[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Transaction[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Transaction[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -2073,15 +1954,15 @@ public function searchWithHttpInfo($spaceId, $query) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\TransactionPending $entity The transaction object with the properties which should be updated. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\Transaction */ - public function update($spaceId, $entity) { - return $this->updateWithHttpInfo($spaceId, $entity)->getData(); + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); } /** @@ -2089,43 +1970,43 @@ public function update($spaceId, $entity) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\TransactionPending $entity The transaction object with the properties which should be updated. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function updateWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling update'); + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/transaction/update"; + $resourcePath = '/transaction/update'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -2153,24 +2034,39 @@ public function updateWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\Transaction', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\Transaction', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\Transaction', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -2180,15 +2076,15 @@ public function updateWithHttpInfo($spaceId, $entity) { * * updateTransactionLineItems * - * @param int $spaceId (required) - * @param \Wallee\Sdk\Model\TransactionLineItemUpdateRequest $updateRequest (required) + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\TransactionLineItemUpdateRequest $update_request (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\TransactionLineItemVersion */ - public function updateTransactionLineItems($spaceId, $updateRequest) { - return $this->updateTransactionLineItemsWithHttpInfo($spaceId, $updateRequest)->getData(); + public function updateTransactionLineItems($space_id, $update_request) { + return $this->updateTransactionLineItemsWithHttpInfo($space_id, $update_request)->getData(); } /** @@ -2196,47 +2092,47 @@ public function updateTransactionLineItems($spaceId, $updateRequest) { * * updateTransactionLineItems * - * @param int $spaceId (required) - * @param \Wallee\Sdk\Model\TransactionLineItemUpdateRequest $updateRequest (required) + * @param int $space_id (required) + * @param \Wallee\Sdk\Model\TransactionLineItemUpdateRequest $update_request (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function updateTransactionLineItemsWithHttpInfo($spaceId, $updateRequest) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling updateTransactionLineItems'); + public function updateTransactionLineItemsWithHttpInfo($space_id, $update_request) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling updateTransactionLineItems'); } - // verify the required parameter 'updateRequest' is set - if ($updateRequest === null) { - throw new \InvalidArgumentException('Missing the required parameter $updateRequest when calling updateTransactionLineItems'); + // verify the required parameter 'update_request' is set + if (is_null($update_request)) { + throw new \InvalidArgumentException('Missing the required parameter $update_request when calling updateTransactionLineItems'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/transaction/updateTransactionLineItems"; + $resourcePath = '/transaction/updateTransactionLineItems'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; - if (isset($updateRequest)) { - $tempBody = $updateRequest; + if (isset($update_request)) { + $tempBody = $update_request; } // for model (json/xml) @@ -2260,24 +2156,39 @@ public function updateTransactionLineItemsWithHttpInfo($spaceId, $updateRequest) return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionLineItemVersion', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\TransactionLineItemVersion', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionLineItemVersion', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/TransactionVoidService.php b/wallee-sdk/lib/Service/TransactionVoidService.php index 7814c3f..dce6cbe 100644 --- a/wallee-sdk/lib/Service/TransactionVoidService.php +++ b/wallee-sdk/lib/Service/TransactionVoidService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/transaction-void/count"; + $resourcePath = '/transaction-void/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction voids which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\TransactionVoid */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -186,46 +197,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction voids which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/transaction-void/read"; + $resourcePath = '/transaction-void/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -248,20 +259,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionVoid', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\TransactionVoid', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionVoid', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -271,15 +293,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the transaction voids which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\TransactionVoid[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -287,43 +309,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the transaction voids which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/transaction-void/search"; + $resourcePath = '/transaction-void/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -351,20 +373,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionVoid[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\TransactionVoid[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionVoid[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -374,15 +407,15 @@ public function searchWithHttpInfo($spaceId, $query) { * * voidOffline * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction which should be voided. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\TransactionVoid */ - public function voidOffline($spaceId, $id) { - return $this->voidOfflineWithHttpInfo($spaceId, $id)->getData(); + public function voidOffline($space_id, $id) { + return $this->voidOfflineWithHttpInfo($space_id, $id)->getData(); } /** @@ -390,46 +423,46 @@ public function voidOffline($spaceId, $id) { * * voidOffline * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction which should be voided. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function voidOfflineWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling voidOffline'); + public function voidOfflineWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling voidOffline'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling voidOffline'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/transaction-void/voidOffline"; + $resourcePath = '/transaction-void/voidOffline'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -452,20 +485,31 @@ public function voidOfflineWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionVoid', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\TransactionVoid', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionVoid', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -475,15 +519,15 @@ public function voidOfflineWithHttpInfo($spaceId, $id) { * * voidOnline * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction which should be voided. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\TransactionVoid */ - public function voidOnline($spaceId, $id) { - return $this->voidOnlineWithHttpInfo($spaceId, $id)->getData(); + public function voidOnline($space_id, $id) { + return $this->voidOnlineWithHttpInfo($space_id, $id)->getData(); } /** @@ -491,46 +535,46 @@ public function voidOnline($spaceId, $id) { * * voidOnline * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the transaction which should be voided. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function voidOnlineWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling voidOnline'); + public function voidOnlineWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling voidOnline'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling voidOnline'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/transaction-void/voidOnline"; + $resourcePath = '/transaction-void/voidOnline'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -553,20 +597,31 @@ public function voidOnlineWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\TransactionVoid', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\TransactionVoid', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\TransactionVoid', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/UserAccountRoleService.php b/wallee-sdk/lib/Service/UserAccountRoleService.php index b3cb339..05f20d6 100644 --- a/wallee-sdk/lib/Service/UserAccountRoleService.php +++ b/wallee-sdk/lib/Service/UserAccountRoleService.php @@ -1,10 +1,8 @@ addRoleWithHttpInfo($userId, $accountId, $roleId, $appliesOnSubaccount)->getData(); + public function addRole($user_id, $account_id, $role_id, $applies_on_subaccount = null) { + return $this->addRoleWithHttpInfo($user_id, $account_id, $role_id, $applies_on_subaccount)->getData(); } /** @@ -89,58 +89,58 @@ public function addRole($userId, $accountId, $roleId, $appliesOnSubaccount = nul * * Add Role * - * @param int $userId The id of the user to whom the role is assigned. (required) - * @param int $accountId The account to which the role is mapped. (required) - * @param int $roleId The role which is mapped to the user and account. (required) - * @param bool $appliesOnSubaccount Whether the role applies only on subaccount. (optional) + * @param int $user_id The id of the user to whom the role is assigned. (required) + * @param int $account_id The account to which the role is mapped. (required) + * @param int $role_id The role which is mapped to the user and account. (required) + * @param bool $applies_on_subaccount Whether the role applies only on subaccount. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function addRoleWithHttpInfo($userId, $accountId, $roleId, $appliesOnSubaccount = null) { - // verify the required parameter 'userId' is set - if ($userId === null) { - throw new \InvalidArgumentException('Missing the required parameter $userId when calling addRole'); + public function addRoleWithHttpInfo($user_id, $account_id, $role_id, $applies_on_subaccount = null) { + // verify the required parameter 'user_id' is set + if (is_null($user_id)) { + throw new \InvalidArgumentException('Missing the required parameter $user_id when calling addRole'); } - // verify the required parameter 'accountId' is set - if ($accountId === null) { - throw new \InvalidArgumentException('Missing the required parameter $accountId when calling addRole'); + // verify the required parameter 'account_id' is set + if (is_null($account_id)) { + throw new \InvalidArgumentException('Missing the required parameter $account_id when calling addRole'); } - // verify the required parameter 'roleId' is set - if ($roleId === null) { - throw new \InvalidArgumentException('Missing the required parameter $roleId when calling addRole'); + // verify the required parameter 'role_id' is set + if (is_null($role_id)) { + throw new \InvalidArgumentException('Missing the required parameter $role_id when calling addRole'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($userId !== null) { - $queryParams['userId'] = $this->apiClient->getSerializer()->toQueryValue($userId); + $queryParams = []; + if (!is_null($user_id)) { + $queryParams['userId'] = $this->apiClient->getSerializer()->toQueryValue($user_id); } - if ($accountId !== null) { - $queryParams['accountId'] = $this->apiClient->getSerializer()->toQueryValue($accountId); + if (!is_null($account_id)) { + $queryParams['accountId'] = $this->apiClient->getSerializer()->toQueryValue($account_id); } - if ($roleId !== null) { - $queryParams['roleId'] = $this->apiClient->getSerializer()->toQueryValue($roleId); + if (!is_null($role_id)) { + $queryParams['roleId'] = $this->apiClient->getSerializer()->toQueryValue($role_id); } - if ($appliesOnSubaccount !== null) { - $queryParams['appliesOnSubaccount'] = $this->apiClient->getSerializer()->toQueryValue($appliesOnSubaccount); + if (!is_null($applies_on_subaccount)) { + $queryParams['appliesOnSubaccount'] = $this->apiClient->getSerializer()->toQueryValue($applies_on_subaccount); } // path params - $resourcePath = "/user-account-role/addRole"; + $resourcePath = '/user-account-role/addRole'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -163,20 +163,31 @@ public function addRoleWithHttpInfo($userId, $accountId, $roleId, $appliesOnSuba return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\UserAccountRole', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\UserAccountRole', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\UserAccountRole', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -186,15 +197,15 @@ public function addRoleWithHttpInfo($userId, $accountId, $roleId, $appliesOnSuba * * List Roles * - * @param int $userId The id of the user to whom the role is assigned. (required) - * @param int $accountId The account to which the role is mapped. (required) + * @param int $user_id The id of the user to whom the role is assigned. (required) + * @param int $account_id The account to which the role is mapped. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\UserAccountRole[] */ - public function callList($userId, $accountId) { - return $this->callListWithHttpInfo($userId, $accountId)->getData(); + public function callList($user_id, $account_id) { + return $this->callListWithHttpInfo($user_id, $account_id)->getData(); } /** @@ -202,46 +213,46 @@ public function callList($userId, $accountId) { * * List Roles * - * @param int $userId The id of the user to whom the role is assigned. (required) - * @param int $accountId The account to which the role is mapped. (required) + * @param int $user_id The id of the user to whom the role is assigned. (required) + * @param int $account_id The account to which the role is mapped. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function callListWithHttpInfo($userId, $accountId) { - // verify the required parameter 'userId' is set - if ($userId === null) { - throw new \InvalidArgumentException('Missing the required parameter $userId when calling callList'); + public function callListWithHttpInfo($user_id, $account_id) { + // verify the required parameter 'user_id' is set + if (is_null($user_id)) { + throw new \InvalidArgumentException('Missing the required parameter $user_id when calling callList'); } - // verify the required parameter 'accountId' is set - if ($accountId === null) { - throw new \InvalidArgumentException('Missing the required parameter $accountId when calling callList'); + // verify the required parameter 'account_id' is set + if (is_null($account_id)) { + throw new \InvalidArgumentException('Missing the required parameter $account_id when calling callList'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($userId !== null) { - $queryParams['userId'] = $this->apiClient->getSerializer()->toQueryValue($userId); + $queryParams = []; + if (!is_null($user_id)) { + $queryParams['userId'] = $this->apiClient->getSerializer()->toQueryValue($user_id); } - if ($accountId !== null) { - $queryParams['accountId'] = $this->apiClient->getSerializer()->toQueryValue($accountId); + if (!is_null($account_id)) { + $queryParams['accountId'] = $this->apiClient->getSerializer()->toQueryValue($account_id); } // path params - $resourcePath = "/user-account-role/list"; + $resourcePath = '/user-account-role/list'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -264,20 +275,31 @@ public function callListWithHttpInfo($userId, $accountId) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\UserAccountRole[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\UserAccountRole[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\UserAccountRole[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -310,30 +332,30 @@ public function removeRole($id) { */ public function removeRoleWithHttpInfo($id) { // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling removeRole'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($id !== null) { + $queryParams = []; + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/user-account-role/removeRole"; + $resourcePath = '/user-account-role/removeRole'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -356,16 +378,23 @@ public function removeRoleWithHttpInfo($id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/UserSpaceRoleService.php b/wallee-sdk/lib/Service/UserSpaceRoleService.php index 281e900..3efecd5 100644 --- a/wallee-sdk/lib/Service/UserSpaceRoleService.php +++ b/wallee-sdk/lib/Service/UserSpaceRoleService.php @@ -1,10 +1,8 @@ addRoleWithHttpInfo($userId, $spaceId, $roleId)->getData(); + public function addRole($user_id, $space_id, $role_id) { + return $this->addRoleWithHttpInfo($user_id, $space_id, $role_id)->getData(); } /** @@ -88,54 +88,54 @@ public function addRole($userId, $spaceId, $roleId) { * * Add Role * - * @param int $userId The id of the user to whom the role is assigned. (required) - * @param int $spaceId The space to which the role is mapped. (required) - * @param int $roleId The role which is mapped to the user and space. (required) + * @param int $user_id The id of the user to whom the role is assigned. (required) + * @param int $space_id The space to which the role is mapped. (required) + * @param int $role_id The role which is mapped to the user and space. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function addRoleWithHttpInfo($userId, $spaceId, $roleId) { - // verify the required parameter 'userId' is set - if ($userId === null) { - throw new \InvalidArgumentException('Missing the required parameter $userId when calling addRole'); + public function addRoleWithHttpInfo($user_id, $space_id, $role_id) { + // verify the required parameter 'user_id' is set + if (is_null($user_id)) { + throw new \InvalidArgumentException('Missing the required parameter $user_id when calling addRole'); } - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling addRole'); + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling addRole'); } - // verify the required parameter 'roleId' is set - if ($roleId === null) { - throw new \InvalidArgumentException('Missing the required parameter $roleId when calling addRole'); + // verify the required parameter 'role_id' is set + if (is_null($role_id)) { + throw new \InvalidArgumentException('Missing the required parameter $role_id when calling addRole'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($userId !== null) { - $queryParams['userId'] = $this->apiClient->getSerializer()->toQueryValue($userId); + $queryParams = []; + if (!is_null($user_id)) { + $queryParams['userId'] = $this->apiClient->getSerializer()->toQueryValue($user_id); } - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($roleId !== null) { - $queryParams['roleId'] = $this->apiClient->getSerializer()->toQueryValue($roleId); + if (!is_null($role_id)) { + $queryParams['roleId'] = $this->apiClient->getSerializer()->toQueryValue($role_id); } // path params - $resourcePath = "/user-space-role/addRole"; + $resourcePath = '/user-space-role/addRole'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -158,20 +158,31 @@ public function addRoleWithHttpInfo($userId, $spaceId, $roleId) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\UserSpaceRole', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\UserSpaceRole', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\UserSpaceRole', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -181,15 +192,15 @@ public function addRoleWithHttpInfo($userId, $spaceId, $roleId) { * * List Roles * - * @param int $userId The id of the user to whom the role is assigned. (required) - * @param int $spaceId The space to which the role is mapped. (required) + * @param int $user_id The id of the user to whom the role is assigned. (required) + * @param int $space_id The space to which the role is mapped. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\UserSpaceRole[] */ - public function callList($userId, $spaceId) { - return $this->callListWithHttpInfo($userId, $spaceId)->getData(); + public function callList($user_id, $space_id) { + return $this->callListWithHttpInfo($user_id, $space_id)->getData(); } /** @@ -197,46 +208,46 @@ public function callList($userId, $spaceId) { * * List Roles * - * @param int $userId The id of the user to whom the role is assigned. (required) - * @param int $spaceId The space to which the role is mapped. (required) + * @param int $user_id The id of the user to whom the role is assigned. (required) + * @param int $space_id The space to which the role is mapped. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function callListWithHttpInfo($userId, $spaceId) { - // verify the required parameter 'userId' is set - if ($userId === null) { - throw new \InvalidArgumentException('Missing the required parameter $userId when calling callList'); + public function callListWithHttpInfo($user_id, $space_id) { + // verify the required parameter 'user_id' is set + if (is_null($user_id)) { + throw new \InvalidArgumentException('Missing the required parameter $user_id when calling callList'); } - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling callList'); + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling callList'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($userId !== null) { - $queryParams['userId'] = $this->apiClient->getSerializer()->toQueryValue($userId); + $queryParams = []; + if (!is_null($user_id)) { + $queryParams['userId'] = $this->apiClient->getSerializer()->toQueryValue($user_id); } - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/user-space-role/list"; + $resourcePath = '/user-space-role/list'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -259,24 +270,39 @@ public function callListWithHttpInfo($userId, $spaceId) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\UserSpaceRole[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\UserSpaceRole[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\UserSpaceRole[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -309,30 +335,30 @@ public function removeRole($id) { */ public function removeRoleWithHttpInfo($id) { // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling removeRole'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array()); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType([]); // query params - $queryParams = array(); - if ($id !== null) { + $queryParams = []; + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/user-space-role/removeRole"; + $resourcePath = '/user-space-role/removeRole'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -355,16 +381,23 @@ public function removeRoleWithHttpInfo($id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/WebhookListenerService.php b/wallee-sdk/lib/Service/WebhookListenerService.php index ab12d51..cd428b5 100644 --- a/wallee-sdk/lib/Service/WebhookListenerService.php +++ b/wallee-sdk/lib/Service/WebhookListenerService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/webhook-listener/count"; + $resourcePath = '/webhook-listener/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\WebhookListenerCreate $entity The webhook listener object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\WebhookListener */ - public function create($spaceId, $entity) { - return $this->createWithHttpInfo($spaceId, $entity)->getData(); + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); } /** @@ -186,43 +197,43 @@ public function create($spaceId, $entity) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\WebhookListenerCreate $entity The webhook listener object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/webhook-listener/create"; + $resourcePath = '/webhook-listener/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -250,20 +261,31 @@ public function createWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\WebhookListener', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\WebhookListener', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\WebhookListener', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -273,15 +295,15 @@ public function createWithHttpInfo($spaceId, $entity) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return void */ - public function delete($spaceId, $id) { - return $this->deleteWithHttpInfo($spaceId, $id)->getData(); + public function delete($space_id, $id) { + return $this->deleteWithHttpInfo($space_id, $id)->getData(); } /** @@ -289,43 +311,43 @@ public function delete($spaceId, $id) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function deleteWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling delete'); + public function deleteWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling delete'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/webhook-listener/delete"; + $resourcePath = '/webhook-listener/delete'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($id)) { @@ -353,20 +375,31 @@ public function deleteWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -376,15 +409,15 @@ public function deleteWithHttpInfo($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the webhook listener which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\WebhookListener */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -392,46 +425,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the webhook listener which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/webhook-listener/read"; + $resourcePath = '/webhook-listener/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -454,20 +487,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\WebhookListener', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\WebhookListener', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\WebhookListener', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -477,15 +521,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the webhook listeners which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\WebhookListener[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -493,43 +537,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the webhook listeners which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/webhook-listener/search"; + $resourcePath = '/webhook-listener/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -557,20 +601,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\WebhookListener[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\WebhookListener[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\WebhookListener[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -580,15 +635,15 @@ public function searchWithHttpInfo($spaceId, $query) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\WebhookListenerUpdate $entity The webhook listener object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\WebhookListener */ - public function update($spaceId, $entity) { - return $this->updateWithHttpInfo($spaceId, $entity)->getData(); + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); } /** @@ -596,43 +651,43 @@ public function update($spaceId, $entity) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\WebhookListenerUpdate $entity The webhook listener object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function updateWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling update'); + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/webhook-listener/update"; + $resourcePath = '/webhook-listener/update'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -660,24 +715,39 @@ public function updateWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\WebhookListener', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\WebhookListener', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\WebhookListener', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/Service/WebhookUrlService.php b/wallee-sdk/lib/Service/WebhookUrlService.php index 7ecaf51..bc52d57 100644 --- a/wallee-sdk/lib/Service/WebhookUrlService.php +++ b/wallee-sdk/lib/Service/WebhookUrlService.php @@ -1,10 +1,8 @@ countWithHttpInfo($spaceId, $filter)->getData(); + public function count($space_id, $filter = null) { + return $this->countWithHttpInfo($space_id, $filter)->getData(); } /** @@ -87,39 +87,39 @@ public function count($spaceId, $filter = null) { * * Count * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQueryFilter $filter The filter which restricts the entities which are used to calculate the count. (optional) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function countWithHttpInfo($spaceId, $filter = null) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling count'); + public function countWithHttpInfo($space_id, $filter = null) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling count'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/webhook-url/count"; + $resourcePath = '/webhook-url/count'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($filter)) { @@ -147,20 +147,31 @@ public function countWithHttpInfo($spaceId, $filter = null) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), 'int', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'int', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -170,15 +181,15 @@ public function countWithHttpInfo($spaceId, $filter = null) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\WebhookUrlCreate $entity The webhook url object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\WebhookUrl */ - public function create($spaceId, $entity) { - return $this->createWithHttpInfo($spaceId, $entity)->getData(); + public function create($space_id, $entity) { + return $this->createWithHttpInfo($space_id, $entity)->getData(); } /** @@ -186,43 +197,43 @@ public function create($spaceId, $entity) { * * Create * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\WebhookUrlCreate $entity The webhook url object with the properties which should be created. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function createWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling create'); + public function createWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling create'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling create'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/webhook-url/create"; + $resourcePath = '/webhook-url/create'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -250,20 +261,31 @@ public function createWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\WebhookUrl', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\WebhookUrl', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\WebhookUrl', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -273,15 +295,15 @@ public function createWithHttpInfo($spaceId, $entity) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return void */ - public function delete($spaceId, $id) { - return $this->deleteWithHttpInfo($spaceId, $id)->getData(); + public function delete($space_id, $id) { + return $this->deleteWithHttpInfo($space_id, $id)->getData(); } /** @@ -289,43 +311,43 @@ public function delete($spaceId, $id) { * * Delete * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function deleteWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling delete'); + public function deleteWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling delete'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling delete'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/webhook-url/delete"; + $resourcePath = '/webhook-url/delete'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($id)) { @@ -353,20 +375,31 @@ public function deleteWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders()); } catch (ApiException $e) { switch ($e->getCode()) { - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -376,15 +409,15 @@ public function deleteWithHttpInfo($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the webhook url which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\WebhookUrl */ - public function read($spaceId, $id) { - return $this->readWithHttpInfo($spaceId, $id)->getData(); + public function read($space_id, $id) { + return $this->readWithHttpInfo($space_id, $id)->getData(); } /** @@ -392,46 +425,46 @@ public function read($spaceId, $id) { * * Read * - * @param int $spaceId (required) + * @param int $space_id (required) * @param int $id The id of the webhook url which should be returned. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function readWithHttpInfo($spaceId, $id) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling read'); + public function readWithHttpInfo($space_id, $id) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling read'); } // verify the required parameter 'id' is set - if ($id === null) { + if (is_null($id)) { throw new \InvalidArgumentException('Missing the required parameter $id when calling read'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('*/*')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['*/*']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } - if ($id !== null) { + if (!is_null($id)) { $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id); } // path params - $resourcePath = "/webhook-url/read"; + $resourcePath = '/webhook-url/read'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // for model (json/xml) $httpBody = ''; @@ -454,20 +487,31 @@ public function readWithHttpInfo($spaceId, $id) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\WebhookUrl', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\WebhookUrl', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\WebhookUrl', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -477,15 +521,15 @@ public function readWithHttpInfo($spaceId, $id) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the webhook urls which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\WebhookUrl[] */ - public function search($spaceId, $query) { - return $this->searchWithHttpInfo($spaceId, $query)->getData(); + public function search($space_id, $query) { + return $this->searchWithHttpInfo($space_id, $query)->getData(); } /** @@ -493,43 +537,43 @@ public function search($spaceId, $query) { * * Search * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\EntityQuery $query The query restricts the webhook urls which are returned by the search. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function searchWithHttpInfo($spaceId, $query) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling search'); + public function searchWithHttpInfo($space_id, $query) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling search'); } // verify the required parameter 'query' is set - if ($query === null) { + if (is_null($query)) { throw new \InvalidArgumentException('Missing the required parameter $query when calling search'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/webhook-url/search"; + $resourcePath = '/webhook-url/search'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($query)) { @@ -557,20 +601,31 @@ public function searchWithHttpInfo($spaceId, $query) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\WebhookUrl[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\WebhookUrl[]', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\WebhookUrl[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -580,15 +635,15 @@ public function searchWithHttpInfo($spaceId, $query) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\WebhookUrlUpdate $entity The webhook url object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return \Wallee\Sdk\Model\WebhookUrl */ - public function update($spaceId, $entity) { - return $this->updateWithHttpInfo($spaceId, $entity)->getData(); + public function update($space_id, $entity) { + return $this->updateWithHttpInfo($space_id, $entity)->getData(); } /** @@ -596,43 +651,43 @@ public function update($spaceId, $entity) { * * Update * - * @param int $spaceId (required) + * @param int $space_id (required) * @param \Wallee\Sdk\Model\WebhookUrlUpdate $entity The webhook url object with all the properties which should be updated. The id and the version are required properties. (required) * @throws \Wallee\Sdk\ApiException * @throws \Wallee\Sdk\VersioningException * @throws \Wallee\Sdk\Http\ConnectionException * @return ApiResponse */ - public function updateWithHttpInfo($spaceId, $entity) { - // verify the required parameter 'spaceId' is set - if ($spaceId === null) { - throw new \InvalidArgumentException('Missing the required parameter $spaceId when calling update'); + public function updateWithHttpInfo($space_id, $entity) { + // verify the required parameter 'space_id' is set + if (is_null($space_id)) { + throw new \InvalidArgumentException('Missing the required parameter $space_id when calling update'); } // verify the required parameter 'entity' is set - if ($entity === null) { + if (is_null($entity)) { throw new \InvalidArgumentException('Missing the required parameter $entity when calling update'); } // header params - $headerParams = array(); - $headerAccept = $this->apiClient->selectHeaderAccept(array('application/json;charset=utf-8')); - if ($headerAccept !== null) { + $headerParams = []; + $headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8']); + if (!is_null($headerAccept)) { $headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept; } - $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(array('application/json;charset=utf-8')); + $headerParams[HttpRequest::HEADER_KEY_CONTENT_TYPE] = $this->apiClient->selectHeaderContentType(['application/json;charset=utf-8']); // query params - $queryParams = array(); - if ($spaceId !== null) { - $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($spaceId); + $queryParams = []; + if (!is_null($space_id)) { + $queryParams['spaceId'] = $this->apiClient->getSerializer()->toQueryValue($space_id); } // path params - $resourcePath = "/webhook-url/update"; + $resourcePath = '/webhook-url/update'; // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); // form params - $formParams = array(); + $formParams = []; // body params $tempBody = null; if (isset($entity)) { @@ -660,24 +715,39 @@ public function updateWithHttpInfo($spaceId, $entity) { return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\Wallee\Sdk\Model\WebhookUrl', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\WebhookUrl', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 409: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 442: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ClientError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; - case 542: - $responseObject = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Wallee\Sdk\Model\ServerError', $e->getResponseHeaders()); - $e = new ApiException($e->getLogToken(), $responseObject->getMessage(), $e->getCode(), $e->getResponseHeaders(), $e->getResponseBody(), $responseObject); - break; + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\WebhookUrl', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 442: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 542: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Wallee\Sdk\Model\ServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } diff --git a/wallee-sdk/lib/ValidationException.php b/wallee-sdk/lib/ValidationException.php index 427835c..326e289 100644 --- a/wallee-sdk/lib/ValidationException.php +++ b/wallee-sdk/lib/ValidationException.php @@ -1,10 +1,8 @@ property = $property; } diff --git a/wallee-sdk/lib/VersioningException.php b/wallee-sdk/lib/VersioningException.php index 906a4b9..c7aab04 100644 --- a/wallee-sdk/lib/VersioningException.php +++ b/wallee-sdk/lib/VersioningException.php @@ -1,10 +1,8 @@ + + + + ./test/Service + ./test/Model + + + + + + ./lib/Service + ./lib/Model + + + diff --git a/wallee.php b/wallee.php index f443cd2..a2d0dee 100644 --- a/wallee.php +++ b/wallee.php @@ -34,7 +34,7 @@ public function __construct() $this->author = 'Customweb GmbH'; $this->bootstrap = true; $this->need_instance = 0; - $this->version = '1.1.8'; + $this->version = '1.1.9'; $this->displayName = 'wallee'; $this->description = $this->l('This PrestaShop module enables to process payments with %s.'); $this->description = sprintf($this->description, 'wallee');