From 6528175c5190639a58e6b556c1d795c2c2db3b5f Mon Sep 17 00:00:00 2001 From: Cloudmersive <35204726+Cloudmersive@users.noreply.github.com> Date: Sat, 28 Dec 2019 18:41:28 -0800 Subject: [PATCH] 1.5.4 --- README.md | 6 +- composer.json | 2 +- docs/Api/AddressApi.md | 58 ++- docs/Model/GetTimezonesRequest.md | 10 + docs/Model/GetTimezonesResponse.md | 15 + docs/Model/Timezone.md | 11 + docs/Model/ValidateCountryResponse.md | 1 + lib/Api/AddressApi.php | 262 ++++++++++++ lib/Configuration.php | 4 +- lib/Model/GetTimezonesRequest.php | 303 ++++++++++++++ lib/Model/GetTimezonesResponse.php | 453 +++++++++++++++++++++ lib/Model/Timezone.php | 333 +++++++++++++++ lib/Model/ValidateCountryResponse.php | 40 +- packageconfig.json | 2 +- test/Api/AddressApiTest.php | 10 + test/Model/GetTimezonesRequestTest.php | 86 ++++ test/Model/GetTimezonesResponseTest.php | 121 ++++++ test/Model/TimezoneTest.php | 93 +++++ test/Model/ValidateCountryResponseTest.php | 7 + 19 files changed, 1806 insertions(+), 11 deletions(-) create mode 100644 docs/Model/GetTimezonesRequest.md create mode 100644 docs/Model/GetTimezonesResponse.md create mode 100644 docs/Model/Timezone.md create mode 100644 lib/Model/GetTimezonesRequest.php create mode 100644 lib/Model/GetTimezonesResponse.php create mode 100644 lib/Model/Timezone.php create mode 100644 test/Model/GetTimezonesRequestTest.php create mode 100644 test/Model/GetTimezonesResponseTest.php create mode 100644 test/Model/TimezoneTest.php diff --git a/README.md b/README.md index 67e31db..24cffc5 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The validation APIs help you validate data. Check if an E-mail address is real. [Cloudmersive Validation API](https://www.cloudmersive.com/validate-api) provides data validation capabilities for validating email addresses, phone numbers, IP addresses, and many other types of business data. - API version: v1 -- Package version: 1.5.3 +- Package version: 1.5.4 ## Requirements @@ -87,6 +87,7 @@ All URIs are relative to *https://api.cloudmersive.com* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AddressApi* | [**addressCountry**](docs/Api/AddressApi.md#addresscountry) | **POST** /validate/address/country | Validate and normalize country information, return ISO 3166-1 country codes and country name +*AddressApi* | [**addressGetTimezone**](docs/Api/AddressApi.md#addressgettimezone) | **POST** /validate/address/country/get-timezones | Gets IANA/Olsen time zones for a country *AddressApi* | [**addressParseString**](docs/Api/AddressApi.md#addressparsestring) | **POST** /validate/address/parse | Parse an unstructured input text string into an international, formatted address *DomainApi* | [**domainCheck**](docs/Api/DomainApi.md#domaincheck) | **POST** /validate/domain/check | Validate a domain name *DomainApi* | [**domainPost**](docs/Api/DomainApi.md#domainpost) | **POST** /validate/domain/whois | Get WHOIS information for a domain @@ -120,6 +121,8 @@ Class | Method | HTTP request | Description - [GeolocateResponse](docs/Model/GeolocateResponse.md) - [GetGenderRequest](docs/Model/GetGenderRequest.md) - [GetGenderResponse](docs/Model/GetGenderResponse.md) + - [GetTimezonesRequest](docs/Model/GetTimezonesRequest.md) + - [GetTimezonesResponse](docs/Model/GetTimezonesResponse.md) - [LastNameValidationRequest](docs/Model/LastNameValidationRequest.md) - [LastNameValidationResponse](docs/Model/LastNameValidationResponse.md) - [LeadEnrichmentRequest](docs/Model/LeadEnrichmentRequest.md) @@ -128,6 +131,7 @@ Class | Method | HTTP request | Description - [ParseAddressResponse](docs/Model/ParseAddressResponse.md) - [PhoneNumberValidateRequest](docs/Model/PhoneNumberValidateRequest.md) - [PhoneNumberValidationResponse](docs/Model/PhoneNumberValidationResponse.md) + - [Timezone](docs/Model/Timezone.md) - [UserAgentValidateRequest](docs/Model/UserAgentValidateRequest.md) - [UserAgentValidateResponse](docs/Model/UserAgentValidateResponse.md) - [ValidateCountryRequest](docs/Model/ValidateCountryRequest.md) diff --git a/composer.json b/composer.json index 7ea8c7b..15c3f0c 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "cloudmersive/cloudmersive_validate_api_client", - "version": "1.5.3", + "version": "1.5.4", "description": "", "keywords": [ "swagger", diff --git a/docs/Api/AddressApi.md b/docs/Api/AddressApi.md index d739566..d2f5b9b 100644 --- a/docs/Api/AddressApi.md +++ b/docs/Api/AddressApi.md @@ -5,6 +5,7 @@ All URIs are relative to *https://api.cloudmersive.com* Method | HTTP request | Description ------------- | ------------- | ------------- [**addressCountry**](AddressApi.md#addressCountry) | **POST** /validate/address/country | Validate and normalize country information, return ISO 3166-1 country codes and country name +[**addressGetTimezone**](AddressApi.md#addressGetTimezone) | **POST** /validate/address/country/get-timezones | Gets IANA/Olsen time zones for a country [**addressParseString**](AddressApi.md#addressParseString) | **POST** /validate/address/parse | Parse an unstructured input text string into an international, formatted address @@ -13,7 +14,7 @@ Method | HTTP request | Description Validate and normalize country information, return ISO 3166-1 country codes and country name -Validates and normalizes country information, and returns key information about a country. +Validates and normalizes country information, and returns key information about a country. Also returns distinct time zones in the country. ### Example ```php @@ -63,6 +64,61 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +# **addressGetTimezone** +> \Swagger\Client\Model\GetTimezonesResponse addressGetTimezone($input) + +Gets IANA/Olsen time zones for a country + +Gets the IANA/Olsen time zones for a country. + +### Example +```php +setApiKey('Apikey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Apikey', 'Bearer'); + +$apiInstance = new Swagger\Client\Api\AddressApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$input = new \Swagger\Client\Model\GetTimezonesRequest(); // \Swagger\Client\Model\GetTimezonesRequest | Input request + +try { + $result = $apiInstance->addressGetTimezone($input); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AddressApi->addressGetTimezone: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **input** | [**\Swagger\Client\Model\GetTimezonesRequest**](../Model/GetTimezonesRequest.md)| Input request | + +### Return type + +[**\Swagger\Client\Model\GetTimezonesResponse**](../Model/GetTimezonesResponse.md) + +### Authorization + +[Apikey](../../README.md#Apikey) + +### HTTP request headers + + - **Content-Type**: application/json, text/json + - **Accept**: application/json, text/json, application/xml, text/xml + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + # **addressParseString** > \Swagger\Client\Model\ParseAddressResponse addressParseString($input) diff --git a/docs/Model/GetTimezonesRequest.md b/docs/Model/GetTimezonesRequest.md new file mode 100644 index 0000000..246ff15 --- /dev/null +++ b/docs/Model/GetTimezonesRequest.md @@ -0,0 +1,10 @@ +# GetTimezonesRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country_code_or_name** | **string** | Can be the two-letter, three-letter country codes or country name | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Model/GetTimezonesResponse.md b/docs/Model/GetTimezonesResponse.md new file mode 100644 index 0000000..57d0375 --- /dev/null +++ b/docs/Model/GetTimezonesResponse.md @@ -0,0 +1,15 @@ +# GetTimezonesResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**successful** | **bool** | True if successful, false otherwise | [optional] +**country_full_name** | **string** | Full name of the country | [optional] +**iso_two_letter_code** | **string** | Two-letter ISO 3166-1 country code | [optional] +**fips_two_letter_code** | **string** | Two-letter FIPS 10-4 country code | [optional] +**three_letter_code** | **string** | Three-letter ISO 3166-1 country code | [optional] +**timezones** | [**\Swagger\Client\Model\Timezone[]**](Timezone.md) | Time zones (IANA/Olsen) in the country | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Model/Timezone.md b/docs/Model/Timezone.md new file mode 100644 index 0000000..ea47cf1 --- /dev/null +++ b/docs/Model/Timezone.md @@ -0,0 +1,11 @@ +# Timezone + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Name of the Time Zone | [optional] +**base_utc_offset** | **string** | UTC offset for this time zone | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Model/ValidateCountryResponse.md b/docs/Model/ValidateCountryResponse.md index 4c7c77c..eb39650 100644 --- a/docs/Model/ValidateCountryResponse.md +++ b/docs/Model/ValidateCountryResponse.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **iso_two_letter_code** | **string** | Two-letter ISO 3166-1 country code | [optional] **fips_two_letter_code** | **string** | Two-letter FIPS 10-4 country code | [optional] **three_letter_code** | **string** | Three-letter ISO 3166-1 country code | [optional] +**timezones** | [**\Swagger\Client\Model\Timezone[]**](Timezone.md) | Time zones (IANA/Olsen) in the country | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/lib/Api/AddressApi.php b/lib/Api/AddressApi.php index c53383d..fe73f77 100644 --- a/lib/Api/AddressApi.php +++ b/lib/Api/AddressApi.php @@ -272,6 +272,268 @@ protected function addressCountryRequest($input) + // body params + $_tempBody = null; + if (isset($input)) { + $_tempBody = $input; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json', 'text/json', 'application/xml', 'text/xml'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/json', 'application/xml', 'text/xml'], + ['application/json', 'text/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Apikey'); + if ($apiKey !== null) { + $headers['Apikey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation addressGetTimezone + * + * Gets IANA/Olsen time zones for a country + * + * @param \Swagger\Client\Model\GetTimezonesRequest $input Input request (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\GetTimezonesResponse + */ + public function addressGetTimezone($input) + { + list($response) = $this->addressGetTimezoneWithHttpInfo($input); + return $response; + } + + /** + * Operation addressGetTimezoneWithHttpInfo + * + * Gets IANA/Olsen time zones for a country + * + * @param \Swagger\Client\Model\GetTimezonesRequest $input Input request (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\GetTimezonesResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function addressGetTimezoneWithHttpInfo($input) + { + $returnType = '\Swagger\Client\Model\GetTimezonesResponse'; + $request = $this->addressGetTimezoneRequest($input); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\GetTimezonesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addressGetTimezoneAsync + * + * Gets IANA/Olsen time zones for a country + * + * @param \Swagger\Client\Model\GetTimezonesRequest $input Input request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function addressGetTimezoneAsync($input) + { + return $this->addressGetTimezoneAsyncWithHttpInfo($input) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addressGetTimezoneAsyncWithHttpInfo + * + * Gets IANA/Olsen time zones for a country + * + * @param \Swagger\Client\Model\GetTimezonesRequest $input Input request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function addressGetTimezoneAsyncWithHttpInfo($input) + { + $returnType = '\Swagger\Client\Model\GetTimezonesResponse'; + $request = $this->addressGetTimezoneRequest($input); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addressGetTimezone' + * + * @param \Swagger\Client\Model\GetTimezonesRequest $input Input request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function addressGetTimezoneRequest($input) + { + // verify the required parameter 'input' is set + if ($input === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $input when calling addressGetTimezone' + ); + } + + $resourcePath = '/validate/address/country/get-timezones'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // body params $_tempBody = null; if (isset($input)) { diff --git a/lib/Configuration.php b/lib/Configuration.php index 0b3acce..b5cfc3f 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -88,7 +88,7 @@ class Configuration * * @var string */ - protected $userAgent = 'Swagger-Codegen/1.5.3/php'; + protected $userAgent = 'Swagger-Codegen/1.5.4/php'; /** * Debug switch (default set to false) @@ -397,7 +397,7 @@ public static function toDebugReport() $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' OpenAPI Spec Version: v1' . PHP_EOL; - $report .= ' SDK Package Version: 1.5.3' . PHP_EOL; + $report .= ' SDK Package Version: 1.5.4' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/Model/GetTimezonesRequest.php b/lib/Model/GetTimezonesRequest.php new file mode 100644 index 0000000..f3dd013 --- /dev/null +++ b/lib/Model/GetTimezonesRequest.php @@ -0,0 +1,303 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'country_code_or_name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'country_code_or_name' => 'CountryCodeOrName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'country_code_or_name' => 'setCountryCodeOrName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'country_code_or_name' => 'getCountryCodeOrName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['country_code_or_name'] = isset($data['country_code_or_name']) ? $data['country_code_or_name'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets country_code_or_name + * + * @return string + */ + public function getCountryCodeOrName() + { + return $this->container['country_code_or_name']; + } + + /** + * Sets country_code_or_name + * + * @param string $country_code_or_name Can be the two-letter, three-letter country codes or country name + * + * @return $this + */ + public function setCountryCodeOrName($country_code_or_name) + { + $this->container['country_code_or_name'] = $country_code_or_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/lib/Model/GetTimezonesResponse.php b/lib/Model/GetTimezonesResponse.php new file mode 100644 index 0000000..c2b4703 --- /dev/null +++ b/lib/Model/GetTimezonesResponse.php @@ -0,0 +1,453 @@ + 'bool', + 'country_full_name' => 'string', + 'iso_two_letter_code' => 'string', + 'fips_two_letter_code' => 'string', + 'three_letter_code' => 'string', + 'timezones' => '\Swagger\Client\Model\Timezone[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'successful' => null, + 'country_full_name' => null, + 'iso_two_letter_code' => null, + 'fips_two_letter_code' => null, + 'three_letter_code' => null, + 'timezones' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'successful' => 'Successful', + 'country_full_name' => 'CountryFullName', + 'iso_two_letter_code' => 'ISOTwoLetterCode', + 'fips_two_letter_code' => 'FIPSTwoLetterCode', + 'three_letter_code' => 'ThreeLetterCode', + 'timezones' => 'Timezones' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'successful' => 'setSuccessful', + 'country_full_name' => 'setCountryFullName', + 'iso_two_letter_code' => 'setIsoTwoLetterCode', + 'fips_two_letter_code' => 'setFipsTwoLetterCode', + 'three_letter_code' => 'setThreeLetterCode', + 'timezones' => 'setTimezones' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'successful' => 'getSuccessful', + 'country_full_name' => 'getCountryFullName', + 'iso_two_letter_code' => 'getIsoTwoLetterCode', + 'fips_two_letter_code' => 'getFipsTwoLetterCode', + 'three_letter_code' => 'getThreeLetterCode', + 'timezones' => 'getTimezones' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['successful'] = isset($data['successful']) ? $data['successful'] : null; + $this->container['country_full_name'] = isset($data['country_full_name']) ? $data['country_full_name'] : null; + $this->container['iso_two_letter_code'] = isset($data['iso_two_letter_code']) ? $data['iso_two_letter_code'] : null; + $this->container['fips_two_letter_code'] = isset($data['fips_two_letter_code']) ? $data['fips_two_letter_code'] : null; + $this->container['three_letter_code'] = isset($data['three_letter_code']) ? $data['three_letter_code'] : null; + $this->container['timezones'] = isset($data['timezones']) ? $data['timezones'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets successful + * + * @return bool + */ + public function getSuccessful() + { + return $this->container['successful']; + } + + /** + * Sets successful + * + * @param bool $successful True if successful, false otherwise + * + * @return $this + */ + public function setSuccessful($successful) + { + $this->container['successful'] = $successful; + + return $this; + } + + /** + * Gets country_full_name + * + * @return string + */ + public function getCountryFullName() + { + return $this->container['country_full_name']; + } + + /** + * Sets country_full_name + * + * @param string $country_full_name Full name of the country + * + * @return $this + */ + public function setCountryFullName($country_full_name) + { + $this->container['country_full_name'] = $country_full_name; + + return $this; + } + + /** + * Gets iso_two_letter_code + * + * @return string + */ + public function getIsoTwoLetterCode() + { + return $this->container['iso_two_letter_code']; + } + + /** + * Sets iso_two_letter_code + * + * @param string $iso_two_letter_code Two-letter ISO 3166-1 country code + * + * @return $this + */ + public function setIsoTwoLetterCode($iso_two_letter_code) + { + $this->container['iso_two_letter_code'] = $iso_two_letter_code; + + return $this; + } + + /** + * Gets fips_two_letter_code + * + * @return string + */ + public function getFipsTwoLetterCode() + { + return $this->container['fips_two_letter_code']; + } + + /** + * Sets fips_two_letter_code + * + * @param string $fips_two_letter_code Two-letter FIPS 10-4 country code + * + * @return $this + */ + public function setFipsTwoLetterCode($fips_two_letter_code) + { + $this->container['fips_two_letter_code'] = $fips_two_letter_code; + + return $this; + } + + /** + * Gets three_letter_code + * + * @return string + */ + public function getThreeLetterCode() + { + return $this->container['three_letter_code']; + } + + /** + * Sets three_letter_code + * + * @param string $three_letter_code Three-letter ISO 3166-1 country code + * + * @return $this + */ + public function setThreeLetterCode($three_letter_code) + { + $this->container['three_letter_code'] = $three_letter_code; + + return $this; + } + + /** + * Gets timezones + * + * @return \Swagger\Client\Model\Timezone[] + */ + public function getTimezones() + { + return $this->container['timezones']; + } + + /** + * Sets timezones + * + * @param \Swagger\Client\Model\Timezone[] $timezones Time zones (IANA/Olsen) in the country + * + * @return $this + */ + public function setTimezones($timezones) + { + $this->container['timezones'] = $timezones; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Timezone.php b/lib/Model/Timezone.php new file mode 100644 index 0000000..35981de --- /dev/null +++ b/lib/Model/Timezone.php @@ -0,0 +1,333 @@ + 'string', + 'base_utc_offset' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'base_utc_offset' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'Name', + 'base_utc_offset' => 'BaseUTCOffset' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'base_utc_offset' => 'setBaseUtcOffset' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'base_utc_offset' => 'getBaseUtcOffset' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['base_utc_offset'] = isset($data['base_utc_offset']) ? $data['base_utc_offset'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the Time Zone + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets base_utc_offset + * + * @return string + */ + public function getBaseUtcOffset() + { + return $this->container['base_utc_offset']; + } + + /** + * Sets base_utc_offset + * + * @param string $base_utc_offset UTC offset for this time zone + * + * @return $this + */ + public function setBaseUtcOffset($base_utc_offset) + { + $this->container['base_utc_offset'] = $base_utc_offset; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ValidateCountryResponse.php b/lib/Model/ValidateCountryResponse.php index df842a2..b2ec9ef 100644 --- a/lib/Model/ValidateCountryResponse.php +++ b/lib/Model/ValidateCountryResponse.php @@ -62,7 +62,8 @@ class ValidateCountryResponse implements ModelInterface, ArrayAccess 'country_full_name' => 'string', 'iso_two_letter_code' => 'string', 'fips_two_letter_code' => 'string', - 'three_letter_code' => 'string' + 'three_letter_code' => 'string', + 'timezones' => '\Swagger\Client\Model\Timezone[]' ]; /** @@ -75,7 +76,8 @@ class ValidateCountryResponse implements ModelInterface, ArrayAccess 'country_full_name' => null, 'iso_two_letter_code' => null, 'fips_two_letter_code' => null, - 'three_letter_code' => null + 'three_letter_code' => null, + 'timezones' => null ]; /** @@ -109,7 +111,8 @@ public static function swaggerFormats() 'country_full_name' => 'CountryFullName', 'iso_two_letter_code' => 'ISOTwoLetterCode', 'fips_two_letter_code' => 'FIPSTwoLetterCode', - 'three_letter_code' => 'ThreeLetterCode' + 'three_letter_code' => 'ThreeLetterCode', + 'timezones' => 'Timezones' ]; /** @@ -122,7 +125,8 @@ public static function swaggerFormats() 'country_full_name' => 'setCountryFullName', 'iso_two_letter_code' => 'setIsoTwoLetterCode', 'fips_two_letter_code' => 'setFipsTwoLetterCode', - 'three_letter_code' => 'setThreeLetterCode' + 'three_letter_code' => 'setThreeLetterCode', + 'timezones' => 'setTimezones' ]; /** @@ -135,7 +139,8 @@ public static function swaggerFormats() 'country_full_name' => 'getCountryFullName', 'iso_two_letter_code' => 'getIsoTwoLetterCode', 'fips_two_letter_code' => 'getFipsTwoLetterCode', - 'three_letter_code' => 'getThreeLetterCode' + 'three_letter_code' => 'getThreeLetterCode', + 'timezones' => 'getTimezones' ]; /** @@ -203,6 +208,7 @@ public function __construct(array $data = null) $this->container['iso_two_letter_code'] = isset($data['iso_two_letter_code']) ? $data['iso_two_letter_code'] : null; $this->container['fips_two_letter_code'] = isset($data['fips_two_letter_code']) ? $data['fips_two_letter_code'] : null; $this->container['three_letter_code'] = isset($data['three_letter_code']) ? $data['three_letter_code'] : null; + $this->container['timezones'] = isset($data['timezones']) ? $data['timezones'] : null; } /** @@ -349,6 +355,30 @@ public function setThreeLetterCode($three_letter_code) return $this; } + + /** + * Gets timezones + * + * @return \Swagger\Client\Model\Timezone[] + */ + public function getTimezones() + { + return $this->container['timezones']; + } + + /** + * Sets timezones + * + * @param \Swagger\Client\Model\Timezone[] $timezones Time zones (IANA/Olsen) in the country + * + * @return $this + */ + public function setTimezones($timezones) + { + $this->container['timezones'] = $timezones; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/packageconfig.json b/packageconfig.json index ae3e29a..97f2939 100644 --- a/packageconfig.json +++ b/packageconfig.json @@ -1,5 +1,5 @@ { - "artifactVersion": "1.5.3", + "artifactVersion": "1.5.4", "gitUserId": "Cloudmersive", "gitRepoId": "Cloudmersive.APIClient.PHP.Validate", "composerVendorName": "cloudmersive", diff --git a/test/Api/AddressApiTest.php b/test/Api/AddressApiTest.php index 8f0caee..dcb7c49 100644 --- a/test/Api/AddressApiTest.php +++ b/test/Api/AddressApiTest.php @@ -81,6 +81,16 @@ public function testAddressCountry() { } + /** + * Test case for addressGetTimezone + * + * Gets IANA/Olsen time zones for a country. + * + */ + public function testAddressGetTimezone() + { + } + /** * Test case for addressParseString * diff --git a/test/Model/GetTimezonesRequestTest.php b/test/Model/GetTimezonesRequestTest.php new file mode 100644 index 0000000..e37edf9 --- /dev/null +++ b/test/Model/GetTimezonesRequestTest.php @@ -0,0 +1,86 @@ +