Skip to content

Commit

Permalink
1.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Cloudmersive committed Sep 20, 2020
1 parent 5e2309a commit 58a309f
Show file tree
Hide file tree
Showing 11 changed files with 736 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The validation APIs help you validate data. Check if an E-mail address is real.
[Cloudmersive Validation API](https://www.cloudmersive.com/validate-api) provides data validation capabilities for validating email addresses, phone numbers, IP addresses, and many other types of business data.

- API version: v1
- Package version: 1.6.3
- Package version: 1.6.4


## Requirements
Expand Down Expand Up @@ -99,6 +99,7 @@ Class | Method | HTTP request | Description
*AddressApi* | [**addressValidateState**](docs/Api/AddressApi.md#addressvalidatestate) | **POST** /validate/address/state | Validate a state or province, name or abbreviation, get location information about it
*DomainApi* | [**domainCheck**](docs/Api/DomainApi.md#domaincheck) | **POST** /validate/domain/check | Validate a domain name
*DomainApi* | [**domainPost**](docs/Api/DomainApi.md#domainpost) | **POST** /validate/domain/whois | Get WHOIS information for a domain
*DomainApi* | [**domainQualityScore**](docs/Api/DomainApi.md#domainqualityscore) | **POST** /validate/domain/quality-score | Validate a domain name's quality score
*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
Expand All @@ -125,6 +126,7 @@ Class | Method | HTTP request | Description
- [CheckResponse](docs/Model/CheckResponse.md)
- [CountryDetails](docs/Model/CountryDetails.md)
- [CountryListResult](docs/Model/CountryListResult.md)
- [DomainQualityResponse](docs/Model/DomainQualityResponse.md)
- [FirstNameValidationRequest](docs/Model/FirstNameValidationRequest.md)
- [FirstNameValidationResponse](docs/Model/FirstNameValidationResponse.md)
- [FullEmailValidationResponse](docs/Model/FullEmailValidationResponse.md)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cloudmersive/cloudmersive_validate_api_client",
"version": "1.6.3",
"version": "1.6.4",
"description": "",
"keywords": [
"swagger",
Expand Down
2 changes: 2 additions & 0 deletions debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[0919/182314.318:ERROR:registration_protocol_win.cc(103)] CreateFile: The system cannot find the file specified. (0x2)
[0919/182314.351:ERROR:registration_protocol_win.cc(103)] CreateFile: The system cannot find the file specified. (0x2)
56 changes: 56 additions & 0 deletions docs/Api/DomainApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
[**domainQualityScore**](DomainApi.md#domainQualityScore) | **POST** /validate/domain/quality-score | Validate a domain name's quality score
[**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

Expand Down Expand Up @@ -120,6 +121,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)

# **domainQualityScore**
> \Swagger\Client\Model\DomainQualityResponse domainQualityScore($domain)
Validate a domain name's quality score

Check the quality of a domain name. Higher quality scores indicate more trust and authority in the domain name.

### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: Apikey
$config = Swagger\Client\Configuration::getDefaultConfiguration()->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
);
$domain = "domain_example"; // string | Domain name to check, for example \"cloudmersive.com\".

try {
$result = $apiInstance->domainQualityScore($domain);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DomainApi->domainQualityScore: ', $e->getMessage(), PHP_EOL;
}
?>
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**domain** | **string**| Domain name to check, for example \&quot;cloudmersive.com\&quot;. |

### Return type

[**\Swagger\Client\Model\DomainQualityResponse**](../Model/DomainQualityResponse.md)

### Authorization

[Apikey](../../README.md#Apikey)

### HTTP request headers

- **Content-Type**: text/javascript, application/json, text/json
- **Accept**: application/json, text/json, application/xml, text/xml

[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

# **domainUrlFull**
> \Swagger\Client\Model\ValidateUrlResponseFull domainUrlFull($request)
Expand Down
10 changes: 10 additions & 0 deletions docs/Model/DomainQualityResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# DomainQualityResponse

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**domain_quality_score** | **double** | The quality score of the domain name; possible values are 0.0 to 10.0 with 10.0 being the highest and 0.0 being the lowest quality. | [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)


262 changes: 262 additions & 0 deletions lib/Api/DomainApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,268 @@ protected function domainPostRequest($domain)



// body params
$_tempBody = null;
if (isset($domain)) {
$_tempBody = $domain;
}

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'],
['text/javascript', 'application/json', 'text/json']
);
}

// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
$httpBody = $_tempBody;
// \stdClass has no __toString(), so we should encode it manually
if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($httpBody);
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);

} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);

} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}

// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('Apikey');
if ($apiKey !== null) {
$headers['Apikey'] = $apiKey;
}

$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}

$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);

$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'POST',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}

/**
* Operation domainQualityScore
*
* Validate a domain name's quality score
*
* @param string $domain Domain name to check, for example \&quot;cloudmersive.com\&quot;. (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \Swagger\Client\Model\DomainQualityResponse
*/
public function domainQualityScore($domain)
{
list($response) = $this->domainQualityScoreWithHttpInfo($domain);
return $response;
}

/**
* Operation domainQualityScoreWithHttpInfo
*
* Validate a domain name's quality score
*
* @param string $domain Domain name to check, for example \&quot;cloudmersive.com\&quot;. (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \Swagger\Client\Model\DomainQualityResponse, HTTP status code, HTTP response headers (array of strings)
*/
public function domainQualityScoreWithHttpInfo($domain)
{
$returnType = '\Swagger\Client\Model\DomainQualityResponse';
$request = $this->domainQualityScoreRequest($domain);

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\DomainQualityResponse',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
}

/**
* Operation domainQualityScoreAsync
*
* Validate a domain name's quality score
*
* @param string $domain Domain name to check, for example \&quot;cloudmersive.com\&quot;. (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function domainQualityScoreAsync($domain)
{
return $this->domainQualityScoreAsyncWithHttpInfo($domain)
->then(
function ($response) {
return $response[0];
}
);
}

/**
* Operation domainQualityScoreAsyncWithHttpInfo
*
* Validate a domain name's quality score
*
* @param string $domain Domain name to check, for example \&quot;cloudmersive.com\&quot;. (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function domainQualityScoreAsyncWithHttpInfo($domain)
{
$returnType = '\Swagger\Client\Model\DomainQualityResponse';
$request = $this->domainQualityScoreRequest($domain);

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 'domainQualityScore'
*
* @param string $domain Domain name to check, for example \&quot;cloudmersive.com\&quot;. (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
protected function domainQualityScoreRequest($domain)
{
// verify the required parameter 'domain' is set
if ($domain === null) {
throw new \InvalidArgumentException(
'Missing the required parameter $domain when calling domainQualityScore'
);
}

$resourcePath = '/validate/domain/quality-score';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;



// body params
$_tempBody = null;
if (isset($domain)) {
Expand Down
Loading

0 comments on commit 58a309f

Please sign in to comment.