From 717b16c9b8e756eb54e67201af05e33fd521d13e Mon Sep 17 00:00:00 2001 From: Cloudmersive <35204726+Cloudmersive@users.noreply.github.com> Date: Sat, 19 Oct 2019 15:19:48 -0700 Subject: [PATCH] Added 1.5.1 --- README.md | 11 +- build.ps1 | 3 +- composer.json | 2 +- docs/Api/DomainApi.md | 56 ++ docs/Api/NameApi.md | 56 ++ docs/Api/UserAgentApi.md | 64 ++ docs/Model/AddressGetServersResponse.md | 4 +- docs/Model/UserAgentValidateRequest.md | 10 + docs/Model/UserAgentValidateResponse.md | 23 + docs/Model/ValidateIdentifierRequest.md | 17 + docs/Model/ValidateIdentifierResponse.md | 11 + docs/Model/ValidateUrlRequestFull.md | 10 + docs/Model/ValidateUrlRequestSyntaxOnly.md | 2 +- docs/Model/ValidateUrlResponseFull.md | 14 + docs/Model/VatLookupRequest.md | 2 +- docs/Model/VatLookupResponse.md | 10 +- lib/Api/DomainApi.php | 262 +++++++ lib/Api/NameApi.php | 262 +++++++ lib/Api/UserAgentApi.php | 365 +++++++++ lib/Configuration.php | 4 +- lib/Model/AddressGetServersResponse.php | 4 +- lib/Model/UserAgentValidateRequest.php | 303 ++++++++ lib/Model/UserAgentValidateResponse.php | 693 ++++++++++++++++++ lib/Model/ValidateIdentifierRequest.php | 513 +++++++++++++ lib/Model/ValidateIdentifierResponse.php | 333 +++++++++ lib/Model/ValidateUrlRequestFull.php | 303 ++++++++ lib/Model/ValidateUrlRequestSyntaxOnly.php | 2 +- lib/Model/ValidateUrlResponseFull.php | 423 +++++++++++ lib/Model/ValidateUrlResponseSyntaxOnly.php | 2 +- lib/Model/VatLookupRequest.php | 2 +- lib/Model/VatLookupResponse.php | 10 +- packageconfig.json | 2 +- test/Api/DomainApiTest.php | 10 + test/Api/NameApiTest.php | 10 + test/Api/UserAgentApiTest.php | 83 +++ test/Model/UserAgentValidateRequestTest.php | 86 +++ test/Model/UserAgentValidateResponseTest.php | 177 +++++ test/Model/ValidateIdentifierRequestTest.php | 135 ++++ test/Model/ValidateIdentifierResponseTest.php | 93 +++ test/Model/ValidateUrlRequestFullTest.php | 86 +++ test/Model/ValidateUrlResponseFullTest.php | 114 +++ .../ValidateUrlResponseSyntaxOnlyTest.php | 2 +- 42 files changed, 4548 insertions(+), 26 deletions(-) create mode 100644 docs/Api/UserAgentApi.md create mode 100644 docs/Model/UserAgentValidateRequest.md create mode 100644 docs/Model/UserAgentValidateResponse.md create mode 100644 docs/Model/ValidateIdentifierRequest.md create mode 100644 docs/Model/ValidateIdentifierResponse.md create mode 100644 docs/Model/ValidateUrlRequestFull.md create mode 100644 docs/Model/ValidateUrlResponseFull.md create mode 100644 lib/Api/UserAgentApi.php create mode 100644 lib/Model/UserAgentValidateRequest.php create mode 100644 lib/Model/UserAgentValidateResponse.php create mode 100644 lib/Model/ValidateIdentifierRequest.php create mode 100644 lib/Model/ValidateIdentifierResponse.php create mode 100644 lib/Model/ValidateUrlRequestFull.php create mode 100644 lib/Model/ValidateUrlResponseFull.php create mode 100644 test/Api/UserAgentApiTest.php create mode 100644 test/Model/UserAgentValidateRequestTest.php create mode 100644 test/Model/UserAgentValidateResponseTest.php create mode 100644 test/Model/ValidateIdentifierRequestTest.php create mode 100644 test/Model/ValidateIdentifierResponseTest.php create mode 100644 test/Model/ValidateUrlRequestFullTest.php create mode 100644 test/Model/ValidateUrlResponseFullTest.php diff --git a/README.md b/README.md index 0710546..1d1da1c 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.4.9 +- Package version: 1.5.1 ## Requirements @@ -89,16 +89,19 @@ Class | Method | HTTP request | Description *AddressApi* | [**addressParseString**](docs/Api/AddressApi.md#addressparsestring) | **POST** /validate/address/parse | Parse an unstructured input text string into an international, formatted address *DomainApi* | [**domainCheck**](docs/Api/DomainApi.md#domaincheck) | **POST** /validate/domain/check | Validate a domain name *DomainApi* | [**domainPost**](docs/Api/DomainApi.md#domainpost) | **POST** /validate/domain/whois | Get WHOIS information for a domain +*DomainApi* | [**domainUrlFull**](docs/Api/DomainApi.md#domainurlfull) | **POST** /validate/domain/url/full | Validate a URL fully *DomainApi* | [**domainUrlSyntaxOnly**](docs/Api/DomainApi.md#domainurlsyntaxonly) | **POST** /validate/domain/url/syntax-only | Validate a URL syntactically *EmailApi* | [**emailAddressGetServers**](docs/Api/EmailApi.md#emailaddressgetservers) | **POST** /validate/email/address/servers | Partially check whether an email address is valid *EmailApi* | [**emailFullValidation**](docs/Api/EmailApi.md#emailfullvalidation) | **POST** /validate/email/address/full | Fully validate an email address *EmailApi* | [**emailPost**](docs/Api/EmailApi.md#emailpost) | **POST** /validate/email/address/syntaxOnly | Validate email adddress for syntactic correctness only *IPAddressApi* | [**iPAddressPost**](docs/Api/IPAddressApi.md#ipaddresspost) | **POST** /validate/ip/geolocate | Geolocate an IP address *NameApi* | [**nameGetGender**](docs/Api/NameApi.md#namegetgender) | **POST** /validate/name/get-gender | Get the gender of a first name +*NameApi* | [**nameIdentifier**](docs/Api/NameApi.md#nameidentifier) | **POST** /validate/name/identifier | Validate a code identifier *NameApi* | [**nameValidateFirstName**](docs/Api/NameApi.md#namevalidatefirstname) | **POST** /validate/name/first | Validate a first name *NameApi* | [**nameValidateFullName**](docs/Api/NameApi.md#namevalidatefullname) | **POST** /validate/name/full-name | Parse and validate a full name *NameApi* | [**nameValidateLastName**](docs/Api/NameApi.md#namevalidatelastname) | **POST** /validate/name/last | Validate a last name *PhoneNumberApi* | [**phoneNumberSyntaxOnly**](docs/Api/PhoneNumberApi.md#phonenumbersyntaxonly) | **POST** /validate/phonenumber/basic | Validate phone number (basic) +*UserAgentApi* | [**userAgentParse**](docs/Api/UserAgentApi.md#useragentparse) | **POST** /validate/useragent/parse | Parse an HTTP User-Agent string, identify robots *VatApi* | [**vatVatLookup**](docs/Api/VatApi.md#vatvatlookup) | **POST** /validate/vat/lookup | Lookup a VAT code @@ -121,7 +124,13 @@ Class | Method | HTTP request | Description - [ParseAddressResponse](docs/Model/ParseAddressResponse.md) - [PhoneNumberValidateRequest](docs/Model/PhoneNumberValidateRequest.md) - [PhoneNumberValidationResponse](docs/Model/PhoneNumberValidationResponse.md) + - [UserAgentValidateRequest](docs/Model/UserAgentValidateRequest.md) + - [UserAgentValidateResponse](docs/Model/UserAgentValidateResponse.md) + - [ValidateIdentifierRequest](docs/Model/ValidateIdentifierRequest.md) + - [ValidateIdentifierResponse](docs/Model/ValidateIdentifierResponse.md) + - [ValidateUrlRequestFull](docs/Model/ValidateUrlRequestFull.md) - [ValidateUrlRequestSyntaxOnly](docs/Model/ValidateUrlRequestSyntaxOnly.md) + - [ValidateUrlResponseFull](docs/Model/ValidateUrlResponseFull.md) - [ValidateUrlResponseSyntaxOnly](docs/Model/ValidateUrlResponseSyntaxOnly.md) - [VatLookupRequest](docs/Model/VatLookupRequest.md) - [VatLookupResponse](docs/Model/VatLookupResponse.md) diff --git a/build.ps1 b/build.ps1 index b0013e3..cc3bc37 100644 --- a/build.ps1 +++ b/build.ps1 @@ -14,4 +14,5 @@ Remove-Item –path ./cloudmersive_validate_api_client –recurse (Get-Content ./composer.json).replace('https://github.com/swagger-api/swagger-codegen', 'https://cloudmersive.com') | Set-Content ./composer.json (Get-Content ./composer.json).replace('http://swagger.io', 'https://cloudmersive.com') | Set-Content ./composer.json -& php C:\ProgramData\ComposerSetup\bin\composer.phar install \ No newline at end of file +# & C:\tools\php\php C:\ProgramData\ComposerSetup\bin\composer.phar config -g -- disable-tls true +& C:\tools\php71\php C:\ProgramData\ComposerSetup\bin\composer.phar install \ No newline at end of file diff --git a/composer.json b/composer.json index bd7eb38..78fe932 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "cloudmersive/cloudmersive_validate_api_client", - "version": "1.4.9", + "version": "1.5.1", "description": "", "keywords": [ "swagger", diff --git a/docs/Api/DomainApi.md b/docs/Api/DomainApi.md index 8d77a3a..d80b36b 100644 --- a/docs/Api/DomainApi.md +++ b/docs/Api/DomainApi.md @@ -6,6 +6,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**domainCheck**](DomainApi.md#domainCheck) | **POST** /validate/domain/check | Validate a domain name [**domainPost**](DomainApi.md#domainPost) | **POST** /validate/domain/whois | Get WHOIS information for a domain +[**domainUrlFull**](DomainApi.md#domainUrlFull) | **POST** /validate/domain/url/full | Validate a URL fully [**domainUrlSyntaxOnly**](DomainApi.md#domainUrlSyntaxOnly) | **POST** /validate/domain/url/syntax-only | Validate a URL syntactically @@ -119,6 +120,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) +# **domainUrlFull** +> \Swagger\Client\Model\ValidateUrlResponseFull domainUrlFull($request) + +Validate a URL fully + +Validate whether a URL is syntactically valid (does not check endpoint for validity), whether it exists, and whether the endpoint is up and passes virus scan checks. Accepts various types of input and produces a well-formed URL as output. + +### 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\DomainApi( + // 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 +); +$request = new \Swagger\Client\Model\ValidateUrlRequestFull(); // \Swagger\Client\Model\ValidateUrlRequestFull | + +try { + $result = $apiInstance->domainUrlFull($request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DomainApi->domainUrlFull: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request** | [**\Swagger\Client\Model\ValidateUrlRequestFull**](../Model/ValidateUrlRequestFull.md)| | + +### Return type + +[**\Swagger\Client\Model\ValidateUrlResponseFull**](../Model/ValidateUrlResponseFull.md) + +### Authorization + +[Apikey](../../README.md#Apikey) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded + - **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) + # **domainUrlSyntaxOnly** > \Swagger\Client\Model\ValidateUrlResponseSyntaxOnly domainUrlSyntaxOnly($request) diff --git a/docs/Api/NameApi.md b/docs/Api/NameApi.md index e9f9e55..4c98780 100644 --- a/docs/Api/NameApi.md +++ b/docs/Api/NameApi.md @@ -5,6 +5,7 @@ All URIs are relative to *https://api.cloudmersive.com* Method | HTTP request | Description ------------- | ------------- | ------------- [**nameGetGender**](NameApi.md#nameGetGender) | **POST** /validate/name/get-gender | Get the gender of a first name +[**nameIdentifier**](NameApi.md#nameIdentifier) | **POST** /validate/name/identifier | Validate a code identifier [**nameValidateFirstName**](NameApi.md#nameValidateFirstName) | **POST** /validate/name/first | Validate a first name [**nameValidateFullName**](NameApi.md#nameValidateFullName) | **POST** /validate/name/full-name | Parse and validate a full name [**nameValidateLastName**](NameApi.md#nameValidateLastName) | **POST** /validate/name/last | Validate a last name @@ -65,6 +66,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) +# **nameIdentifier** +> \Swagger\Client\Model\ValidateIdentifierResponse nameIdentifier($input) + +Validate a code identifier + +Determines if the input name is a valid technical / code identifier. Configure input rules such as whether whitespace, hyphens, underscores, etc. are allowed. For example, a valid identifier might be \"helloWorld\" but not \"hello*World\". + +### 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\NameApi( + // 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\ValidateIdentifierRequest(); // \Swagger\Client\Model\ValidateIdentifierRequest | Identifier validation request information + +try { + $result = $apiInstance->nameIdentifier($input); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NameApi->nameIdentifier: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **input** | [**\Swagger\Client\Model\ValidateIdentifierRequest**](../Model/ValidateIdentifierRequest.md)| Identifier validation request information | + +### Return type + +[**\Swagger\Client\Model\ValidateIdentifierResponse**](../Model/ValidateIdentifierResponse.md) + +### Authorization + +[Apikey](../../README.md#Apikey) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded + - **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) + # **nameValidateFirstName** > \Swagger\Client\Model\FirstNameValidationResponse nameValidateFirstName($input) diff --git a/docs/Api/UserAgentApi.md b/docs/Api/UserAgentApi.md new file mode 100644 index 0000000..ee5f2ce --- /dev/null +++ b/docs/Api/UserAgentApi.md @@ -0,0 +1,64 @@ +# Swagger\Client\UserAgentApi + +All URIs are relative to *https://api.cloudmersive.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**userAgentParse**](UserAgentApi.md#userAgentParse) | **POST** /validate/useragent/parse | Parse an HTTP User-Agent string, identify robots + + +# **userAgentParse** +> \Swagger\Client\Model\UserAgentValidateResponse userAgentParse($request) + +Parse an HTTP User-Agent string, identify robots + +Uses a parsing system and database to parse the User-Agent into its structured component parts, such as Browser, Browser Version, Browser Engine, Operating System, and importantly, Robot identification. + +### 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\UserAgentApi( + // 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 +); +$request = new \Swagger\Client\Model\UserAgentValidateRequest(); // \Swagger\Client\Model\UserAgentValidateRequest | Input parse request + +try { + $result = $apiInstance->userAgentParse($request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling UserAgentApi->userAgentParse: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request** | [**\Swagger\Client\Model\UserAgentValidateRequest**](../Model/UserAgentValidateRequest.md)| Input parse request | + +### Return type + +[**\Swagger\Client\Model\UserAgentValidateResponse**](../Model/UserAgentValidateResponse.md) + +### Authorization + +[Apikey](../../README.md#Apikey) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded + - **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/AddressGetServersResponse.md b/docs/Model/AddressGetServersResponse.md index a60ba68..4b4689f 100644 --- a/docs/Model/AddressGetServersResponse.md +++ b/docs/Model/AddressGetServersResponse.md @@ -3,8 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**success** | **bool** | | [optional] -**servers** | **string[]** | | [optional] +**success** | **bool** | True if partial address validation was successufl, false otherwise | [optional] +**servers** | **string[]** | Email servers for this email address | [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/UserAgentValidateRequest.md b/docs/Model/UserAgentValidateRequest.md new file mode 100644 index 0000000..c495555 --- /dev/null +++ b/docs/Model/UserAgentValidateRequest.md @@ -0,0 +1,10 @@ +# UserAgentValidateRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_agent_string** | **string** | The user agent string you wish to parse and validate | [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/UserAgentValidateResponse.md b/docs/Model/UserAgentValidateResponse.md new file mode 100644 index 0000000..51c9434 --- /dev/null +++ b/docs/Model/UserAgentValidateResponse.md @@ -0,0 +1,23 @@ +# UserAgentValidateResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**successful** | **bool** | True if the operation was successful, false otherwise | [optional] +**is_bot** | **bool** | True if the request is a known robot, false otherwise | [optional] +**bot_name** | **string** | Optional; name of the robot if the request was from a known robot, otherwise null | [optional] +**bot_url** | **string** | Optional; if available, the URL to the robot | [optional] +**operating_system** | **string** | Operating System of the User-Agent (e.g. Windows) | [optional] +**operating_system_cpu_platform** | **string** | The CPU platform of the User-Agent (e.g. x64) | [optional] +**operating_system_version** | **string** | The version of the operating system of the User-Agent (e.g. \"10\" for Windows 10) | [optional] +**device_type** | **string** | Device type of the User-Agent; possible values are \"DESKTOP\", \"SMARTPHONE\", \"TABLET\" | [optional] +**device_brand_name** | **string** | Brand name of the User-Agent | [optional] +**device_model** | **string** | Model name or number of the User-Agent | [optional] +**browser_name** | **string** | Name of the Browser | [optional] +**browser_version** | **string** | Version of the Browser | [optional] +**browser_engine_name** | **string** | Name of the Browser Engine | [optional] +**browser_engine_version** | **string** | Version of the Browser Engine | [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/ValidateIdentifierRequest.md b/docs/Model/ValidateIdentifierRequest.md new file mode 100644 index 0000000..5746b84 --- /dev/null +++ b/docs/Model/ValidateIdentifierRequest.md @@ -0,0 +1,17 @@ +# ValidateIdentifierRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**input** | **string** | Text string identifier input | [optional] +**allow_whitespace** | **bool** | True if whitespace is allowed in the identifier, false otherwise | [optional] +**allow_hyphens** | **bool** | True if hyphens are allowd in the identifier, false otherwise | [optional] +**allow_underscore** | **bool** | True if underscores are allowed in the identifier, false otherwise | [optional] +**allow_numbers** | **bool** | True if numbers are allowed in the identifier, false otherwise | [optional] +**allow_periods** | **bool** | True if periods are allowed in the identifier, false otherwise | [optional] +**max_length** | **int** | Optional; maximum length, if any, of the identifier | [optional] +**min_length** | **int** | Optional; minimum length, if any, of the identifier | [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/ValidateIdentifierResponse.md b/docs/Model/ValidateIdentifierResponse.md new file mode 100644 index 0000000..858f8f2 --- /dev/null +++ b/docs/Model/ValidateIdentifierResponse.md @@ -0,0 +1,11 @@ +# ValidateIdentifierResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**valid_identifier** | **bool** | True if the input identifier is valid, false otherwise | [optional] +**error** | **string** | Resulting error from the identifier validation; possible errors are: \"InputIsEmpty\", \"ContainsWhitespace\", \"ContainsNumbers\", \"ContainsHyphen\", \"ContainsUnderscore\", \"ContainsPeriod\", \"TooShort\", \"TooLong\", \"ContainsSpecialCharacters\" | [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/ValidateUrlRequestFull.md b/docs/Model/ValidateUrlRequestFull.md new file mode 100644 index 0000000..638c9d6 --- /dev/null +++ b/docs/Model/ValidateUrlRequestFull.md @@ -0,0 +1,10 @@ +# ValidateUrlRequestFull + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **string** | URL to validate | [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/ValidateUrlRequestSyntaxOnly.md b/docs/Model/ValidateUrlRequestSyntaxOnly.md index b6194b2..d2918bb 100644 --- a/docs/Model/ValidateUrlRequestSyntaxOnly.md +++ b/docs/Model/ValidateUrlRequestSyntaxOnly.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**url** | **string** | | [optional] +**url** | **string** | URL to validate | [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/ValidateUrlResponseFull.md b/docs/Model/ValidateUrlResponseFull.md new file mode 100644 index 0000000..8553e2f --- /dev/null +++ b/docs/Model/ValidateUrlResponseFull.md @@ -0,0 +1,14 @@ +# ValidateUrlResponseFull + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**valid_url** | **bool** | True if the URL has valid syntax, a valid domain, a valid endpoint, and passes virus scan checks; false otherwise | [optional] +**valid_syntax** | **bool** | True if the URL has valid syntax, false otherwise | [optional] +**valid_domain** | **bool** | True if the domain name is valid and exists, false otherwise | [optional] +**valid_endpoint** | **bool** | True if the endpoint is up and responsive and passes a virus scan check, false otherwise | [optional] +**well_formed_url** | **string** | Well-formed version of the URL | [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/VatLookupRequest.md b/docs/Model/VatLookupRequest.md index a238a5d..9f7a79f 100644 --- a/docs/Model/VatLookupRequest.md +++ b/docs/Model/VatLookupRequest.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**vat_code** | **string** | | [optional] +**vat_code** | **string** | VAT code to lookup; example \"CZ25123891\" | [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/VatLookupResponse.md b/docs/Model/VatLookupResponse.md index 99fdb92..564a706 100644 --- a/docs/Model/VatLookupResponse.md +++ b/docs/Model/VatLookupResponse.md @@ -3,11 +3,11 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**country_code** | **string** | | [optional] -**vat_number** | **string** | | [optional] -**is_valid** | **bool** | | [optional] -**business_name** | **string** | | [optional] -**business_address** | **string** | | [optional] +**country_code** | **string** | Two-letter country code | [optional] +**vat_number** | **string** | VAT number | [optional] +**is_valid** | **bool** | True if the VAT code is valid, false otherwise | [optional] +**business_name** | **string** | Name of the business | [optional] +**business_address** | **string** | Business address | [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/DomainApi.php b/lib/Api/DomainApi.php index 91448f1..90bb253 100644 --- a/lib/Api/DomainApi.php +++ b/lib/Api/DomainApi.php @@ -606,6 +606,268 @@ protected function domainPostRequest($domain) ); } + /** + * Operation domainUrlFull + * + * Validate a URL fully + * + * @param \Swagger\Client\Model\ValidateUrlRequestFull $request request (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\ValidateUrlResponseFull + */ + public function domainUrlFull($request) + { + list($response) = $this->domainUrlFullWithHttpInfo($request); + return $response; + } + + /** + * Operation domainUrlFullWithHttpInfo + * + * Validate a URL fully + * + * @param \Swagger\Client\Model\ValidateUrlRequestFull $request (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\ValidateUrlResponseFull, HTTP status code, HTTP response headers (array of strings) + */ + public function domainUrlFullWithHttpInfo($request) + { + $returnType = '\Swagger\Client\Model\ValidateUrlResponseFull'; + $request = $this->domainUrlFullRequest($request); + + 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\ValidateUrlResponseFull', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation domainUrlFullAsync + * + * Validate a URL fully + * + * @param \Swagger\Client\Model\ValidateUrlRequestFull $request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function domainUrlFullAsync($request) + { + return $this->domainUrlFullAsyncWithHttpInfo($request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation domainUrlFullAsyncWithHttpInfo + * + * Validate a URL fully + * + * @param \Swagger\Client\Model\ValidateUrlRequestFull $request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function domainUrlFullAsyncWithHttpInfo($request) + { + $returnType = '\Swagger\Client\Model\ValidateUrlResponseFull'; + $request = $this->domainUrlFullRequest($request); + + 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 'domainUrlFull' + * + * @param \Swagger\Client\Model\ValidateUrlRequestFull $request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function domainUrlFullRequest($request) + { + // verify the required parameter 'request' is set + if ($request === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $request when calling domainUrlFull' + ); + } + + $resourcePath = '/validate/domain/url/full'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($request)) { + $_tempBody = $request; + } + + 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', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'] + ); + } + + // 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 domainUrlSyntaxOnly * diff --git a/lib/Api/NameApi.php b/lib/Api/NameApi.php index 6893d6f..42a83a7 100644 --- a/lib/Api/NameApi.php +++ b/lib/Api/NameApi.php @@ -272,6 +272,268 @@ protected function nameGetGenderRequest($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', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'] + ); + } + + // 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 nameIdentifier + * + * Validate a code identifier + * + * @param \Swagger\Client\Model\ValidateIdentifierRequest $input Identifier validation request information (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\ValidateIdentifierResponse + */ + public function nameIdentifier($input) + { + list($response) = $this->nameIdentifierWithHttpInfo($input); + return $response; + } + + /** + * Operation nameIdentifierWithHttpInfo + * + * Validate a code identifier + * + * @param \Swagger\Client\Model\ValidateIdentifierRequest $input Identifier validation request information (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\ValidateIdentifierResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function nameIdentifierWithHttpInfo($input) + { + $returnType = '\Swagger\Client\Model\ValidateIdentifierResponse'; + $request = $this->nameIdentifierRequest($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\ValidateIdentifierResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation nameIdentifierAsync + * + * Validate a code identifier + * + * @param \Swagger\Client\Model\ValidateIdentifierRequest $input Identifier validation request information (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function nameIdentifierAsync($input) + { + return $this->nameIdentifierAsyncWithHttpInfo($input) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation nameIdentifierAsyncWithHttpInfo + * + * Validate a code identifier + * + * @param \Swagger\Client\Model\ValidateIdentifierRequest $input Identifier validation request information (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function nameIdentifierAsyncWithHttpInfo($input) + { + $returnType = '\Swagger\Client\Model\ValidateIdentifierResponse'; + $request = $this->nameIdentifierRequest($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 'nameIdentifier' + * + * @param \Swagger\Client\Model\ValidateIdentifierRequest $input Identifier validation request information (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function nameIdentifierRequest($input) + { + // verify the required parameter 'input' is set + if ($input === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $input when calling nameIdentifier' + ); + } + + $resourcePath = '/validate/name/identifier'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // body params $_tempBody = null; if (isset($input)) { diff --git a/lib/Api/UserAgentApi.php b/lib/Api/UserAgentApi.php new file mode 100644 index 0000000..cabaf4a --- /dev/null +++ b/lib/Api/UserAgentApi.php @@ -0,0 +1,365 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation userAgentParse + * + * Parse an HTTP User-Agent string, identify robots + * + * @param \Swagger\Client\Model\UserAgentValidateRequest $request Input parse request (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\UserAgentValidateResponse + */ + public function userAgentParse($request) + { + list($response) = $this->userAgentParseWithHttpInfo($request); + return $response; + } + + /** + * Operation userAgentParseWithHttpInfo + * + * Parse an HTTP User-Agent string, identify robots + * + * @param \Swagger\Client\Model\UserAgentValidateRequest $request Input parse request (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\UserAgentValidateResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function userAgentParseWithHttpInfo($request) + { + $returnType = '\Swagger\Client\Model\UserAgentValidateResponse'; + $request = $this->userAgentParseRequest($request); + + 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\UserAgentValidateResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation userAgentParseAsync + * + * Parse an HTTP User-Agent string, identify robots + * + * @param \Swagger\Client\Model\UserAgentValidateRequest $request Input parse request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function userAgentParseAsync($request) + { + return $this->userAgentParseAsyncWithHttpInfo($request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation userAgentParseAsyncWithHttpInfo + * + * Parse an HTTP User-Agent string, identify robots + * + * @param \Swagger\Client\Model\UserAgentValidateRequest $request Input parse request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function userAgentParseAsyncWithHttpInfo($request) + { + $returnType = '\Swagger\Client\Model\UserAgentValidateResponse'; + $request = $this->userAgentParseRequest($request); + + 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 'userAgentParse' + * + * @param \Swagger\Client\Model\UserAgentValidateRequest $request Input parse request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function userAgentParseRequest($request) + { + // verify the required parameter 'request' is set + if ($request === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $request when calling userAgentParse' + ); + } + + $resourcePath = '/validate/useragent/parse'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($request)) { + $_tempBody = $request; + } + + 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', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'] + ); + } + + // 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/Configuration.php b/lib/Configuration.php index 9be806b..0741f84 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -88,7 +88,7 @@ class Configuration * * @var string */ - protected $userAgent = 'Swagger-Codegen/1.4.9/php'; + protected $userAgent = 'Swagger-Codegen/1.5.1/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.4.9' . PHP_EOL; + $report .= ' SDK Package Version: 1.5.1' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/Model/AddressGetServersResponse.php b/lib/Model/AddressGetServersResponse.php index 97550de..1730098 100644 --- a/lib/Model/AddressGetServersResponse.php +++ b/lib/Model/AddressGetServersResponse.php @@ -225,7 +225,7 @@ public function getSuccess() /** * Sets success * - * @param bool $success success + * @param bool $success True if partial address validation was successufl, false otherwise * * @return $this */ @@ -249,7 +249,7 @@ public function getServers() /** * Sets servers * - * @param string[] $servers servers + * @param string[] $servers Email servers for this email address * * @return $this */ diff --git a/lib/Model/UserAgentValidateRequest.php b/lib/Model/UserAgentValidateRequest.php new file mode 100644 index 0000000..40be8e7 --- /dev/null +++ b/lib/Model/UserAgentValidateRequest.php @@ -0,0 +1,303 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'user_agent_string' => 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 = [ + 'user_agent_string' => 'UserAgentString' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_agent_string' => 'setUserAgentString' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_agent_string' => 'getUserAgentString' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization 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['user_agent_string'] = isset($data['user_agent_string']) ? $data['user_agent_string'] : 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 user_agent_string + * + * @return string + */ + public function getUserAgentString() + { + return $this->container['user_agent_string']; + } + + /** + * Sets user_agent_string + * + * @param string $user_agent_string The user agent string you wish to parse and validate + * + * @return $this + */ + public function setUserAgentString($user_agent_string) + { + $this->container['user_agent_string'] = $user_agent_string; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/UserAgentValidateResponse.php b/lib/Model/UserAgentValidateResponse.php new file mode 100644 index 0000000..b60364a --- /dev/null +++ b/lib/Model/UserAgentValidateResponse.php @@ -0,0 +1,693 @@ + 'bool', + 'is_bot' => 'bool', + 'bot_name' => 'string', + 'bot_url' => 'string', + 'operating_system' => 'string', + 'operating_system_cpu_platform' => 'string', + 'operating_system_version' => 'string', + 'device_type' => 'string', + 'device_brand_name' => 'string', + 'device_model' => 'string', + 'browser_name' => 'string', + 'browser_version' => 'string', + 'browser_engine_name' => 'string', + 'browser_engine_version' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'successful' => null, + 'is_bot' => null, + 'bot_name' => null, + 'bot_url' => null, + 'operating_system' => null, + 'operating_system_cpu_platform' => null, + 'operating_system_version' => null, + 'device_type' => null, + 'device_brand_name' => null, + 'device_model' => null, + 'browser_name' => null, + 'browser_version' => null, + 'browser_engine_name' => null, + 'browser_engine_version' => 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', + 'is_bot' => 'IsBot', + 'bot_name' => 'BotName', + 'bot_url' => 'BotURL', + 'operating_system' => 'OperatingSystem', + 'operating_system_cpu_platform' => 'OperatingSystemCPUPlatform', + 'operating_system_version' => 'OperatingSystemVersion', + 'device_type' => 'DeviceType', + 'device_brand_name' => 'DeviceBrandName', + 'device_model' => 'DeviceModel', + 'browser_name' => 'BrowserName', + 'browser_version' => 'BrowserVersion', + 'browser_engine_name' => 'BrowserEngineName', + 'browser_engine_version' => 'BrowserEngineVersion' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'successful' => 'setSuccessful', + 'is_bot' => 'setIsBot', + 'bot_name' => 'setBotName', + 'bot_url' => 'setBotUrl', + 'operating_system' => 'setOperatingSystem', + 'operating_system_cpu_platform' => 'setOperatingSystemCpuPlatform', + 'operating_system_version' => 'setOperatingSystemVersion', + 'device_type' => 'setDeviceType', + 'device_brand_name' => 'setDeviceBrandName', + 'device_model' => 'setDeviceModel', + 'browser_name' => 'setBrowserName', + 'browser_version' => 'setBrowserVersion', + 'browser_engine_name' => 'setBrowserEngineName', + 'browser_engine_version' => 'setBrowserEngineVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'successful' => 'getSuccessful', + 'is_bot' => 'getIsBot', + 'bot_name' => 'getBotName', + 'bot_url' => 'getBotUrl', + 'operating_system' => 'getOperatingSystem', + 'operating_system_cpu_platform' => 'getOperatingSystemCpuPlatform', + 'operating_system_version' => 'getOperatingSystemVersion', + 'device_type' => 'getDeviceType', + 'device_brand_name' => 'getDeviceBrandName', + 'device_model' => 'getDeviceModel', + 'browser_name' => 'getBrowserName', + 'browser_version' => 'getBrowserVersion', + 'browser_engine_name' => 'getBrowserEngineName', + 'browser_engine_version' => 'getBrowserEngineVersion' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization 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['is_bot'] = isset($data['is_bot']) ? $data['is_bot'] : null; + $this->container['bot_name'] = isset($data['bot_name']) ? $data['bot_name'] : null; + $this->container['bot_url'] = isset($data['bot_url']) ? $data['bot_url'] : null; + $this->container['operating_system'] = isset($data['operating_system']) ? $data['operating_system'] : null; + $this->container['operating_system_cpu_platform'] = isset($data['operating_system_cpu_platform']) ? $data['operating_system_cpu_platform'] : null; + $this->container['operating_system_version'] = isset($data['operating_system_version']) ? $data['operating_system_version'] : null; + $this->container['device_type'] = isset($data['device_type']) ? $data['device_type'] : null; + $this->container['device_brand_name'] = isset($data['device_brand_name']) ? $data['device_brand_name'] : null; + $this->container['device_model'] = isset($data['device_model']) ? $data['device_model'] : null; + $this->container['browser_name'] = isset($data['browser_name']) ? $data['browser_name'] : null; + $this->container['browser_version'] = isset($data['browser_version']) ? $data['browser_version'] : null; + $this->container['browser_engine_name'] = isset($data['browser_engine_name']) ? $data['browser_engine_name'] : null; + $this->container['browser_engine_version'] = isset($data['browser_engine_version']) ? $data['browser_engine_version'] : 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 the operation was successful, false otherwise + * + * @return $this + */ + public function setSuccessful($successful) + { + $this->container['successful'] = $successful; + + return $this; + } + + /** + * Gets is_bot + * + * @return bool + */ + public function getIsBot() + { + return $this->container['is_bot']; + } + + /** + * Sets is_bot + * + * @param bool $is_bot True if the request is a known robot, false otherwise + * + * @return $this + */ + public function setIsBot($is_bot) + { + $this->container['is_bot'] = $is_bot; + + return $this; + } + + /** + * Gets bot_name + * + * @return string + */ + public function getBotName() + { + return $this->container['bot_name']; + } + + /** + * Sets bot_name + * + * @param string $bot_name Optional; name of the robot if the request was from a known robot, otherwise null + * + * @return $this + */ + public function setBotName($bot_name) + { + $this->container['bot_name'] = $bot_name; + + return $this; + } + + /** + * Gets bot_url + * + * @return string + */ + public function getBotUrl() + { + return $this->container['bot_url']; + } + + /** + * Sets bot_url + * + * @param string $bot_url Optional; if available, the URL to the robot + * + * @return $this + */ + public function setBotUrl($bot_url) + { + $this->container['bot_url'] = $bot_url; + + return $this; + } + + /** + * Gets operating_system + * + * @return string + */ + public function getOperatingSystem() + { + return $this->container['operating_system']; + } + + /** + * Sets operating_system + * + * @param string $operating_system Operating System of the User-Agent (e.g. Windows) + * + * @return $this + */ + public function setOperatingSystem($operating_system) + { + $this->container['operating_system'] = $operating_system; + + return $this; + } + + /** + * Gets operating_system_cpu_platform + * + * @return string + */ + public function getOperatingSystemCpuPlatform() + { + return $this->container['operating_system_cpu_platform']; + } + + /** + * Sets operating_system_cpu_platform + * + * @param string $operating_system_cpu_platform The CPU platform of the User-Agent (e.g. x64) + * + * @return $this + */ + public function setOperatingSystemCpuPlatform($operating_system_cpu_platform) + { + $this->container['operating_system_cpu_platform'] = $operating_system_cpu_platform; + + return $this; + } + + /** + * Gets operating_system_version + * + * @return string + */ + public function getOperatingSystemVersion() + { + return $this->container['operating_system_version']; + } + + /** + * Sets operating_system_version + * + * @param string $operating_system_version The version of the operating system of the User-Agent (e.g. \"10\" for Windows 10) + * + * @return $this + */ + public function setOperatingSystemVersion($operating_system_version) + { + $this->container['operating_system_version'] = $operating_system_version; + + return $this; + } + + /** + * Gets device_type + * + * @return string + */ + public function getDeviceType() + { + return $this->container['device_type']; + } + + /** + * Sets device_type + * + * @param string $device_type Device type of the User-Agent; possible values are \"DESKTOP\", \"SMARTPHONE\", \"TABLET\" + * + * @return $this + */ + public function setDeviceType($device_type) + { + $this->container['device_type'] = $device_type; + + return $this; + } + + /** + * Gets device_brand_name + * + * @return string + */ + public function getDeviceBrandName() + { + return $this->container['device_brand_name']; + } + + /** + * Sets device_brand_name + * + * @param string $device_brand_name Brand name of the User-Agent + * + * @return $this + */ + public function setDeviceBrandName($device_brand_name) + { + $this->container['device_brand_name'] = $device_brand_name; + + return $this; + } + + /** + * Gets device_model + * + * @return string + */ + public function getDeviceModel() + { + return $this->container['device_model']; + } + + /** + * Sets device_model + * + * @param string $device_model Model name or number of the User-Agent + * + * @return $this + */ + public function setDeviceModel($device_model) + { + $this->container['device_model'] = $device_model; + + return $this; + } + + /** + * Gets browser_name + * + * @return string + */ + public function getBrowserName() + { + return $this->container['browser_name']; + } + + /** + * Sets browser_name + * + * @param string $browser_name Name of the Browser + * + * @return $this + */ + public function setBrowserName($browser_name) + { + $this->container['browser_name'] = $browser_name; + + return $this; + } + + /** + * Gets browser_version + * + * @return string + */ + public function getBrowserVersion() + { + return $this->container['browser_version']; + } + + /** + * Sets browser_version + * + * @param string $browser_version Version of the Browser + * + * @return $this + */ + public function setBrowserVersion($browser_version) + { + $this->container['browser_version'] = $browser_version; + + return $this; + } + + /** + * Gets browser_engine_name + * + * @return string + */ + public function getBrowserEngineName() + { + return $this->container['browser_engine_name']; + } + + /** + * Sets browser_engine_name + * + * @param string $browser_engine_name Name of the Browser Engine + * + * @return $this + */ + public function setBrowserEngineName($browser_engine_name) + { + $this->container['browser_engine_name'] = $browser_engine_name; + + return $this; + } + + /** + * Gets browser_engine_version + * + * @return string + */ + public function getBrowserEngineVersion() + { + return $this->container['browser_engine_version']; + } + + /** + * Sets browser_engine_version + * + * @param string $browser_engine_version Version of the Browser Engine + * + * @return $this + */ + public function setBrowserEngineVersion($browser_engine_version) + { + $this->container['browser_engine_version'] = $browser_engine_version; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ValidateIdentifierRequest.php b/lib/Model/ValidateIdentifierRequest.php new file mode 100644 index 0000000..c51ee2d --- /dev/null +++ b/lib/Model/ValidateIdentifierRequest.php @@ -0,0 +1,513 @@ + 'string', + 'allow_whitespace' => 'bool', + 'allow_hyphens' => 'bool', + 'allow_underscore' => 'bool', + 'allow_numbers' => 'bool', + 'allow_periods' => 'bool', + 'max_length' => 'int', + 'min_length' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'input' => null, + 'allow_whitespace' => null, + 'allow_hyphens' => null, + 'allow_underscore' => null, + 'allow_numbers' => null, + 'allow_periods' => null, + 'max_length' => 'int32', + 'min_length' => '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 = [ + 'input' => 'Input', + 'allow_whitespace' => 'AllowWhitespace', + 'allow_hyphens' => 'AllowHyphens', + 'allow_underscore' => 'AllowUnderscore', + 'allow_numbers' => 'AllowNumbers', + 'allow_periods' => 'AllowPeriods', + 'max_length' => 'MaxLength', + 'min_length' => 'MinLength' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'input' => 'setInput', + 'allow_whitespace' => 'setAllowWhitespace', + 'allow_hyphens' => 'setAllowHyphens', + 'allow_underscore' => 'setAllowUnderscore', + 'allow_numbers' => 'setAllowNumbers', + 'allow_periods' => 'setAllowPeriods', + 'max_length' => 'setMaxLength', + 'min_length' => 'setMinLength' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'input' => 'getInput', + 'allow_whitespace' => 'getAllowWhitespace', + 'allow_hyphens' => 'getAllowHyphens', + 'allow_underscore' => 'getAllowUnderscore', + 'allow_numbers' => 'getAllowNumbers', + 'allow_periods' => 'getAllowPeriods', + 'max_length' => 'getMaxLength', + 'min_length' => 'getMinLength' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization 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['input'] = isset($data['input']) ? $data['input'] : null; + $this->container['allow_whitespace'] = isset($data['allow_whitespace']) ? $data['allow_whitespace'] : null; + $this->container['allow_hyphens'] = isset($data['allow_hyphens']) ? $data['allow_hyphens'] : null; + $this->container['allow_underscore'] = isset($data['allow_underscore']) ? $data['allow_underscore'] : null; + $this->container['allow_numbers'] = isset($data['allow_numbers']) ? $data['allow_numbers'] : null; + $this->container['allow_periods'] = isset($data['allow_periods']) ? $data['allow_periods'] : null; + $this->container['max_length'] = isset($data['max_length']) ? $data['max_length'] : null; + $this->container['min_length'] = isset($data['min_length']) ? $data['min_length'] : 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 input + * + * @return string + */ + public function getInput() + { + return $this->container['input']; + } + + /** + * Sets input + * + * @param string $input Text string identifier input + * + * @return $this + */ + public function setInput($input) + { + $this->container['input'] = $input; + + return $this; + } + + /** + * Gets allow_whitespace + * + * @return bool + */ + public function getAllowWhitespace() + { + return $this->container['allow_whitespace']; + } + + /** + * Sets allow_whitespace + * + * @param bool $allow_whitespace True if whitespace is allowed in the identifier, false otherwise + * + * @return $this + */ + public function setAllowWhitespace($allow_whitespace) + { + $this->container['allow_whitespace'] = $allow_whitespace; + + return $this; + } + + /** + * Gets allow_hyphens + * + * @return bool + */ + public function getAllowHyphens() + { + return $this->container['allow_hyphens']; + } + + /** + * Sets allow_hyphens + * + * @param bool $allow_hyphens True if hyphens are allowd in the identifier, false otherwise + * + * @return $this + */ + public function setAllowHyphens($allow_hyphens) + { + $this->container['allow_hyphens'] = $allow_hyphens; + + return $this; + } + + /** + * Gets allow_underscore + * + * @return bool + */ + public function getAllowUnderscore() + { + return $this->container['allow_underscore']; + } + + /** + * Sets allow_underscore + * + * @param bool $allow_underscore True if underscores are allowed in the identifier, false otherwise + * + * @return $this + */ + public function setAllowUnderscore($allow_underscore) + { + $this->container['allow_underscore'] = $allow_underscore; + + return $this; + } + + /** + * Gets allow_numbers + * + * @return bool + */ + public function getAllowNumbers() + { + return $this->container['allow_numbers']; + } + + /** + * Sets allow_numbers + * + * @param bool $allow_numbers True if numbers are allowed in the identifier, false otherwise + * + * @return $this + */ + public function setAllowNumbers($allow_numbers) + { + $this->container['allow_numbers'] = $allow_numbers; + + return $this; + } + + /** + * Gets allow_periods + * + * @return bool + */ + public function getAllowPeriods() + { + return $this->container['allow_periods']; + } + + /** + * Sets allow_periods + * + * @param bool $allow_periods True if periods are allowed in the identifier, false otherwise + * + * @return $this + */ + public function setAllowPeriods($allow_periods) + { + $this->container['allow_periods'] = $allow_periods; + + return $this; + } + + /** + * Gets max_length + * + * @return int + */ + public function getMaxLength() + { + return $this->container['max_length']; + } + + /** + * Sets max_length + * + * @param int $max_length Optional; maximum length, if any, of the identifier + * + * @return $this + */ + public function setMaxLength($max_length) + { + $this->container['max_length'] = $max_length; + + return $this; + } + + /** + * Gets min_length + * + * @return int + */ + public function getMinLength() + { + return $this->container['min_length']; + } + + /** + * Sets min_length + * + * @param int $min_length Optional; minimum length, if any, of the identifier + * + * @return $this + */ + public function setMinLength($min_length) + { + $this->container['min_length'] = $min_length; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_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/ValidateIdentifierResponse.php b/lib/Model/ValidateIdentifierResponse.php new file mode 100644 index 0000000..5455c20 --- /dev/null +++ b/lib/Model/ValidateIdentifierResponse.php @@ -0,0 +1,333 @@ + 'bool', + 'error' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'valid_identifier' => null, + 'error' => 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 = [ + 'valid_identifier' => 'ValidIdentifier', + 'error' => 'Error' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'valid_identifier' => 'setValidIdentifier', + 'error' => 'setError' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'valid_identifier' => 'getValidIdentifier', + 'error' => 'getError' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization 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_identifier'] = isset($data['valid_identifier']) ? $data['valid_identifier'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : 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_identifier + * + * @return bool + */ + public function getValidIdentifier() + { + return $this->container['valid_identifier']; + } + + /** + * Sets valid_identifier + * + * @param bool $valid_identifier True if the input identifier is valid, false otherwise + * + * @return $this + */ + public function setValidIdentifier($valid_identifier) + { + $this->container['valid_identifier'] = $valid_identifier; + + return $this; + } + + /** + * Gets error + * + * @return string + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string $error Resulting error from the identifier validation; possible errors are: \"InputIsEmpty\", \"ContainsWhitespace\", \"ContainsNumbers\", \"ContainsHyphen\", \"ContainsUnderscore\", \"ContainsPeriod\", \"TooShort\", \"TooLong\", \"ContainsSpecialCharacters\" + * + * @return $this + */ + public function setError($error) + { + $this->container['error'] = $error; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_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/ValidateUrlRequestFull.php b/lib/Model/ValidateUrlRequestFull.php new file mode 100644 index 0000000..d138434 --- /dev/null +++ b/lib/Model/ValidateUrlRequestFull.php @@ -0,0 +1,303 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'url' => 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 = [ + 'url' => 'URL' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization 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['url'] = isset($data['url']) ? $data['url'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * 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 url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url URL to validate + * + * @return $this + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ValidateUrlRequestSyntaxOnly.php b/lib/Model/ValidateUrlRequestSyntaxOnly.php index e0a30f6..29af95c 100644 --- a/lib/Model/ValidateUrlRequestSyntaxOnly.php +++ b/lib/Model/ValidateUrlRequestSyntaxOnly.php @@ -219,7 +219,7 @@ public function getUrl() /** * Sets url * - * @param string $url url + * @param string $url URL to validate * * @return $this */ diff --git a/lib/Model/ValidateUrlResponseFull.php b/lib/Model/ValidateUrlResponseFull.php new file mode 100644 index 0000000..5ba9565 --- /dev/null +++ b/lib/Model/ValidateUrlResponseFull.php @@ -0,0 +1,423 @@ + 'bool', + 'valid_syntax' => 'bool', + 'valid_domain' => 'bool', + 'valid_endpoint' => 'bool', + 'well_formed_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'valid_url' => null, + 'valid_syntax' => null, + 'valid_domain' => null, + 'valid_endpoint' => null, + 'well_formed_url' => 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 = [ + 'valid_url' => 'ValidURL', + 'valid_syntax' => 'Valid_Syntax', + 'valid_domain' => 'Valid_Domain', + 'valid_endpoint' => 'Valid_Endpoint', + 'well_formed_url' => 'WellFormedURL' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'valid_url' => 'setValidUrl', + 'valid_syntax' => 'setValidSyntax', + 'valid_domain' => 'setValidDomain', + 'valid_endpoint' => 'setValidEndpoint', + 'well_formed_url' => 'setWellFormedUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'valid_url' => 'getValidUrl', + 'valid_syntax' => 'getValidSyntax', + 'valid_domain' => 'getValidDomain', + 'valid_endpoint' => 'getValidEndpoint', + 'well_formed_url' => 'getWellFormedUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization 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_url'] = isset($data['valid_url']) ? $data['valid_url'] : null; + $this->container['valid_syntax'] = isset($data['valid_syntax']) ? $data['valid_syntax'] : null; + $this->container['valid_domain'] = isset($data['valid_domain']) ? $data['valid_domain'] : null; + $this->container['valid_endpoint'] = isset($data['valid_endpoint']) ? $data['valid_endpoint'] : null; + $this->container['well_formed_url'] = isset($data['well_formed_url']) ? $data['well_formed_url'] : 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_url + * + * @return bool + */ + public function getValidUrl() + { + return $this->container['valid_url']; + } + + /** + * Sets valid_url + * + * @param bool $valid_url True if the URL has valid syntax, a valid domain, a valid endpoint, and passes virus scan checks; false otherwise + * + * @return $this + */ + public function setValidUrl($valid_url) + { + $this->container['valid_url'] = $valid_url; + + return $this; + } + + /** + * Gets valid_syntax + * + * @return bool + */ + public function getValidSyntax() + { + return $this->container['valid_syntax']; + } + + /** + * Sets valid_syntax + * + * @param bool $valid_syntax True if the URL has valid syntax, false otherwise + * + * @return $this + */ + public function setValidSyntax($valid_syntax) + { + $this->container['valid_syntax'] = $valid_syntax; + + return $this; + } + + /** + * Gets valid_domain + * + * @return bool + */ + public function getValidDomain() + { + return $this->container['valid_domain']; + } + + /** + * Sets valid_domain + * + * @param bool $valid_domain True if the domain name is valid and exists, false otherwise + * + * @return $this + */ + public function setValidDomain($valid_domain) + { + $this->container['valid_domain'] = $valid_domain; + + return $this; + } + + /** + * Gets valid_endpoint + * + * @return bool + */ + public function getValidEndpoint() + { + return $this->container['valid_endpoint']; + } + + /** + * Sets valid_endpoint + * + * @param bool $valid_endpoint True if the endpoint is up and responsive and passes a virus scan check, false otherwise + * + * @return $this + */ + public function setValidEndpoint($valid_endpoint) + { + $this->container['valid_endpoint'] = $valid_endpoint; + + return $this; + } + + /** + * Gets well_formed_url + * + * @return string + */ + public function getWellFormedUrl() + { + return $this->container['well_formed_url']; + } + + /** + * Sets well_formed_url + * + * @param string $well_formed_url Well-formed version of the URL + * + * @return $this + */ + public function setWellFormedUrl($well_formed_url) + { + $this->container['well_formed_url'] = $well_formed_url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ValidateUrlResponseSyntaxOnly.php b/lib/Model/ValidateUrlResponseSyntaxOnly.php index ff6a195..6facaf1 100644 --- a/lib/Model/ValidateUrlResponseSyntaxOnly.php +++ b/lib/Model/ValidateUrlResponseSyntaxOnly.php @@ -36,7 +36,7 @@ * ValidateUrlResponseSyntaxOnly Class Doc Comment * * @category Class - * @description Result of validating a URL + * @description Result of validating a URL with syntax only * @package Swagger\Client * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen diff --git a/lib/Model/VatLookupRequest.php b/lib/Model/VatLookupRequest.php index 898d25a..be4b66f 100644 --- a/lib/Model/VatLookupRequest.php +++ b/lib/Model/VatLookupRequest.php @@ -219,7 +219,7 @@ public function getVatCode() /** * Sets vat_code * - * @param string $vat_code vat_code + * @param string $vat_code VAT code to lookup; example \"CZ25123891\" * * @return $this */ diff --git a/lib/Model/VatLookupResponse.php b/lib/Model/VatLookupResponse.php index a0cf0be..3a5a119 100644 --- a/lib/Model/VatLookupResponse.php +++ b/lib/Model/VatLookupResponse.php @@ -242,7 +242,7 @@ public function getCountryCode() /** * Sets country_code * - * @param string $country_code country_code + * @param string $country_code Two-letter country code * * @return $this */ @@ -266,7 +266,7 @@ public function getVatNumber() /** * Sets vat_number * - * @param string $vat_number vat_number + * @param string $vat_number VAT number * * @return $this */ @@ -290,7 +290,7 @@ public function getIsValid() /** * Sets is_valid * - * @param bool $is_valid is_valid + * @param bool $is_valid True if the VAT code is valid, false otherwise * * @return $this */ @@ -314,7 +314,7 @@ public function getBusinessName() /** * Sets business_name * - * @param string $business_name business_name + * @param string $business_name Name of the business * * @return $this */ @@ -338,7 +338,7 @@ public function getBusinessAddress() /** * Sets business_address * - * @param string $business_address business_address + * @param string $business_address Business address * * @return $this */ diff --git a/packageconfig.json b/packageconfig.json index c95a07a..2be3874 100644 --- a/packageconfig.json +++ b/packageconfig.json @@ -1,5 +1,5 @@ { - "artifactVersion": "1.4.9", + "artifactVersion": "1.5.1", "gitUserId": "Cloudmersive", "gitRepoId": "Cloudmersive.APIClient.PHP.Validate", "composerVendorName": "cloudmersive", diff --git a/test/Api/DomainApiTest.php b/test/Api/DomainApiTest.php index fd7d79d..d06ebdc 100644 --- a/test/Api/DomainApiTest.php +++ b/test/Api/DomainApiTest.php @@ -91,6 +91,16 @@ public function testDomainPost() { } + /** + * Test case for domainUrlFull + * + * Validate a URL fully. + * + */ + public function testDomainUrlFull() + { + } + /** * Test case for domainUrlSyntaxOnly * diff --git a/test/Api/NameApiTest.php b/test/Api/NameApiTest.php index 4f708d3..769c5c3 100644 --- a/test/Api/NameApiTest.php +++ b/test/Api/NameApiTest.php @@ -81,6 +81,16 @@ public function testNameGetGender() { } + /** + * Test case for nameIdentifier + * + * Validate a code identifier. + * + */ + public function testNameIdentifier() + { + } + /** * Test case for nameValidateFirstName * diff --git a/test/Api/UserAgentApiTest.php b/test/Api/UserAgentApiTest.php new file mode 100644 index 0000000..819af3a --- /dev/null +++ b/test/Api/UserAgentApiTest.php @@ -0,0 +1,83 @@ +