From 85b2786dc93302a6b98e7f00fed58dbc1873efb1 Mon Sep 17 00:00:00 2001 From: Cloudmersive <35204726+Cloudmersive@users.noreply.github.com> Date: Sat, 14 Nov 2020 18:44:30 -0800 Subject: [PATCH] 1.6.7 --- README.md | 15 +- composer.json | 2 +- docs/Api/AddressApi.md | 56 + docs/Api/DateTimeApi.md | 228 ++++ docs/Api/DomainApi.md | 6 +- docs/Api/EmailApi.md | 6 +- docs/Api/IPAddressApi.md | 8 +- docs/Api/TextInputApi.md | 4 +- .../DateTimeNaturalLanguageParseRequest.md | 10 + docs/Model/DateTimeNowResult.md | 12 + .../Model/DateTimeStandardizedParseRequest.md | 11 + .../DateTimeStandardizedParseResponse.md | 18 + docs/Model/GetPublicHolidaysRequest.md | 11 + docs/Model/NormalizeAddressResponse.md | 20 + docs/Model/PublicHolidayOccurrence.md | 14 + docs/Model/PublicHolidaysResponse.md | 11 + lib/Api/AddressApi.php | 262 ++++ lib/Api/DateTimeApi.php | 1137 +++++++++++++++++ lib/Api/DomainApi.php | 6 +- lib/Api/EmailApi.php | 6 +- lib/Api/IPAddressApi.php | 8 +- lib/Api/TextInputApi.php | 4 +- lib/Configuration.php | 4 +- .../DateTimeNaturalLanguageParseRequest.php | 303 +++++ lib/Model/DateTimeNowResult.php | 363 ++++++ .../DateTimeStandardizedParseRequest.php | 333 +++++ .../DateTimeStandardizedParseResponse.php | 543 ++++++++ lib/Model/GetPublicHolidaysRequest.php | 333 +++++ lib/Model/NormalizeAddressResponse.php | 603 +++++++++ lib/Model/PublicHolidayOccurrence.php | 423 ++++++ lib/Model/PublicHolidaysResponse.php | 333 +++++ packageconfig.json | 2 +- test/Api/AddressApiTest.php | 10 + test/Api/DateTimeApiTest.php | 113 ++ ...ateTimeNaturalLanguageParseRequestTest.php | 86 ++ test/Model/DateTimeNowResultTest.php | 100 ++ .../DateTimeStandardizedParseRequestTest.php | 93 ++ .../DateTimeStandardizedParseResponseTest.php | 142 ++ test/Model/GetPublicHolidaysRequestTest.php | 93 ++ test/Model/NormalizeAddressResponseTest.php | 156 +++ test/Model/PublicHolidayOccurrenceTest.php | 114 ++ test/Model/PublicHolidaysResponseTest.php | 93 ++ 42 files changed, 6066 insertions(+), 29 deletions(-) create mode 100644 docs/Api/DateTimeApi.md create mode 100644 docs/Model/DateTimeNaturalLanguageParseRequest.md create mode 100644 docs/Model/DateTimeNowResult.md create mode 100644 docs/Model/DateTimeStandardizedParseRequest.md create mode 100644 docs/Model/DateTimeStandardizedParseResponse.md create mode 100644 docs/Model/GetPublicHolidaysRequest.md create mode 100644 docs/Model/NormalizeAddressResponse.md create mode 100644 docs/Model/PublicHolidayOccurrence.md create mode 100644 docs/Model/PublicHolidaysResponse.md create mode 100644 lib/Api/DateTimeApi.php create mode 100644 lib/Model/DateTimeNaturalLanguageParseRequest.php create mode 100644 lib/Model/DateTimeNowResult.php create mode 100644 lib/Model/DateTimeStandardizedParseRequest.php create mode 100644 lib/Model/DateTimeStandardizedParseResponse.php create mode 100644 lib/Model/GetPublicHolidaysRequest.php create mode 100644 lib/Model/NormalizeAddressResponse.php create mode 100644 lib/Model/PublicHolidayOccurrence.php create mode 100644 lib/Model/PublicHolidaysResponse.php create mode 100644 test/Api/DateTimeApiTest.php create mode 100644 test/Model/DateTimeNaturalLanguageParseRequestTest.php create mode 100644 test/Model/DateTimeNowResultTest.php create mode 100644 test/Model/DateTimeStandardizedParseRequestTest.php create mode 100644 test/Model/DateTimeStandardizedParseResponseTest.php create mode 100644 test/Model/GetPublicHolidaysRequestTest.php create mode 100644 test/Model/NormalizeAddressResponseTest.php create mode 100644 test/Model/PublicHolidayOccurrenceTest.php create mode 100644 test/Model/PublicHolidaysResponseTest.php diff --git a/README.md b/README.md index ddfc969..28e7206 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.6.6 +- Package version: 1.6.7 ## Requirements @@ -93,12 +93,17 @@ Class | Method | HTTP request | Description *AddressApi* | [**addressGetCountryCurrency**](docs/Api/AddressApi.md#addressgetcountrycurrency) | **POST** /validate/address/country/get-currency | Get the currency of the input country *AddressApi* | [**addressGetCountryRegion**](docs/Api/AddressApi.md#addressgetcountryregion) | **POST** /validate/address/country/get-region | Get the region, subregion and continent of the country *AddressApi* | [**addressGetTimezone**](docs/Api/AddressApi.md#addressgettimezone) | **POST** /validate/address/country/get-timezones | Gets IANA/Olsen time zones for a country +*AddressApi* | [**addressNormalizeAddress**](docs/Api/AddressApi.md#addressnormalizeaddress) | **POST** /validate/address/street-address/normalize | Normalize a street address *AddressApi* | [**addressParseString**](docs/Api/AddressApi.md#addressparsestring) | **POST** /validate/address/parse | Parse an unstructured input text string into an international, formatted address *AddressApi* | [**addressReverseGeocodeAddress**](docs/Api/AddressApi.md#addressreversegeocodeaddress) | **POST** /validate/address/geocode/reverse | Reverse geocode a lattitude and longitude into an address *AddressApi* | [**addressValidateAddress**](docs/Api/AddressApi.md#addressvalidateaddress) | **POST** /validate/address/street-address | Validate a street address *AddressApi* | [**addressValidateCity**](docs/Api/AddressApi.md#addressvalidatecity) | **POST** /validate/address/city | Validate a City and State/Province combination, get location information about it *AddressApi* | [**addressValidatePostalCode**](docs/Api/AddressApi.md#addressvalidatepostalcode) | **POST** /validate/address/postal-code | Validate a postal code, get location information about it *AddressApi* | [**addressValidateState**](docs/Api/AddressApi.md#addressvalidatestate) | **POST** /validate/address/state | Validate a state or province, name or abbreviation, get location information about it +*DateTimeApi* | [**dateTimeGetNowSimple**](docs/Api/DateTimeApi.md#datetimegetnowsimple) | **GET** /validate/date-time/get/now | Get current date and time as of now +*DateTimeApi* | [**dateTimeGetPublicHolidays**](docs/Api/DateTimeApi.md#datetimegetpublicholidays) | **POST** /validate/date-time/get/holidays | Get public holidays in the specified country and year +*DateTimeApi* | [**dateTimeParseNaturalLanguageDateTime**](docs/Api/DateTimeApi.md#datetimeparsenaturallanguagedatetime) | **POST** /validate/date-time/parse/date-time/natural-language | Parses a free-form natural language date and time string into a date and time +*DateTimeApi* | [**dateTimeParseStandardDateTime**](docs/Api/DateTimeApi.md#datetimeparsestandarddatetime) | **POST** /validate/date-time/parse/date-time/structured | Parses a standardized date and time string into a date and time *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 *DomainApi* | [**domainQualityScore**](docs/Api/DomainApi.md#domainqualityscore) | **POST** /validate/domain/quality-score | Validate a domain name's quality score @@ -131,6 +136,10 @@ Class | Method | HTTP request | Description - [CheckResponse](docs/Model/CheckResponse.md) - [CountryDetails](docs/Model/CountryDetails.md) - [CountryListResult](docs/Model/CountryListResult.md) + - [DateTimeNaturalLanguageParseRequest](docs/Model/DateTimeNaturalLanguageParseRequest.md) + - [DateTimeNowResult](docs/Model/DateTimeNowResult.md) + - [DateTimeStandardizedParseRequest](docs/Model/DateTimeStandardizedParseRequest.md) + - [DateTimeStandardizedParseResponse](docs/Model/DateTimeStandardizedParseResponse.md) - [DomainQualityResponse](docs/Model/DomainQualityResponse.md) - [FirstNameValidationRequest](docs/Model/FirstNameValidationRequest.md) - [FirstNameValidationResponse](docs/Model/FirstNameValidationResponse.md) @@ -141,6 +150,7 @@ Class | Method | HTTP request | Description - [GeolocateStreetAddressResponse](docs/Model/GeolocateStreetAddressResponse.md) - [GetGenderRequest](docs/Model/GetGenderRequest.md) - [GetGenderResponse](docs/Model/GetGenderResponse.md) + - [GetPublicHolidaysRequest](docs/Model/GetPublicHolidaysRequest.md) - [GetTimezonesRequest](docs/Model/GetTimezonesRequest.md) - [GetTimezonesResponse](docs/Model/GetTimezonesResponse.md) - [IPThreatResponse](docs/Model/IPThreatResponse.md) @@ -148,10 +158,13 @@ Class | Method | HTTP request | Description - [LastNameValidationResponse](docs/Model/LastNameValidationResponse.md) - [LeadEnrichmentRequest](docs/Model/LeadEnrichmentRequest.md) - [LeadEnrichmentResponse](docs/Model/LeadEnrichmentResponse.md) + - [NormalizeAddressResponse](docs/Model/NormalizeAddressResponse.md) - [ParseAddressRequest](docs/Model/ParseAddressRequest.md) - [ParseAddressResponse](docs/Model/ParseAddressResponse.md) - [PhoneNumberValidateRequest](docs/Model/PhoneNumberValidateRequest.md) - [PhoneNumberValidationResponse](docs/Model/PhoneNumberValidationResponse.md) + - [PublicHolidayOccurrence](docs/Model/PublicHolidayOccurrence.md) + - [PublicHolidaysResponse](docs/Model/PublicHolidaysResponse.md) - [ReverseGeocodeAddressRequest](docs/Model/ReverseGeocodeAddressRequest.md) - [ReverseGeocodeAddressResponse](docs/Model/ReverseGeocodeAddressResponse.md) - [Timezone](docs/Model/Timezone.md) diff --git a/composer.json b/composer.json index a38b621..e50e96f 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "cloudmersive/cloudmersive_validate_api_client", - "version": "1.6.6", + "version": "1.6.7", "description": "", "keywords": [ "swagger", diff --git a/docs/Api/AddressApi.md b/docs/Api/AddressApi.md index a26c51f..f5463a1 100644 --- a/docs/Api/AddressApi.md +++ b/docs/Api/AddressApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description [**addressGetCountryCurrency**](AddressApi.md#addressGetCountryCurrency) | **POST** /validate/address/country/get-currency | Get the currency of the input country [**addressGetCountryRegion**](AddressApi.md#addressGetCountryRegion) | **POST** /validate/address/country/get-region | Get the region, subregion and continent of the country [**addressGetTimezone**](AddressApi.md#addressGetTimezone) | **POST** /validate/address/country/get-timezones | Gets IANA/Olsen time zones for a country +[**addressNormalizeAddress**](AddressApi.md#addressNormalizeAddress) | **POST** /validate/address/street-address/normalize | Normalize a street address [**addressParseString**](AddressApi.md#addressParseString) | **POST** /validate/address/parse | Parse an unstructured input text string into an international, formatted address [**addressReverseGeocodeAddress**](AddressApi.md#addressReverseGeocodeAddress) | **POST** /validate/address/geocode/reverse | Reverse geocode a lattitude and longitude into an address [**addressValidateAddress**](AddressApi.md#addressValidateAddress) | **POST** /validate/address/street-address | Validate a street address @@ -400,6 +401,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) +# **addressNormalizeAddress** +> \Swagger\Client\Model\NormalizeAddressResponse addressNormalizeAddress($input) + +Normalize a street address + +Normalizes an input structured street address is valid or invalid. If the address is valid, also returns the latitude and longitude of the address. Supports all major international addresses. + +### 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\ValidateAddressRequest(); // \Swagger\Client\Model\ValidateAddressRequest | Input parse request + +try { + $result = $apiInstance->addressNormalizeAddress($input); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AddressApi->addressNormalizeAddress: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **input** | [**\Swagger\Client\Model\ValidateAddressRequest**](../Model/ValidateAddressRequest.md)| Input parse request | + +### Return type + +[**\Swagger\Client\Model\NormalizeAddressResponse**](../Model/NormalizeAddressResponse.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/Api/DateTimeApi.md b/docs/Api/DateTimeApi.md new file mode 100644 index 0000000..a299c58 --- /dev/null +++ b/docs/Api/DateTimeApi.md @@ -0,0 +1,228 @@ +# Swagger\Client\DateTimeApi + +All URIs are relative to *https://api.cloudmersive.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**dateTimeGetNowSimple**](DateTimeApi.md#dateTimeGetNowSimple) | **GET** /validate/date-time/get/now | Get current date and time as of now +[**dateTimeGetPublicHolidays**](DateTimeApi.md#dateTimeGetPublicHolidays) | **POST** /validate/date-time/get/holidays | Get public holidays in the specified country and year +[**dateTimeParseNaturalLanguageDateTime**](DateTimeApi.md#dateTimeParseNaturalLanguageDateTime) | **POST** /validate/date-time/parse/date-time/natural-language | Parses a free-form natural language date and time string into a date and time +[**dateTimeParseStandardDateTime**](DateTimeApi.md#dateTimeParseStandardDateTime) | **POST** /validate/date-time/parse/date-time/structured | Parses a standardized date and time string into a date and time + + +# **dateTimeGetNowSimple** +> \Swagger\Client\Model\DateTimeNowResult dateTimeGetNowSimple() + +Get current date and time as of now + +Gets the current date and time. Response time is syncronized with atomic clocks, and represents a monotonic, centrally available, consistent clock. + +### 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\DateTimeApi( + // 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 +); + +try { + $result = $apiInstance->dateTimeGetNowSimple(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DateTimeApi->dateTimeGetNowSimple: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**\Swagger\Client\Model\DateTimeNowResult**](../Model/DateTimeNowResult.md) + +### Authorization + +[Apikey](../../README.md#Apikey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **dateTimeGetPublicHolidays** +> \Swagger\Client\Model\PublicHolidaysResponse dateTimeGetPublicHolidays($input) + +Get public holidays in the specified country and year + +Enumerates all public holidays in a given country for a given year. Supports over 100 countries. + +### 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\DateTimeApi( + // 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\GetPublicHolidaysRequest(); // \Swagger\Client\Model\GetPublicHolidaysRequest | Input request + +try { + $result = $apiInstance->dateTimeGetPublicHolidays($input); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DateTimeApi->dateTimeGetPublicHolidays: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **input** | [**\Swagger\Client\Model\GetPublicHolidaysRequest**](../Model/GetPublicHolidaysRequest.md)| Input request | + +### Return type + +[**\Swagger\Client\Model\PublicHolidaysResponse**](../Model/PublicHolidaysResponse.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) + +# **dateTimeParseNaturalLanguageDateTime** +> \Swagger\Client\Model\DateTimeStandardizedParseResponse dateTimeParseNaturalLanguageDateTime($input) + +Parses a free-form natural language date and time string into a date and time + +Parses an unstructured, free-form, natural language date and time string into a date time object. This is intended for lightweight human-entered input, such as \"tomorrow at 3pm\" or \"tuesday\". + +### 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\DateTimeApi( + // 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\DateTimeNaturalLanguageParseRequest(); // \Swagger\Client\Model\DateTimeNaturalLanguageParseRequest | Input request + +try { + $result = $apiInstance->dateTimeParseNaturalLanguageDateTime($input); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DateTimeApi->dateTimeParseNaturalLanguageDateTime: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **input** | [**\Swagger\Client\Model\DateTimeNaturalLanguageParseRequest**](../Model/DateTimeNaturalLanguageParseRequest.md)| Input request | + +### Return type + +[**\Swagger\Client\Model\DateTimeStandardizedParseResponse**](../Model/DateTimeStandardizedParseResponse.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) + +# **dateTimeParseStandardDateTime** +> \Swagger\Client\Model\DateTimeStandardizedParseResponse dateTimeParseStandardDateTime($input) + +Parses a standardized date and time string into a date and time + +Parses a structured date and time string into a date time object. This is intended for standardized date strings that adhere to formatting conventions, rather than natural language input. + +### 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\DateTimeApi( + // 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\DateTimeStandardizedParseRequest(); // \Swagger\Client\Model\DateTimeStandardizedParseRequest | Input request + +try { + $result = $apiInstance->dateTimeParseStandardDateTime($input); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DateTimeApi->dateTimeParseStandardDateTime: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **input** | [**\Swagger\Client\Model\DateTimeStandardizedParseRequest**](../Model/DateTimeStandardizedParseRequest.md)| Input request | + +### Return type + +[**\Swagger\Client\Model\DateTimeStandardizedParseResponse**](../Model/DateTimeStandardizedParseResponse.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) + diff --git a/docs/Api/DomainApi.md b/docs/Api/DomainApi.md index d2a2994..1afb07a 100644 --- a/docs/Api/DomainApi.md +++ b/docs/Api/DomainApi.md @@ -61,7 +61,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: text/javascript, application/json, text/json + - **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) @@ -116,7 +116,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: text/javascript, application/json, text/json + - **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) @@ -171,7 +171,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: text/javascript, application/json, text/json + - **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) diff --git a/docs/Api/EmailApi.md b/docs/Api/EmailApi.md index 2835ed1..641bd2b 100644 --- a/docs/Api/EmailApi.md +++ b/docs/Api/EmailApi.md @@ -59,7 +59,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: text/javascript, application/json, text/json + - **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) @@ -114,7 +114,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: text/javascript, application/json, text/json + - **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) @@ -169,7 +169,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: text/javascript, application/json, text/json + - **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) diff --git a/docs/Api/IPAddressApi.md b/docs/Api/IPAddressApi.md index 498c325..1b72956 100644 --- a/docs/Api/IPAddressApi.md +++ b/docs/Api/IPAddressApi.md @@ -60,7 +60,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: text/javascript, application/json, text/json + - **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) @@ -115,7 +115,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: text/javascript, application/json, text/json + - **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) @@ -170,7 +170,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: text/javascript, application/json, text/json + - **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) @@ -225,7 +225,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: text/javascript, application/json, text/json + - **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) diff --git a/docs/Api/TextInputApi.md b/docs/Api/TextInputApi.md index 2192f87..120ab3c 100644 --- a/docs/Api/TextInputApi.md +++ b/docs/Api/TextInputApi.md @@ -58,7 +58,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: text/javascript, application/json, text/json + - **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) @@ -113,7 +113,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: text/javascript, application/json, text/json + - **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) diff --git a/docs/Model/DateTimeNaturalLanguageParseRequest.md b/docs/Model/DateTimeNaturalLanguageParseRequest.md new file mode 100644 index 0000000..274501d --- /dev/null +++ b/docs/Model/DateTimeNaturalLanguageParseRequest.md @@ -0,0 +1,10 @@ +# DateTimeNaturalLanguageParseRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**raw_date_time_input** | **string** | Raw string input of a natural language-formatted date and time for parsing | [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/DateTimeNowResult.md b/docs/Model/DateTimeNowResult.md new file mode 100644 index 0000000..dcd8325 --- /dev/null +++ b/docs/Model/DateTimeNowResult.md @@ -0,0 +1,12 @@ +# DateTimeNowResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**successful** | **bool** | True if successful, false otherwise | [optional] +**now** | [**\DateTime**](\DateTime.md) | Current date, time, and time zone in standard JSON date format | [optional] +**now_gmt** | [**\DateTime**](\DateTime.md) | Current GMT-time-zone date, time, and time zone in standard JSON date format | [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/DateTimeStandardizedParseRequest.md b/docs/Model/DateTimeStandardizedParseRequest.md new file mode 100644 index 0000000..0964f44 --- /dev/null +++ b/docs/Model/DateTimeStandardizedParseRequest.md @@ -0,0 +1,11 @@ +# DateTimeStandardizedParseRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**raw_date_time_input** | **string** | Raw string input of a standard-formatted date and time for parsing | [optional] +**country_code** | **string** | Optional: specify the two-letter country code to optimzie date formatting; default is US | [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/DateTimeStandardizedParseResponse.md b/docs/Model/DateTimeStandardizedParseResponse.md new file mode 100644 index 0000000..036ab91 --- /dev/null +++ b/docs/Model/DateTimeStandardizedParseResponse.md @@ -0,0 +1,18 @@ +# DateTimeStandardizedParseResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**successful** | **bool** | True if successful, false otherwise | [optional] +**parsed_date_result** | [**\DateTime**](\DateTime.md) | Result of performing a date time parsing | [optional] +**year** | **int** | Year of the parsed date time result | [optional] +**month** | **int** | Month of the parsed date time result | [optional] +**day** | **int** | Day of the parsed date time result | [optional] +**hour** | **int** | Hour of the parsed date time result (24-hour) | [optional] +**minute** | **int** | Minute of the parsed date time result | [optional] +**second** | **int** | Second of the parsed date time result | [optional] +**day_of_week** | **string** | Day of week | [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/GetPublicHolidaysRequest.md b/docs/Model/GetPublicHolidaysRequest.md new file mode 100644 index 0000000..3f3ec48 --- /dev/null +++ b/docs/Model/GetPublicHolidaysRequest.md @@ -0,0 +1,11 @@ +# GetPublicHolidaysRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**raw_country_input** | **string** | Two-letter code (FIPS 10-4 or ISO 3166-1) of the country; if not specified, defaults to United States | [optional] +**year** | **int** | Optional - the year in which to retrieve the holidays; if left blank (0) it will default to the current year | [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/NormalizeAddressResponse.md b/docs/Model/NormalizeAddressResponse.md new file mode 100644 index 0000000..7c17891 --- /dev/null +++ b/docs/Model/NormalizeAddressResponse.md @@ -0,0 +1,20 @@ +# NormalizeAddressResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**valid_address** | **bool** | True if the address is valid, false otherwise | [optional] +**building** | **string** | The name of the building, house or structure if applicable, such as \"Cloudmersive Building 2\". This will often by null. | [optional] +**street_number** | **string** | The street number or house number of the address. For example, in the address \"1600 Pennsylvania Avenue NW\" the street number would be \"1600\". This value will typically be populated for most addresses. | [optional] +**street** | **string** | The name of the street or road of the address. For example, in the address \"1600 Pennsylvania Avenue NW\" the street number would be \"Pennsylvania Avenue NW\". | [optional] +**city** | **string** | The city of the address. | [optional] +**state_or_province** | **string** | The state or province of the address. | [optional] +**postal_code** | **string** | The postal code or zip code of the address. | [optional] +**country_full_name** | **string** | Country of the address, if present in the address. If not included in the address it will be null. | [optional] +**iso_two_letter_code** | **string** | Two-letter ISO 3166-1 country code | [optional] +**latitude** | **double** | If the address is valid, the degrees latitude of the validated address, null otherwise | [optional] +**longitude** | **double** | If the address is valid, the degrees longitude of the validated address, null otherwise | [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/PublicHolidayOccurrence.md b/docs/Model/PublicHolidayOccurrence.md new file mode 100644 index 0000000..5474ee9 --- /dev/null +++ b/docs/Model/PublicHolidayOccurrence.md @@ -0,0 +1,14 @@ +# PublicHolidayOccurrence + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**english_name** | **string** | Name of the holiday in English | [optional] +**local_name** | **string** | Local name of the holiday | [optional] +**occurrence_date** | [**\DateTime**](\DateTime.md) | Date of the holiday (start time) | [optional] +**holiday_type** | **string** | Type of the holiday; possible values are: Public, Bank, School, Authorities, Optional, Observance | [optional] +**nationwaide** | **bool** | True if the holiday is celebrated in all locales in the country, false otherwise | [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/PublicHolidaysResponse.md b/docs/Model/PublicHolidaysResponse.md new file mode 100644 index 0000000..9baed07 --- /dev/null +++ b/docs/Model/PublicHolidaysResponse.md @@ -0,0 +1,11 @@ +# PublicHolidaysResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**successful** | **bool** | True if successful, false otherwise | [optional] +**public_holidays** | [**\Swagger\Client\Model\PublicHolidayOccurrence[]**](PublicHolidayOccurrence.md) | Public holidays in the requested country and year | [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 a7614b4..7aad17e 100644 --- a/lib/Api/AddressApi.php +++ b/lib/Api/AddressApi.php @@ -1830,6 +1830,268 @@ protected function addressGetTimezoneRequest($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 addressNormalizeAddress + * + * Normalize a street address + * + * @param \Swagger\Client\Model\ValidateAddressRequest $input Input parse request (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\NormalizeAddressResponse + */ + public function addressNormalizeAddress($input) + { + list($response) = $this->addressNormalizeAddressWithHttpInfo($input); + return $response; + } + + /** + * Operation addressNormalizeAddressWithHttpInfo + * + * Normalize a street address + * + * @param \Swagger\Client\Model\ValidateAddressRequest $input Input parse request (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\NormalizeAddressResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function addressNormalizeAddressWithHttpInfo($input) + { + $returnType = '\Swagger\Client\Model\NormalizeAddressResponse'; + $request = $this->addressNormalizeAddressRequest($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\NormalizeAddressResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addressNormalizeAddressAsync + * + * Normalize a street address + * + * @param \Swagger\Client\Model\ValidateAddressRequest $input Input parse request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function addressNormalizeAddressAsync($input) + { + return $this->addressNormalizeAddressAsyncWithHttpInfo($input) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addressNormalizeAddressAsyncWithHttpInfo + * + * Normalize a street address + * + * @param \Swagger\Client\Model\ValidateAddressRequest $input Input parse request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function addressNormalizeAddressAsyncWithHttpInfo($input) + { + $returnType = '\Swagger\Client\Model\NormalizeAddressResponse'; + $request = $this->addressNormalizeAddressRequest($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 'addressNormalizeAddress' + * + * @param \Swagger\Client\Model\ValidateAddressRequest $input Input parse request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function addressNormalizeAddressRequest($input) + { + // verify the required parameter 'input' is set + if ($input === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $input when calling addressNormalizeAddress' + ); + } + + $resourcePath = '/validate/address/street-address/normalize'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // body params $_tempBody = null; if (isset($input)) { diff --git a/lib/Api/DateTimeApi.php b/lib/Api/DateTimeApi.php new file mode 100644 index 0000000..252ecdc --- /dev/null +++ b/lib/Api/DateTimeApi.php @@ -0,0 +1,1137 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation dateTimeGetNowSimple + * + * Get current date and time as of now + * + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\DateTimeNowResult + */ + public function dateTimeGetNowSimple() + { + list($response) = $this->dateTimeGetNowSimpleWithHttpInfo(); + return $response; + } + + /** + * Operation dateTimeGetNowSimpleWithHttpInfo + * + * Get current date and time as of now + * + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\DateTimeNowResult, HTTP status code, HTTP response headers (array of strings) + */ + public function dateTimeGetNowSimpleWithHttpInfo() + { + $returnType = '\Swagger\Client\Model\DateTimeNowResult'; + $request = $this->dateTimeGetNowSimpleRequest(); + + 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\DateTimeNowResult', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation dateTimeGetNowSimpleAsync + * + * Get current date and time as of now + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function dateTimeGetNowSimpleAsync() + { + return $this->dateTimeGetNowSimpleAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation dateTimeGetNowSimpleAsyncWithHttpInfo + * + * Get current date and time as of now + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function dateTimeGetNowSimpleAsyncWithHttpInfo() + { + $returnType = '\Swagger\Client\Model\DateTimeNowResult'; + $request = $this->dateTimeGetNowSimpleRequest(); + + 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 'dateTimeGetNowSimple' + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function dateTimeGetNowSimpleRequest() + { + + $resourcePath = '/validate/date-time/get/now'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + + 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'], + [] + ); + } + + // 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( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation dateTimeGetPublicHolidays + * + * Get public holidays in the specified country and year + * + * @param \Swagger\Client\Model\GetPublicHolidaysRequest $input Input request (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\PublicHolidaysResponse + */ + public function dateTimeGetPublicHolidays($input) + { + list($response) = $this->dateTimeGetPublicHolidaysWithHttpInfo($input); + return $response; + } + + /** + * Operation dateTimeGetPublicHolidaysWithHttpInfo + * + * Get public holidays in the specified country and year + * + * @param \Swagger\Client\Model\GetPublicHolidaysRequest $input Input request (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\PublicHolidaysResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function dateTimeGetPublicHolidaysWithHttpInfo($input) + { + $returnType = '\Swagger\Client\Model\PublicHolidaysResponse'; + $request = $this->dateTimeGetPublicHolidaysRequest($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\PublicHolidaysResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation dateTimeGetPublicHolidaysAsync + * + * Get public holidays in the specified country and year + * + * @param \Swagger\Client\Model\GetPublicHolidaysRequest $input Input request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function dateTimeGetPublicHolidaysAsync($input) + { + return $this->dateTimeGetPublicHolidaysAsyncWithHttpInfo($input) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation dateTimeGetPublicHolidaysAsyncWithHttpInfo + * + * Get public holidays in the specified country and year + * + * @param \Swagger\Client\Model\GetPublicHolidaysRequest $input Input request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function dateTimeGetPublicHolidaysAsyncWithHttpInfo($input) + { + $returnType = '\Swagger\Client\Model\PublicHolidaysResponse'; + $request = $this->dateTimeGetPublicHolidaysRequest($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 'dateTimeGetPublicHolidays' + * + * @param \Swagger\Client\Model\GetPublicHolidaysRequest $input Input request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function dateTimeGetPublicHolidaysRequest($input) + { + // verify the required parameter 'input' is set + if ($input === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $input when calling dateTimeGetPublicHolidays' + ); + } + + $resourcePath = '/validate/date-time/get/holidays'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // 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 dateTimeParseNaturalLanguageDateTime + * + * Parses a free-form natural language date and time string into a date and time + * + * @param \Swagger\Client\Model\DateTimeNaturalLanguageParseRequest $input Input request (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\DateTimeStandardizedParseResponse + */ + public function dateTimeParseNaturalLanguageDateTime($input) + { + list($response) = $this->dateTimeParseNaturalLanguageDateTimeWithHttpInfo($input); + return $response; + } + + /** + * Operation dateTimeParseNaturalLanguageDateTimeWithHttpInfo + * + * Parses a free-form natural language date and time string into a date and time + * + * @param \Swagger\Client\Model\DateTimeNaturalLanguageParseRequest $input Input request (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\DateTimeStandardizedParseResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function dateTimeParseNaturalLanguageDateTimeWithHttpInfo($input) + { + $returnType = '\Swagger\Client\Model\DateTimeStandardizedParseResponse'; + $request = $this->dateTimeParseNaturalLanguageDateTimeRequest($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\DateTimeStandardizedParseResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation dateTimeParseNaturalLanguageDateTimeAsync + * + * Parses a free-form natural language date and time string into a date and time + * + * @param \Swagger\Client\Model\DateTimeNaturalLanguageParseRequest $input Input request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function dateTimeParseNaturalLanguageDateTimeAsync($input) + { + return $this->dateTimeParseNaturalLanguageDateTimeAsyncWithHttpInfo($input) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation dateTimeParseNaturalLanguageDateTimeAsyncWithHttpInfo + * + * Parses a free-form natural language date and time string into a date and time + * + * @param \Swagger\Client\Model\DateTimeNaturalLanguageParseRequest $input Input request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function dateTimeParseNaturalLanguageDateTimeAsyncWithHttpInfo($input) + { + $returnType = '\Swagger\Client\Model\DateTimeStandardizedParseResponse'; + $request = $this->dateTimeParseNaturalLanguageDateTimeRequest($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 'dateTimeParseNaturalLanguageDateTime' + * + * @param \Swagger\Client\Model\DateTimeNaturalLanguageParseRequest $input Input request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function dateTimeParseNaturalLanguageDateTimeRequest($input) + { + // verify the required parameter 'input' is set + if ($input === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $input when calling dateTimeParseNaturalLanguageDateTime' + ); + } + + $resourcePath = '/validate/date-time/parse/date-time/natural-language'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // 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 dateTimeParseStandardDateTime + * + * Parses a standardized date and time string into a date and time + * + * @param \Swagger\Client\Model\DateTimeStandardizedParseRequest $input Input request (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\DateTimeStandardizedParseResponse + */ + public function dateTimeParseStandardDateTime($input) + { + list($response) = $this->dateTimeParseStandardDateTimeWithHttpInfo($input); + return $response; + } + + /** + * Operation dateTimeParseStandardDateTimeWithHttpInfo + * + * Parses a standardized date and time string into a date and time + * + * @param \Swagger\Client\Model\DateTimeStandardizedParseRequest $input Input request (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\DateTimeStandardizedParseResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function dateTimeParseStandardDateTimeWithHttpInfo($input) + { + $returnType = '\Swagger\Client\Model\DateTimeStandardizedParseResponse'; + $request = $this->dateTimeParseStandardDateTimeRequest($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\DateTimeStandardizedParseResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation dateTimeParseStandardDateTimeAsync + * + * Parses a standardized date and time string into a date and time + * + * @param \Swagger\Client\Model\DateTimeStandardizedParseRequest $input Input request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function dateTimeParseStandardDateTimeAsync($input) + { + return $this->dateTimeParseStandardDateTimeAsyncWithHttpInfo($input) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation dateTimeParseStandardDateTimeAsyncWithHttpInfo + * + * Parses a standardized date and time string into a date and time + * + * @param \Swagger\Client\Model\DateTimeStandardizedParseRequest $input Input request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function dateTimeParseStandardDateTimeAsyncWithHttpInfo($input) + { + $returnType = '\Swagger\Client\Model\DateTimeStandardizedParseResponse'; + $request = $this->dateTimeParseStandardDateTimeRequest($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 'dateTimeParseStandardDateTime' + * + * @param \Swagger\Client\Model\DateTimeStandardizedParseRequest $input Input request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function dateTimeParseStandardDateTimeRequest($input) + { + // verify the required parameter 'input' is set + if ($input === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $input when calling dateTimeParseStandardDateTime' + ); + } + + $resourcePath = '/validate/date-time/parse/date-time/structured'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // 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 + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/DomainApi.php b/lib/Api/DomainApi.php index f44512f..6004c38 100644 --- a/lib/Api/DomainApi.php +++ b/lib/Api/DomainApi.php @@ -285,7 +285,7 @@ protected function domainCheckRequest($domain) } else { $headers = $this->headerSelector->selectHeaders( ['application/json', 'text/json', 'application/xml', 'text/xml'], - ['text/javascript', 'application/json', 'text/json'] + ['application/json', 'text/json'] ); } @@ -547,7 +547,7 @@ protected function domainPostRequest($domain) } else { $headers = $this->headerSelector->selectHeaders( ['application/json', 'text/json', 'application/xml', 'text/xml'], - ['text/javascript', 'application/json', 'text/json'] + ['application/json', 'text/json'] ); } @@ -809,7 +809,7 @@ protected function domainQualityScoreRequest($domain) } else { $headers = $this->headerSelector->selectHeaders( ['application/json', 'text/json', 'application/xml', 'text/xml'], - ['text/javascript', 'application/json', 'text/json'] + ['application/json', 'text/json'] ); } diff --git a/lib/Api/EmailApi.php b/lib/Api/EmailApi.php index 50ccac5..0a67b1c 100644 --- a/lib/Api/EmailApi.php +++ b/lib/Api/EmailApi.php @@ -285,7 +285,7 @@ protected function emailAddressGetServersRequest($email) } else { $headers = $this->headerSelector->selectHeaders( ['application/json', 'text/json', 'application/xml', 'text/xml'], - ['text/javascript', 'application/json', 'text/json'] + ['application/json', 'text/json'] ); } @@ -547,7 +547,7 @@ protected function emailFullValidationRequest($email) } else { $headers = $this->headerSelector->selectHeaders( ['application/json', 'text/json', 'application/xml', 'text/xml'], - ['text/javascript', 'application/json', 'text/json'] + ['application/json', 'text/json'] ); } @@ -809,7 +809,7 @@ protected function emailPostRequest($value) } else { $headers = $this->headerSelector->selectHeaders( ['application/json', 'text/json', 'application/xml', 'text/xml'], - ['text/javascript', 'application/json', 'text/json'] + ['application/json', 'text/json'] ); } diff --git a/lib/Api/IPAddressApi.php b/lib/Api/IPAddressApi.php index 16acb69..e2741d4 100644 --- a/lib/Api/IPAddressApi.php +++ b/lib/Api/IPAddressApi.php @@ -285,7 +285,7 @@ protected function iPAddressGeolocateStreetAddressRequest($value) } else { $headers = $this->headerSelector->selectHeaders( ['application/json', 'text/json', 'application/xml', 'text/xml'], - ['text/javascript', 'application/json', 'text/json'] + ['application/json', 'text/json'] ); } @@ -547,7 +547,7 @@ protected function iPAddressIsThreatRequest($value) } else { $headers = $this->headerSelector->selectHeaders( ['application/json', 'text/json', 'application/xml', 'text/xml'], - ['text/javascript', 'application/json', 'text/json'] + ['application/json', 'text/json'] ); } @@ -809,7 +809,7 @@ protected function iPAddressIsTorNodeRequest($value) } else { $headers = $this->headerSelector->selectHeaders( ['application/json', 'text/json', 'application/xml', 'text/xml'], - ['text/javascript', 'application/json', 'text/json'] + ['application/json', 'text/json'] ); } @@ -1071,7 +1071,7 @@ protected function iPAddressPostRequest($value) } else { $headers = $this->headerSelector->selectHeaders( ['application/json', 'text/json', 'application/xml', 'text/xml'], - ['text/javascript', 'application/json', 'text/json'] + ['application/json', 'text/json'] ); } diff --git a/lib/Api/TextInputApi.php b/lib/Api/TextInputApi.php index 8721d0e..e28fc9d 100644 --- a/lib/Api/TextInputApi.php +++ b/lib/Api/TextInputApi.php @@ -285,7 +285,7 @@ protected function textInputCheckXssRequest($value) } else { $headers = $this->headerSelector->selectHeaders( ['application/json', 'text/json', 'application/xml', 'text/xml'], - ['text/javascript', 'application/json', 'text/json'] + ['application/json', 'text/json'] ); } @@ -547,7 +547,7 @@ protected function textInputProtectXssRequest($value) } else { $headers = $this->headerSelector->selectHeaders( ['application/json', 'text/json', 'application/xml', 'text/xml'], - ['text/javascript', 'application/json', 'text/json'] + ['application/json', 'text/json'] ); } diff --git a/lib/Configuration.php b/lib/Configuration.php index 514f61c..1e9dd83 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -88,7 +88,7 @@ class Configuration * * @var string */ - protected $userAgent = 'Swagger-Codegen/1.6.6/php'; + protected $userAgent = 'Swagger-Codegen/1.6.7/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.6.6' . PHP_EOL; + $report .= ' SDK Package Version: 1.6.7' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/Model/DateTimeNaturalLanguageParseRequest.php b/lib/Model/DateTimeNaturalLanguageParseRequest.php new file mode 100644 index 0000000..73ab209 --- /dev/null +++ b/lib/Model/DateTimeNaturalLanguageParseRequest.php @@ -0,0 +1,303 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'raw_date_time_input' => 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 = [ + 'raw_date_time_input' => 'RawDateTimeInput' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'raw_date_time_input' => 'setRawDateTimeInput' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'raw_date_time_input' => 'getRawDateTimeInput' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization 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['raw_date_time_input'] = isset($data['raw_date_time_input']) ? $data['raw_date_time_input'] : 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 raw_date_time_input + * + * @return string + */ + public function getRawDateTimeInput() + { + return $this->container['raw_date_time_input']; + } + + /** + * Sets raw_date_time_input + * + * @param string $raw_date_time_input Raw string input of a natural language-formatted date and time for parsing + * + * @return $this + */ + public function setRawDateTimeInput($raw_date_time_input) + { + $this->container['raw_date_time_input'] = $raw_date_time_input; + + 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/DateTimeNowResult.php b/lib/Model/DateTimeNowResult.php new file mode 100644 index 0000000..eb9eae3 --- /dev/null +++ b/lib/Model/DateTimeNowResult.php @@ -0,0 +1,363 @@ + 'bool', + 'now' => '\DateTime', + 'now_gmt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'successful' => null, + 'now' => 'date-time', + 'now_gmt' => 'date-time' + ]; + + /** + * 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', + 'now' => 'Now', + 'now_gmt' => 'NowGmt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'successful' => 'setSuccessful', + 'now' => 'setNow', + 'now_gmt' => 'setNowGmt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'successful' => 'getSuccessful', + 'now' => 'getNow', + 'now_gmt' => 'getNowGmt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization 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['now'] = isset($data['now']) ? $data['now'] : null; + $this->container['now_gmt'] = isset($data['now_gmt']) ? $data['now_gmt'] : 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 now + * + * @return \DateTime + */ + public function getNow() + { + return $this->container['now']; + } + + /** + * Sets now + * + * @param \DateTime $now Current date, time, and time zone in standard JSON date format + * + * @return $this + */ + public function setNow($now) + { + $this->container['now'] = $now; + + return $this; + } + + /** + * Gets now_gmt + * + * @return \DateTime + */ + public function getNowGmt() + { + return $this->container['now_gmt']; + } + + /** + * Sets now_gmt + * + * @param \DateTime $now_gmt Current GMT-time-zone date, time, and time zone in standard JSON date format + * + * @return $this + */ + public function setNowGmt($now_gmt) + { + $this->container['now_gmt'] = $now_gmt; + + 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/DateTimeStandardizedParseRequest.php b/lib/Model/DateTimeStandardizedParseRequest.php new file mode 100644 index 0000000..584dc1e --- /dev/null +++ b/lib/Model/DateTimeStandardizedParseRequest.php @@ -0,0 +1,333 @@ + 'string', + 'country_code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'raw_date_time_input' => null, + 'country_code' => 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 = [ + 'raw_date_time_input' => 'RawDateTimeInput', + 'country_code' => 'CountryCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'raw_date_time_input' => 'setRawDateTimeInput', + 'country_code' => 'setCountryCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'raw_date_time_input' => 'getRawDateTimeInput', + 'country_code' => 'getCountryCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$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['raw_date_time_input'] = isset($data['raw_date_time_input']) ? $data['raw_date_time_input'] : null; + $this->container['country_code'] = isset($data['country_code']) ? $data['country_code'] : 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 raw_date_time_input + * + * @return string + */ + public function getRawDateTimeInput() + { + return $this->container['raw_date_time_input']; + } + + /** + * Sets raw_date_time_input + * + * @param string $raw_date_time_input Raw string input of a standard-formatted date and time for parsing + * + * @return $this + */ + public function setRawDateTimeInput($raw_date_time_input) + { + $this->container['raw_date_time_input'] = $raw_date_time_input; + + return $this; + } + + /** + * Gets country_code + * + * @return string + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string $country_code Optional: specify the two-letter country code to optimzie date formatting; default is US + * + * @return $this + */ + public function setCountryCode($country_code) + { + $this->container['country_code'] = $country_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/lib/Model/DateTimeStandardizedParseResponse.php b/lib/Model/DateTimeStandardizedParseResponse.php new file mode 100644 index 0000000..ea8ba31 --- /dev/null +++ b/lib/Model/DateTimeStandardizedParseResponse.php @@ -0,0 +1,543 @@ + 'bool', + 'parsed_date_result' => '\DateTime', + 'year' => 'int', + 'month' => 'int', + 'day' => 'int', + 'hour' => 'int', + 'minute' => 'int', + 'second' => 'int', + 'day_of_week' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'successful' => null, + 'parsed_date_result' => 'date-time', + 'year' => 'int32', + 'month' => 'int32', + 'day' => 'int32', + 'hour' => 'int32', + 'minute' => 'int32', + 'second' => 'int32', + 'day_of_week' => 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', + 'parsed_date_result' => 'ParsedDateResult', + 'year' => 'Year', + 'month' => 'Month', + 'day' => 'Day', + 'hour' => 'Hour', + 'minute' => 'Minute', + 'second' => 'Second', + 'day_of_week' => 'DayOfWeek' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'successful' => 'setSuccessful', + 'parsed_date_result' => 'setParsedDateResult', + 'year' => 'setYear', + 'month' => 'setMonth', + 'day' => 'setDay', + 'hour' => 'setHour', + 'minute' => 'setMinute', + 'second' => 'setSecond', + 'day_of_week' => 'setDayOfWeek' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'successful' => 'getSuccessful', + 'parsed_date_result' => 'getParsedDateResult', + 'year' => 'getYear', + 'month' => 'getMonth', + 'day' => 'getDay', + 'hour' => 'getHour', + 'minute' => 'getMinute', + 'second' => 'getSecond', + 'day_of_week' => 'getDayOfWeek' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization 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['parsed_date_result'] = isset($data['parsed_date_result']) ? $data['parsed_date_result'] : null; + $this->container['year'] = isset($data['year']) ? $data['year'] : null; + $this->container['month'] = isset($data['month']) ? $data['month'] : null; + $this->container['day'] = isset($data['day']) ? $data['day'] : null; + $this->container['hour'] = isset($data['hour']) ? $data['hour'] : null; + $this->container['minute'] = isset($data['minute']) ? $data['minute'] : null; + $this->container['second'] = isset($data['second']) ? $data['second'] : null; + $this->container['day_of_week'] = isset($data['day_of_week']) ? $data['day_of_week'] : 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 parsed_date_result + * + * @return \DateTime + */ + public function getParsedDateResult() + { + return $this->container['parsed_date_result']; + } + + /** + * Sets parsed_date_result + * + * @param \DateTime $parsed_date_result Result of performing a date time parsing + * + * @return $this + */ + public function setParsedDateResult($parsed_date_result) + { + $this->container['parsed_date_result'] = $parsed_date_result; + + return $this; + } + + /** + * Gets year + * + * @return int + */ + public function getYear() + { + return $this->container['year']; + } + + /** + * Sets year + * + * @param int $year Year of the parsed date time result + * + * @return $this + */ + public function setYear($year) + { + $this->container['year'] = $year; + + return $this; + } + + /** + * Gets month + * + * @return int + */ + public function getMonth() + { + return $this->container['month']; + } + + /** + * Sets month + * + * @param int $month Month of the parsed date time result + * + * @return $this + */ + public function setMonth($month) + { + $this->container['month'] = $month; + + return $this; + } + + /** + * Gets day + * + * @return int + */ + public function getDay() + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param int $day Day of the parsed date time result + * + * @return $this + */ + public function setDay($day) + { + $this->container['day'] = $day; + + return $this; + } + + /** + * Gets hour + * + * @return int + */ + public function getHour() + { + return $this->container['hour']; + } + + /** + * Sets hour + * + * @param int $hour Hour of the parsed date time result (24-hour) + * + * @return $this + */ + public function setHour($hour) + { + $this->container['hour'] = $hour; + + return $this; + } + + /** + * Gets minute + * + * @return int + */ + public function getMinute() + { + return $this->container['minute']; + } + + /** + * Sets minute + * + * @param int $minute Minute of the parsed date time result + * + * @return $this + */ + public function setMinute($minute) + { + $this->container['minute'] = $minute; + + return $this; + } + + /** + * Gets second + * + * @return int + */ + public function getSecond() + { + return $this->container['second']; + } + + /** + * Sets second + * + * @param int $second Second of the parsed date time result + * + * @return $this + */ + public function setSecond($second) + { + $this->container['second'] = $second; + + return $this; + } + + /** + * Gets day_of_week + * + * @return string + */ + public function getDayOfWeek() + { + return $this->container['day_of_week']; + } + + /** + * Sets day_of_week + * + * @param string $day_of_week Day of week + * + * @return $this + */ + public function setDayOfWeek($day_of_week) + { + $this->container['day_of_week'] = $day_of_week; + + 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/GetPublicHolidaysRequest.php b/lib/Model/GetPublicHolidaysRequest.php new file mode 100644 index 0000000..3201a7e --- /dev/null +++ b/lib/Model/GetPublicHolidaysRequest.php @@ -0,0 +1,333 @@ + 'string', + 'year' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'raw_country_input' => null, + 'year' => 'int32' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'raw_country_input' => 'RawCountryInput', + 'year' => 'Year' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'raw_country_input' => 'setRawCountryInput', + 'year' => 'setYear' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'raw_country_input' => 'getRawCountryInput', + 'year' => 'getYear' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization 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['raw_country_input'] = isset($data['raw_country_input']) ? $data['raw_country_input'] : null; + $this->container['year'] = isset($data['year']) ? $data['year'] : 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 raw_country_input + * + * @return string + */ + public function getRawCountryInput() + { + return $this->container['raw_country_input']; + } + + /** + * Sets raw_country_input + * + * @param string $raw_country_input Two-letter code (FIPS 10-4 or ISO 3166-1) of the country; if not specified, defaults to United States + * + * @return $this + */ + public function setRawCountryInput($raw_country_input) + { + $this->container['raw_country_input'] = $raw_country_input; + + return $this; + } + + /** + * Gets year + * + * @return int + */ + public function getYear() + { + return $this->container['year']; + } + + /** + * Sets year + * + * @param int $year Optional - the year in which to retrieve the holidays; if left blank (0) it will default to the current year + * + * @return $this + */ + public function setYear($year) + { + $this->container['year'] = $year; + + 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/NormalizeAddressResponse.php b/lib/Model/NormalizeAddressResponse.php new file mode 100644 index 0000000..2d5068f --- /dev/null +++ b/lib/Model/NormalizeAddressResponse.php @@ -0,0 +1,603 @@ + 'bool', + 'building' => 'string', + 'street_number' => 'string', + 'street' => 'string', + 'city' => 'string', + 'state_or_province' => 'string', + 'postal_code' => 'string', + 'country_full_name' => 'string', + 'iso_two_letter_code' => 'string', + 'latitude' => 'double', + 'longitude' => 'double' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'valid_address' => null, + 'building' => null, + 'street_number' => null, + 'street' => null, + 'city' => null, + 'state_or_province' => null, + 'postal_code' => null, + 'country_full_name' => null, + 'iso_two_letter_code' => null, + 'latitude' => 'double', + 'longitude' => 'double' + ]; + + /** + * 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 = [ + 'valid_address' => 'ValidAddress', + 'building' => 'Building', + 'street_number' => 'StreetNumber', + 'street' => 'Street', + 'city' => 'City', + 'state_or_province' => 'StateOrProvince', + 'postal_code' => 'PostalCode', + 'country_full_name' => 'CountryFullName', + 'iso_two_letter_code' => 'ISOTwoLetterCode', + 'latitude' => 'Latitude', + 'longitude' => 'Longitude' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'valid_address' => 'setValidAddress', + 'building' => 'setBuilding', + 'street_number' => 'setStreetNumber', + 'street' => 'setStreet', + 'city' => 'setCity', + 'state_or_province' => 'setStateOrProvince', + 'postal_code' => 'setPostalCode', + 'country_full_name' => 'setCountryFullName', + 'iso_two_letter_code' => 'setIsoTwoLetterCode', + 'latitude' => 'setLatitude', + 'longitude' => 'setLongitude' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'valid_address' => 'getValidAddress', + 'building' => 'getBuilding', + 'street_number' => 'getStreetNumber', + 'street' => 'getStreet', + 'city' => 'getCity', + 'state_or_province' => 'getStateOrProvince', + 'postal_code' => 'getPostalCode', + 'country_full_name' => 'getCountryFullName', + 'iso_two_letter_code' => 'getIsoTwoLetterCode', + 'latitude' => 'getLatitude', + 'longitude' => 'getLongitude' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization 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['valid_address'] = isset($data['valid_address']) ? $data['valid_address'] : null; + $this->container['building'] = isset($data['building']) ? $data['building'] : null; + $this->container['street_number'] = isset($data['street_number']) ? $data['street_number'] : null; + $this->container['street'] = isset($data['street']) ? $data['street'] : null; + $this->container['city'] = isset($data['city']) ? $data['city'] : null; + $this->container['state_or_province'] = isset($data['state_or_province']) ? $data['state_or_province'] : null; + $this->container['postal_code'] = isset($data['postal_code']) ? $data['postal_code'] : 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['latitude'] = isset($data['latitude']) ? $data['latitude'] : null; + $this->container['longitude'] = isset($data['longitude']) ? $data['longitude'] : 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 valid_address + * + * @return bool + */ + public function getValidAddress() + { + return $this->container['valid_address']; + } + + /** + * Sets valid_address + * + * @param bool $valid_address True if the address is valid, false otherwise + * + * @return $this + */ + public function setValidAddress($valid_address) + { + $this->container['valid_address'] = $valid_address; + + return $this; + } + + /** + * Gets building + * + * @return string + */ + public function getBuilding() + { + return $this->container['building']; + } + + /** + * Sets building + * + * @param string $building The name of the building, house or structure if applicable, such as \"Cloudmersive Building 2\". This will often by null. + * + * @return $this + */ + public function setBuilding($building) + { + $this->container['building'] = $building; + + return $this; + } + + /** + * Gets street_number + * + * @return string + */ + public function getStreetNumber() + { + return $this->container['street_number']; + } + + /** + * Sets street_number + * + * @param string $street_number The street number or house number of the address. For example, in the address \"1600 Pennsylvania Avenue NW\" the street number would be \"1600\". This value will typically be populated for most addresses. + * + * @return $this + */ + public function setStreetNumber($street_number) + { + $this->container['street_number'] = $street_number; + + return $this; + } + + /** + * Gets street + * + * @return string + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string $street The name of the street or road of the address. For example, in the address \"1600 Pennsylvania Avenue NW\" the street number would be \"Pennsylvania Avenue NW\". + * + * @return $this + */ + public function setStreet($street) + { + $this->container['street'] = $street; + + return $this; + } + + /** + * Gets city + * + * @return string + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string $city The city of the address. + * + * @return $this + */ + public function setCity($city) + { + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets state_or_province + * + * @return string + */ + public function getStateOrProvince() + { + return $this->container['state_or_province']; + } + + /** + * Sets state_or_province + * + * @param string $state_or_province The state or province of the address. + * + * @return $this + */ + public function setStateOrProvince($state_or_province) + { + $this->container['state_or_province'] = $state_or_province; + + return $this; + } + + /** + * Gets postal_code + * + * @return string + */ + public function getPostalCode() + { + return $this->container['postal_code']; + } + + /** + * Sets postal_code + * + * @param string $postal_code The postal code or zip code of the address. + * + * @return $this + */ + public function setPostalCode($postal_code) + { + $this->container['postal_code'] = $postal_code; + + 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 Country of the address, if present in the address. If not included in the address it will be null. + * + * @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 latitude + * + * @return double + */ + public function getLatitude() + { + return $this->container['latitude']; + } + + /** + * Sets latitude + * + * @param double $latitude If the address is valid, the degrees latitude of the validated address, null otherwise + * + * @return $this + */ + public function setLatitude($latitude) + { + $this->container['latitude'] = $latitude; + + return $this; + } + + /** + * Gets longitude + * + * @return double + */ + public function getLongitude() + { + return $this->container['longitude']; + } + + /** + * Sets longitude + * + * @param double $longitude If the address is valid, the degrees longitude of the validated address, null otherwise + * + * @return $this + */ + public function setLongitude($longitude) + { + $this->container['longitude'] = $longitude; + + 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/PublicHolidayOccurrence.php b/lib/Model/PublicHolidayOccurrence.php new file mode 100644 index 0000000..f30752a --- /dev/null +++ b/lib/Model/PublicHolidayOccurrence.php @@ -0,0 +1,423 @@ + 'string', + 'local_name' => 'string', + 'occurrence_date' => '\DateTime', + 'holiday_type' => 'string', + 'nationwaide' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'english_name' => null, + 'local_name' => null, + 'occurrence_date' => 'date-time', + 'holiday_type' => null, + 'nationwaide' => 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 = [ + 'english_name' => 'EnglishName', + 'local_name' => 'LocalName', + 'occurrence_date' => 'OccurrenceDate', + 'holiday_type' => 'HolidayType', + 'nationwaide' => 'Nationwaide' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'english_name' => 'setEnglishName', + 'local_name' => 'setLocalName', + 'occurrence_date' => 'setOccurrenceDate', + 'holiday_type' => 'setHolidayType', + 'nationwaide' => 'setNationwaide' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'english_name' => 'getEnglishName', + 'local_name' => 'getLocalName', + 'occurrence_date' => 'getOccurrenceDate', + 'holiday_type' => 'getHolidayType', + 'nationwaide' => 'getNationwaide' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization 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['english_name'] = isset($data['english_name']) ? $data['english_name'] : null; + $this->container['local_name'] = isset($data['local_name']) ? $data['local_name'] : null; + $this->container['occurrence_date'] = isset($data['occurrence_date']) ? $data['occurrence_date'] : null; + $this->container['holiday_type'] = isset($data['holiday_type']) ? $data['holiday_type'] : null; + $this->container['nationwaide'] = isset($data['nationwaide']) ? $data['nationwaide'] : 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 english_name + * + * @return string + */ + public function getEnglishName() + { + return $this->container['english_name']; + } + + /** + * Sets english_name + * + * @param string $english_name Name of the holiday in English + * + * @return $this + */ + public function setEnglishName($english_name) + { + $this->container['english_name'] = $english_name; + + return $this; + } + + /** + * Gets local_name + * + * @return string + */ + public function getLocalName() + { + return $this->container['local_name']; + } + + /** + * Sets local_name + * + * @param string $local_name Local name of the holiday + * + * @return $this + */ + public function setLocalName($local_name) + { + $this->container['local_name'] = $local_name; + + return $this; + } + + /** + * Gets occurrence_date + * + * @return \DateTime + */ + public function getOccurrenceDate() + { + return $this->container['occurrence_date']; + } + + /** + * Sets occurrence_date + * + * @param \DateTime $occurrence_date Date of the holiday (start time) + * + * @return $this + */ + public function setOccurrenceDate($occurrence_date) + { + $this->container['occurrence_date'] = $occurrence_date; + + return $this; + } + + /** + * Gets holiday_type + * + * @return string + */ + public function getHolidayType() + { + return $this->container['holiday_type']; + } + + /** + * Sets holiday_type + * + * @param string $holiday_type Type of the holiday; possible values are: Public, Bank, School, Authorities, Optional, Observance + * + * @return $this + */ + public function setHolidayType($holiday_type) + { + $this->container['holiday_type'] = $holiday_type; + + return $this; + } + + /** + * Gets nationwaide + * + * @return bool + */ + public function getNationwaide() + { + return $this->container['nationwaide']; + } + + /** + * Sets nationwaide + * + * @param bool $nationwaide True if the holiday is celebrated in all locales in the country, false otherwise + * + * @return $this + */ + public function setNationwaide($nationwaide) + { + $this->container['nationwaide'] = $nationwaide; + + 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/PublicHolidaysResponse.php b/lib/Model/PublicHolidaysResponse.php new file mode 100644 index 0000000..051f3e1 --- /dev/null +++ b/lib/Model/PublicHolidaysResponse.php @@ -0,0 +1,333 @@ + 'bool', + 'public_holidays' => '\Swagger\Client\Model\PublicHolidayOccurrence[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'successful' => null, + 'public_holidays' => 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', + 'public_holidays' => 'PublicHolidays' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'successful' => 'setSuccessful', + 'public_holidays' => 'setPublicHolidays' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'successful' => 'getSuccessful', + 'public_holidays' => 'getPublicHolidays' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization 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['public_holidays'] = isset($data['public_holidays']) ? $data['public_holidays'] : 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 public_holidays + * + * @return \Swagger\Client\Model\PublicHolidayOccurrence[] + */ + public function getPublicHolidays() + { + return $this->container['public_holidays']; + } + + /** + * Sets public_holidays + * + * @param \Swagger\Client\Model\PublicHolidayOccurrence[] $public_holidays Public holidays in the requested country and year + * + * @return $this + */ + public function setPublicHolidays($public_holidays) + { + $this->container['public_holidays'] = $public_holidays; + + 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/packageconfig.json b/packageconfig.json index 11689aa..da5af83 100644 --- a/packageconfig.json +++ b/packageconfig.json @@ -1,5 +1,5 @@ { - "artifactVersion": "1.6.6", + "artifactVersion": "1.6.7", "gitUserId": "Cloudmersive", "gitRepoId": "Cloudmersive.APIClient.PHP.Validate", "composerVendorName": "cloudmersive", diff --git a/test/Api/AddressApiTest.php b/test/Api/AddressApiTest.php index 319f6b0..b678ec2 100644 --- a/test/Api/AddressApiTest.php +++ b/test/Api/AddressApiTest.php @@ -141,6 +141,16 @@ public function testAddressGetTimezone() { } + /** + * Test case for addressNormalizeAddress + * + * Normalize a street address. + * + */ + public function testAddressNormalizeAddress() + { + } + /** * Test case for addressParseString * diff --git a/test/Api/DateTimeApiTest.php b/test/Api/DateTimeApiTest.php new file mode 100644 index 0000000..324c0d4 --- /dev/null +++ b/test/Api/DateTimeApiTest.php @@ -0,0 +1,113 @@ +