Skip to content

Commit

Permalink
1.6.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Cloudmersive committed Dec 26, 2020
1 parent a9b61d4 commit 409e504
Show file tree
Hide file tree
Showing 10 changed files with 772 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.8
- Package version: 1.6.9


## Requirements
Expand Down Expand Up @@ -116,6 +116,7 @@ Class | Method | HTTP request | Description
*IPAddressApi* | [**iPAddressIsThreat**](docs/Api/IPAddressApi.md#ipaddressisthreat) | **POST** /validate/ip/is-threat | Check if IP address is a known threat
*IPAddressApi* | [**iPAddressIsTorNode**](docs/Api/IPAddressApi.md#ipaddressistornode) | **POST** /validate/ip/is-tor-node | Check if IP address is a Tor node server
*IPAddressApi* | [**iPAddressPost**](docs/Api/IPAddressApi.md#ipaddresspost) | **POST** /validate/ip/geolocate | Geolocate an IP address
*IPAddressApi* | [**iPAddressReverseDomainLookup**](docs/Api/IPAddressApi.md#ipaddressreversedomainlookup) | **POST** /validate/ip/reverse-domain-lookup | Perform a reverse domain name (DNS) lookup on an IP address
*LeadEnrichmentApi* | [**leadEnrichmentEnrichLead**](docs/Api/LeadEnrichmentApi.md#leadenrichmentenrichlead) | **POST** /validate/lead-enrichment/lead/enrich | Enrich an input lead with additional fields of data
*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
Expand Down Expand Up @@ -154,6 +155,7 @@ Class | Method | HTTP request | Description
- [GetPublicHolidaysRequest](docs/Model/GetPublicHolidaysRequest.md)
- [GetTimezonesRequest](docs/Model/GetTimezonesRequest.md)
- [GetTimezonesResponse](docs/Model/GetTimezonesResponse.md)
- [IPReverseDNSLookupResponse](docs/Model/IPReverseDNSLookupResponse.md)
- [IPThreatResponse](docs/Model/IPThreatResponse.md)
- [LastNameValidationRequest](docs/Model/LastNameValidationRequest.md)
- [LastNameValidationResponse](docs/Model/LastNameValidationResponse.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.8",
"version": "1.6.9",
"description": "",
"keywords": [
"swagger",
Expand Down
56 changes: 56 additions & 0 deletions docs/Api/IPAddressApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Method | HTTP request | Description
[**iPAddressIsThreat**](IPAddressApi.md#iPAddressIsThreat) | **POST** /validate/ip/is-threat | Check if IP address is a known threat
[**iPAddressIsTorNode**](IPAddressApi.md#iPAddressIsTorNode) | **POST** /validate/ip/is-tor-node | Check if IP address is a Tor node server
[**iPAddressPost**](IPAddressApi.md#iPAddressPost) | **POST** /validate/ip/geolocate | Geolocate an IP address
[**iPAddressReverseDomainLookup**](IPAddressApi.md#iPAddressReverseDomainLookup) | **POST** /validate/ip/reverse-domain-lookup | Perform a reverse domain name (DNS) lookup on an IP address


# **iPAddressGeolocateStreetAddress**
Expand Down Expand Up @@ -230,3 +231,58 @@ 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)

# **iPAddressReverseDomainLookup**
> \Swagger\Client\Model\IPReverseDNSLookupResponse iPAddressReverseDomainLookup($value)
Perform a reverse domain name (DNS) lookup on an IP address

Gets the domain name, if any, associated with the IP address.

### 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\IPAddressApi(
// 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
);
$value = "value_example"; // string | IP address to check, e.g. \"55.55.55.55\". The input is a string so be sure to enclose it in double-quotes.

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

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**value** | **string**| IP address to check, e.g. \&quot;55.55.55.55\&quot;. The input is a string so be sure to enclose it in double-quotes. |

### Return type

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

### Authorization

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

### HTTP request headers

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

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

11 changes: 11 additions & 0 deletions docs/Model/IPReverseDNSLookupResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# IPReverseDNSLookupResponse

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**successful** | **bool** | True if a domain was found, false otherwise | [optional]
**host_name** | **string** | Host name (fully-qualified) associated with the IP address, if any | [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/IPAddressApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,268 @@ protected function iPAddressPostRequest($value)



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

if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json', 'text/json', 'application/xml', 'text/xml']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json', 'text/json', 'application/xml', 'text/xml'],
['application/json', 'text/json']
);
}

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

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

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

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

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

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

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

/**
* Operation iPAddressReverseDomainLookup
*
* Perform a reverse domain name (DNS) lookup on an IP address
*
* @param string $value IP address to check, e.g. \&quot;55.55.55.55\&quot;. The input is a string so be sure to enclose it in double-quotes. (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \Swagger\Client\Model\IPReverseDNSLookupResponse
*/
public function iPAddressReverseDomainLookup($value)
{
list($response) = $this->iPAddressReverseDomainLookupWithHttpInfo($value);
return $response;
}

/**
* Operation iPAddressReverseDomainLookupWithHttpInfo
*
* Perform a reverse domain name (DNS) lookup on an IP address
*
* @param string $value IP address to check, e.g. \&quot;55.55.55.55\&quot;. The input is a string so be sure to enclose it in double-quotes. (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \Swagger\Client\Model\IPReverseDNSLookupResponse, HTTP status code, HTTP response headers (array of strings)
*/
public function iPAddressReverseDomainLookupWithHttpInfo($value)
{
$returnType = '\Swagger\Client\Model\IPReverseDNSLookupResponse';
$request = $this->iPAddressReverseDomainLookupRequest($value);

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

/**
* Operation iPAddressReverseDomainLookupAsync
*
* Perform a reverse domain name (DNS) lookup on an IP address
*
* @param string $value IP address to check, e.g. \&quot;55.55.55.55\&quot;. The input is a string so be sure to enclose it in double-quotes. (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function iPAddressReverseDomainLookupAsync($value)
{
return $this->iPAddressReverseDomainLookupAsyncWithHttpInfo($value)
->then(
function ($response) {
return $response[0];
}
);
}

/**
* Operation iPAddressReverseDomainLookupAsyncWithHttpInfo
*
* Perform a reverse domain name (DNS) lookup on an IP address
*
* @param string $value IP address to check, e.g. \&quot;55.55.55.55\&quot;. The input is a string so be sure to enclose it in double-quotes. (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function iPAddressReverseDomainLookupAsyncWithHttpInfo($value)
{
$returnType = '\Swagger\Client\Model\IPReverseDNSLookupResponse';
$request = $this->iPAddressReverseDomainLookupRequest($value);

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 'iPAddressReverseDomainLookup'
*
* @param string $value IP address to check, e.g. \&quot;55.55.55.55\&quot;. The input is a string so be sure to enclose it in double-quotes. (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
protected function iPAddressReverseDomainLookupRequest($value)
{
// verify the required parameter 'value' is set
if ($value === null) {
throw new \InvalidArgumentException(
'Missing the required parameter $value when calling iPAddressReverseDomainLookup'
);
}

$resourcePath = '/validate/ip/reverse-domain-lookup';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;



// body params
$_tempBody = null;
if (isset($value)) {
Expand Down
4 changes: 2 additions & 2 deletions lib/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class Configuration
*
* @var string
*/
protected $userAgent = 'Swagger-Codegen/1.6.8/php';
protected $userAgent = 'Swagger-Codegen/1.6.9/php';

/**
* Debug switch (default set to false)
Expand Down Expand Up @@ -397,7 +397,7 @@ public static function toDebugReport()
$report .= ' OS: ' . php_uname() . PHP_EOL;
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
$report .= ' OpenAPI Spec Version: v1' . PHP_EOL;
$report .= ' SDK Package Version: 1.6.8' . PHP_EOL;
$report .= ' SDK Package Version: 1.6.9' . PHP_EOL;
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;

return $report;
Expand Down
Loading

0 comments on commit 409e504

Please sign in to comment.