cloudmersive-validate-api-client 2.0.5 → 2.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e8e42d5d4ada91525c90549a9f477d4d30c88f411cc95ad0217b72f168debd6
4
- data.tar.gz: e3a67503f0e3f8a99ec743b0386a29f8fa4d8c6fd6bfdd2dd22a21bbbc299bd1
3
+ metadata.gz: a0afddbf6400d48260ea5c99acc2c03a7b76e6bd37c1a19cddb97daf8e3a3e6a
4
+ data.tar.gz: d094111e98f6091989a80180174b2cf908a247f7852173f9d61773323826d973
5
5
  SHA512:
6
- metadata.gz: 56eedda381e6cfdbcf6301f004862a4de5448cc18abb6b9db66b3dfc2cb242dd230d669ab15f231b512624ca16575f607f05794773e9179821da8b34cd5caac4
7
- data.tar.gz: c22901807d9c125630ec5d69e307ff6dd75dcddc6e4d19e6779eed326b47739c1c2bf2bbd81b715c03f5c7b4c64706839266088bd2e3dd176d693360ac43a4b0
6
+ metadata.gz: cdb3bdccb0f7955cb1467a0262323b5663fed8621c93df3d9478fed46bfe99932333b0033fe50f19f15fcbf3240322536ef0827fb61f5bcd54e1c2d505d4e4de
7
+ data.tar.gz: 006bafc64a35eb5616dbe6ed69e91822407d1a0aac043190952854d1436733f87517d68fe06dfbbc1bad5356f5688a6203840fb572b0a664ad8e97b9e328aedd
data/README.md CHANGED
@@ -7,7 +7,7 @@ The validation APIs help you validate data. Check if an E-mail address is real.
7
7
  This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
8
 
9
9
  - API version: v1
10
- - Package version: 2.0.5
10
+ - Package version: 2.0.6
11
11
  - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
12
 
13
13
  ## Installation
@@ -23,15 +23,15 @@ gem build cloudmersive-validate-api-client.gemspec
23
23
  Then either install the gem locally:
24
24
 
25
25
  ```shell
26
- gem install ./cloudmersive-validate-api-client-2.0.5.gem
26
+ gem install ./cloudmersive-validate-api-client-2.0.6.gem
27
27
  ```
28
- (for development, run `gem install --dev ./cloudmersive-validate-api-client-2.0.5.gem` to install the development dependencies)
28
+ (for development, run `gem install --dev ./cloudmersive-validate-api-client-2.0.6.gem` to install the development dependencies)
29
29
 
30
30
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
31
31
 
32
32
  Finally add this to the Gemfile:
33
33
 
34
- gem 'cloudmersive-validate-api-client', '~> 2.0.5'
34
+ gem 'cloudmersive-validate-api-client', '~> 2.0.6'
35
35
 
36
36
  ### Install from Git
37
37
 
@@ -99,6 +99,7 @@ Class | Method | HTTP request | Description
99
99
  *CloudmersiveValidateApiClient::EmailApi* | [**email_address_get_servers**](docs/EmailApi.md#email_address_get_servers) | **POST** /validate/email/address/servers | Partially check whether an email address is valid
100
100
  *CloudmersiveValidateApiClient::EmailApi* | [**email_full_validation**](docs/EmailApi.md#email_full_validation) | **POST** /validate/email/address/full | Fully validate an email address
101
101
  *CloudmersiveValidateApiClient::EmailApi* | [**email_post**](docs/EmailApi.md#email_post) | **POST** /validate/email/address/syntaxOnly | Validate email adddress for syntactic correctness only
102
+ *CloudmersiveValidateApiClient::IPAddressApi* | [**i_p_address_is_threat**](docs/IPAddressApi.md#i_p_address_is_threat) | **POST** /validate/ip/is-threat | Check if IP address is a known threat
102
103
  *CloudmersiveValidateApiClient::IPAddressApi* | [**i_p_address_is_tor_node**](docs/IPAddressApi.md#i_p_address_is_tor_node) | **POST** /validate/ip/is-tor-node | Check if IP address is a Tor node server
103
104
  *CloudmersiveValidateApiClient::IPAddressApi* | [**i_p_address_post**](docs/IPAddressApi.md#i_p_address_post) | **POST** /validate/ip/geolocate | Geolocate an IP address
104
105
  *CloudmersiveValidateApiClient::LeadEnrichmentApi* | [**lead_enrichment_enrich_lead**](docs/LeadEnrichmentApi.md#lead_enrichment_enrich_lead) | **POST** /validate/lead-enrichment/lead/enrich | Enrich an input lead with additional fields of data
@@ -129,6 +130,7 @@ Class | Method | HTTP request | Description
129
130
  - [CloudmersiveValidateApiClient::GetGenderResponse](docs/GetGenderResponse.md)
130
131
  - [CloudmersiveValidateApiClient::GetTimezonesRequest](docs/GetTimezonesRequest.md)
131
132
  - [CloudmersiveValidateApiClient::GetTimezonesResponse](docs/GetTimezonesResponse.md)
133
+ - [CloudmersiveValidateApiClient::IPThreatResponse](docs/IPThreatResponse.md)
132
134
  - [CloudmersiveValidateApiClient::LastNameValidationRequest](docs/LastNameValidationRequest.md)
133
135
  - [CloudmersiveValidateApiClient::LastNameValidationResponse](docs/LastNameValidationResponse.md)
134
136
  - [CloudmersiveValidateApiClient::LeadEnrichmentRequest](docs/LeadEnrichmentRequest.md)
@@ -284,7 +284,7 @@ Name | Type | Description | Notes
284
284
 
285
285
  Validate a street address
286
286
 
287
- Determines if an input structured street address is valid or invalid. If the address is valid, also returns the latitude and longitude of the address.
287
+ Determines if an input structured street address is valid or invalid. If the address is valid, also returns the latitude and longitude of the address. Supports all major international addresses.
288
288
 
289
289
  ### Example
290
290
  ```ruby
@@ -338,7 +338,7 @@ Name | Type | Description | Notes
338
338
 
339
339
  Validate a City and State/Province combination, get location information about it
340
340
 
341
- Checks if the input city and state name or code is valid, and returns information about it such as normalized City name, State name and more.
341
+ Checks if the input city and state name or code is valid, and returns information about it such as normalized City name, State name and more. Supports all major international addresses.
342
342
 
343
343
  ### Example
344
344
  ```ruby
@@ -392,7 +392,7 @@ Name | Type | Description | Notes
392
392
 
393
393
  Validate a postal code, get location information about it
394
394
 
395
- Checks if the input postal code is valid, and returns information about it such as City, State and more.
395
+ Checks if the input postal code is valid, and returns information about it such as City, State and more. Supports all major countries.
396
396
 
397
397
  ### Example
398
398
  ```ruby
@@ -446,7 +446,7 @@ Name | Type | Description | Notes
446
446
 
447
447
  Validate a state or province, name or abbreviation, get location information about it
448
448
 
449
- Checks if the input state name or code is valid, and returns information about it such as normalized State name and more.
449
+ Checks if the input state name or code is valid, and returns information about it such as normalized State name and more. Supports all major countries.
450
450
 
451
451
  ### Example
452
452
  ```ruby
@@ -4,10 +4,65 @@ All URIs are relative to *https://api.cloudmersive.com*
4
4
 
5
5
  Method | HTTP request | Description
6
6
  ------------- | ------------- | -------------
7
+ [**i_p_address_is_threat**](IPAddressApi.md#i_p_address_is_threat) | **POST** /validate/ip/is-threat | Check if IP address is a known threat
7
8
  [**i_p_address_is_tor_node**](IPAddressApi.md#i_p_address_is_tor_node) | **POST** /validate/ip/is-tor-node | Check if IP address is a Tor node server
8
9
  [**i_p_address_post**](IPAddressApi.md#i_p_address_post) | **POST** /validate/ip/geolocate | Geolocate an IP address
9
10
 
10
11
 
12
+ # **i_p_address_is_threat**
13
+ > IPThreatResponse i_p_address_is_threat(value)
14
+
15
+ Check if IP address is a known threat
16
+
17
+ Check if the input IP address is a known threat IP address. Checks against known bad IPs, botnets, compromised servers, and other lists of threats.
18
+
19
+ ### Example
20
+ ```ruby
21
+ # load the gem
22
+ require 'cloudmersive-validate-api-client'
23
+ # setup authorization
24
+ CloudmersiveValidateApiClient.configure do |config|
25
+ # Configure API key authorization: Apikey
26
+ config.api_key['Apikey'] = 'YOUR API KEY'
27
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
28
+ #config.api_key_prefix['Apikey'] = 'Bearer'
29
+ end
30
+
31
+ api_instance = CloudmersiveValidateApiClient::IPAddressApi.new
32
+
33
+ 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.
34
+
35
+
36
+ begin
37
+ #Check if IP address is a known threat
38
+ result = api_instance.i_p_address_is_threat(value)
39
+ p result
40
+ rescue CloudmersiveValidateApiClient::ApiError => e
41
+ puts "Exception when calling IPAddressApi->i_p_address_is_threat: #{e}"
42
+ end
43
+ ```
44
+
45
+ ### Parameters
46
+
47
+ Name | Type | Description | Notes
48
+ ------------- | ------------- | ------------- | -------------
49
+ **value** | **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. |
50
+
51
+ ### Return type
52
+
53
+ [**IPThreatResponse**](IPThreatResponse.md)
54
+
55
+ ### Authorization
56
+
57
+ [Apikey](../README.md#Apikey)
58
+
59
+ ### HTTP request headers
60
+
61
+ - **Content-Type**: text/javascript, application/json, text/json
62
+ - **Accept**: application/json, text/json, application/xml, text/xml
63
+
64
+
65
+
11
66
  # **i_p_address_is_tor_node**
12
67
  > TorNodeResponse i_p_address_is_tor_node(value)
13
68
 
@@ -0,0 +1,9 @@
1
+ # CloudmersiveValidateApiClient::IPThreatResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **is_threat** | **BOOLEAN** | True if the input IP address is a threat, false otherwise | [optional]
7
+ **threat_type** | **String** | Specifies the type of IP threat; possible values include Blocklist, Botnet, WebBot | [optional]
8
+
9
+
@@ -32,6 +32,7 @@ require 'cloudmersive-validate-api-client/models/get_gender_request'
32
32
  require 'cloudmersive-validate-api-client/models/get_gender_response'
33
33
  require 'cloudmersive-validate-api-client/models/get_timezones_request'
34
34
  require 'cloudmersive-validate-api-client/models/get_timezones_response'
35
+ require 'cloudmersive-validate-api-client/models/ip_threat_response'
35
36
  require 'cloudmersive-validate-api-client/models/last_name_validation_request'
36
37
  require 'cloudmersive-validate-api-client/models/last_name_validation_response'
37
38
  require 'cloudmersive-validate-api-client/models/lead_enrichment_request'
@@ -282,7 +282,7 @@ module CloudmersiveValidateApiClient
282
282
  return data, status_code, headers
283
283
  end
284
284
  # Validate a street address
285
- # Determines if an input structured street address is valid or invalid. If the address is valid, also returns the latitude and longitude of the address.
285
+ # Determines if an input structured street address is valid or invalid. If the address is valid, also returns the latitude and longitude of the address. Supports all major international addresses.
286
286
  # @param input Input parse request
287
287
  # @param [Hash] opts the optional parameters
288
288
  # @return [ValidateAddressResponse]
@@ -292,7 +292,7 @@ module CloudmersiveValidateApiClient
292
292
  end
293
293
 
294
294
  # Validate a street address
295
- # Determines if an input structured street address is valid or invalid. If the address is valid, also returns the latitude and longitude of the address.
295
+ # Determines if an input structured street address is valid or invalid. If the address is valid, also returns the latitude and longitude of the address. Supports all major international addresses.
296
296
  # @param input Input parse request
297
297
  # @param [Hash] opts the optional parameters
298
298
  # @return [Array<(ValidateAddressResponse, Fixnum, Hash)>] ValidateAddressResponse data, response status code and response headers
@@ -336,7 +336,7 @@ module CloudmersiveValidateApiClient
336
336
  return data, status_code, headers
337
337
  end
338
338
  # Validate a City and State/Province combination, get location information about it
339
- # Checks if the input city and state name or code is valid, and returns information about it such as normalized City name, State name and more.
339
+ # Checks if the input city and state name or code is valid, and returns information about it such as normalized City name, State name and more. Supports all major international addresses.
340
340
  # @param input Input parse request
341
341
  # @param [Hash] opts the optional parameters
342
342
  # @return [ValidateCityResponse]
@@ -346,7 +346,7 @@ module CloudmersiveValidateApiClient
346
346
  end
347
347
 
348
348
  # Validate a City and State/Province combination, get location information about it
349
- # Checks if the input city and state name or code is valid, and returns information about it such as normalized City name, State name and more.
349
+ # Checks if the input city and state name or code is valid, and returns information about it such as normalized City name, State name and more. Supports all major international addresses.
350
350
  # @param input Input parse request
351
351
  # @param [Hash] opts the optional parameters
352
352
  # @return [Array<(ValidateCityResponse, Fixnum, Hash)>] ValidateCityResponse data, response status code and response headers
@@ -390,7 +390,7 @@ module CloudmersiveValidateApiClient
390
390
  return data, status_code, headers
391
391
  end
392
392
  # Validate a postal code, get location information about it
393
- # Checks if the input postal code is valid, and returns information about it such as City, State and more.
393
+ # Checks if the input postal code is valid, and returns information about it such as City, State and more. Supports all major countries.
394
394
  # @param input Input parse request
395
395
  # @param [Hash] opts the optional parameters
396
396
  # @return [ValidatePostalCodeResponse]
@@ -400,7 +400,7 @@ module CloudmersiveValidateApiClient
400
400
  end
401
401
 
402
402
  # Validate a postal code, get location information about it
403
- # Checks if the input postal code is valid, and returns information about it such as City, State and more.
403
+ # Checks if the input postal code is valid, and returns information about it such as City, State and more. Supports all major countries.
404
404
  # @param input Input parse request
405
405
  # @param [Hash] opts the optional parameters
406
406
  # @return [Array<(ValidatePostalCodeResponse, Fixnum, Hash)>] ValidatePostalCodeResponse data, response status code and response headers
@@ -444,7 +444,7 @@ module CloudmersiveValidateApiClient
444
444
  return data, status_code, headers
445
445
  end
446
446
  # Validate a state or province, name or abbreviation, get location information about it
447
- # Checks if the input state name or code is valid, and returns information about it such as normalized State name and more.
447
+ # Checks if the input state name or code is valid, and returns information about it such as normalized State name and more. Supports all major countries.
448
448
  # @param input Input parse request
449
449
  # @param [Hash] opts the optional parameters
450
450
  # @return [ValidateStateResponse]
@@ -454,7 +454,7 @@ module CloudmersiveValidateApiClient
454
454
  end
455
455
 
456
456
  # Validate a state or province, name or abbreviation, get location information about it
457
- # Checks if the input state name or code is valid, and returns information about it such as normalized State name and more.
457
+ # Checks if the input state name or code is valid, and returns information about it such as normalized State name and more. Supports all major countries.
458
458
  # @param input Input parse request
459
459
  # @param [Hash] opts the optional parameters
460
460
  # @return [Array<(ValidateStateResponse, Fixnum, Hash)>] ValidateStateResponse data, response status code and response headers
@@ -19,6 +19,60 @@ module CloudmersiveValidateApiClient
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Check if IP address is a known threat
23
+ # Check if the input IP address is a known threat IP address. Checks against known bad IPs, botnets, compromised servers, and other lists of threats.
24
+ # @param 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.
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [IPThreatResponse]
27
+ def i_p_address_is_threat(value, opts = {})
28
+ data, _status_code, _headers = i_p_address_is_threat_with_http_info(value, opts)
29
+ data
30
+ end
31
+
32
+ # Check if IP address is a known threat
33
+ # Check if the input IP address is a known threat IP address. Checks against known bad IPs, botnets, compromised servers, and other lists of threats.
34
+ # @param 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.
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(IPThreatResponse, Fixnum, Hash)>] IPThreatResponse data, response status code and response headers
37
+ def i_p_address_is_threat_with_http_info(value, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: IPAddressApi.i_p_address_is_threat ...'
40
+ end
41
+ # verify the required parameter 'value' is set
42
+ if @api_client.config.client_side_validation && value.nil?
43
+ fail ArgumentError, "Missing the required parameter 'value' when calling IPAddressApi.i_p_address_is_threat"
44
+ end
45
+ # resource path
46
+ local_var_path = '/validate/ip/is-threat'
47
+
48
+ # query parameters
49
+ query_params = {}
50
+
51
+ # header parameters
52
+ header_params = {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
55
+ # HTTP header 'Content-Type'
56
+ header_params['Content-Type'] = @api_client.select_header_content_type(['text/javascript', 'application/json', 'text/json'])
57
+
58
+ # form parameters
59
+ form_params = {}
60
+
61
+ # http body (model)
62
+ post_body = @api_client.object_to_http_body(value)
63
+ auth_names = ['Apikey']
64
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
65
+ :header_params => header_params,
66
+ :query_params => query_params,
67
+ :form_params => form_params,
68
+ :body => post_body,
69
+ :auth_names => auth_names,
70
+ :return_type => 'IPThreatResponse')
71
+ if @api_client.config.debugging
72
+ @api_client.config.logger.debug "API called: IPAddressApi#i_p_address_is_threat\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
73
+ end
74
+ return data, status_code, headers
75
+ end
22
76
  # Check if IP address is a Tor node server
23
77
  # Check if the input IP address is a Tor exit node server. Tor servers are a type of privacy-preserving technology that can hide the original IP address who makes a request.
24
78
  # @param 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.
@@ -0,0 +1,196 @@
1
+ =begin
2
+ #validateapi
3
+
4
+ #The validation APIs help you validate data. Check if an E-mail address is real. Check if a domain is real. Check up on an IP address, and even where it is located. All this and much more is available in the validation API.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveValidateApiClient
16
+ # Result of performing a IP threat check on an IP address
17
+ class IPThreatResponse
18
+ # True if the input IP address is a threat, false otherwise
19
+ attr_accessor :is_threat
20
+
21
+ # Specifies the type of IP threat; possible values include Blocklist, Botnet, WebBot
22
+ attr_accessor :threat_type
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'is_threat' => :'IsThreat',
28
+ :'threat_type' => :'ThreatType'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ :'is_threat' => :'BOOLEAN',
36
+ :'threat_type' => :'String'
37
+ }
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ return unless attributes.is_a?(Hash)
44
+
45
+ # convert string to symbol for hash key
46
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
47
+
48
+ if attributes.has_key?(:'IsThreat')
49
+ self.is_threat = attributes[:'IsThreat']
50
+ end
51
+
52
+ if attributes.has_key?(:'ThreatType')
53
+ self.threat_type = attributes[:'ThreatType']
54
+ end
55
+ end
56
+
57
+ # Show invalid properties with the reasons. Usually used together with valid?
58
+ # @return Array for valid properties with the reasons
59
+ def list_invalid_properties
60
+ invalid_properties = Array.new
61
+ invalid_properties
62
+ end
63
+
64
+ # Check to see if the all the properties in the model are valid
65
+ # @return true if the model is valid
66
+ def valid?
67
+ true
68
+ end
69
+
70
+ # Checks equality by comparing each attribute.
71
+ # @param [Object] Object to be compared
72
+ def ==(o)
73
+ return true if self.equal?(o)
74
+ self.class == o.class &&
75
+ is_threat == o.is_threat &&
76
+ threat_type == o.threat_type
77
+ end
78
+
79
+ # @see the `==` method
80
+ # @param [Object] Object to be compared
81
+ def eql?(o)
82
+ self == o
83
+ end
84
+
85
+ # Calculates hash code according to all attributes.
86
+ # @return [Fixnum] Hash code
87
+ def hash
88
+ [is_threat, threat_type].hash
89
+ end
90
+
91
+ # Builds the object from hash
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ # @return [Object] Returns the model itself
94
+ def build_from_hash(attributes)
95
+ return nil unless attributes.is_a?(Hash)
96
+ self.class.swagger_types.each_pair do |key, type|
97
+ if type =~ /\AArray<(.*)>/i
98
+ # check to ensure the input is an array given that the attribute
99
+ # is documented as an array but the input is not
100
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
101
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
102
+ end
103
+ elsif !attributes[self.class.attribute_map[key]].nil?
104
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
105
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
106
+ end
107
+
108
+ self
109
+ end
110
+
111
+ # Deserializes the data based on type
112
+ # @param string type Data type
113
+ # @param string value Value to be deserialized
114
+ # @return [Object] Deserialized data
115
+ def _deserialize(type, value)
116
+ case type.to_sym
117
+ when :DateTime
118
+ DateTime.parse(value)
119
+ when :Date
120
+ Date.parse(value)
121
+ when :String
122
+ value.to_s
123
+ when :Integer
124
+ value.to_i
125
+ when :Float
126
+ value.to_f
127
+ when :BOOLEAN
128
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
129
+ true
130
+ else
131
+ false
132
+ end
133
+ when :Object
134
+ # generic object (usually a Hash), return directly
135
+ value
136
+ when /\AArray<(?<inner_type>.+)>\z/
137
+ inner_type = Regexp.last_match[:inner_type]
138
+ value.map { |v| _deserialize(inner_type, v) }
139
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
140
+ k_type = Regexp.last_match[:k_type]
141
+ v_type = Regexp.last_match[:v_type]
142
+ {}.tap do |hash|
143
+ value.each do |k, v|
144
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
145
+ end
146
+ end
147
+ else # model
148
+ temp_model = CloudmersiveValidateApiClient.const_get(type).new
149
+ temp_model.build_from_hash(value)
150
+ end
151
+ end
152
+
153
+ # Returns the string representation of the object
154
+ # @return [String] String presentation of the object
155
+ def to_s
156
+ to_hash.to_s
157
+ end
158
+
159
+ # to_body is an alias to to_hash (backward compatibility)
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_body
162
+ to_hash
163
+ end
164
+
165
+ # Returns the object in the form of hash
166
+ # @return [Hash] Returns the object in the form of hash
167
+ def to_hash
168
+ hash = {}
169
+ self.class.attribute_map.each_pair do |attr, param|
170
+ value = self.send(attr)
171
+ next if value.nil?
172
+ hash[param] = _to_hash(value)
173
+ end
174
+ hash
175
+ end
176
+
177
+ # Outputs non-array value in the form of hash
178
+ # For object, use to_hash. Otherwise, just return the value
179
+ # @param [Object] value Any valid value
180
+ # @return [Hash] Returns the value in the form of hash
181
+ def _to_hash(value)
182
+ if value.is_a?(Array)
183
+ value.compact.map { |v| _to_hash(v) }
184
+ elsif value.is_a?(Hash)
185
+ {}.tap do |hash|
186
+ value.each { |k, v| hash[k] = _to_hash(v) }
187
+ end
188
+ elsif value.respond_to? :to_hash
189
+ value.to_hash
190
+ else
191
+ value
192
+ end
193
+ end
194
+
195
+ end
196
+ end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.14
11
11
  =end
12
12
 
13
13
  module CloudmersiveValidateApiClient
14
- VERSION = '2.0.5'
14
+ VERSION = '2.0.6'
15
15
  end
@@ -93,7 +93,7 @@ describe 'AddressApi' do
93
93
 
94
94
  # unit tests for address_validate_address
95
95
  # Validate a street address
96
- # Determines if an input structured street address is valid or invalid. If the address is valid, also returns the latitude and longitude of the address.
96
+ # Determines if an input structured street address is valid or invalid. If the address is valid, also returns the latitude and longitude of the address. Supports all major international addresses.
97
97
  # @param input Input parse request
98
98
  # @param [Hash] opts the optional parameters
99
99
  # @return [ValidateAddressResponse]
@@ -105,7 +105,7 @@ describe 'AddressApi' do
105
105
 
106
106
  # unit tests for address_validate_city
107
107
  # Validate a City and State/Province combination, get location information about it
108
- # Checks if the input city and state name or code is valid, and returns information about it such as normalized City name, State name and more.
108
+ # Checks if the input city and state name or code is valid, and returns information about it such as normalized City name, State name and more. Supports all major international addresses.
109
109
  # @param input Input parse request
110
110
  # @param [Hash] opts the optional parameters
111
111
  # @return [ValidateCityResponse]
@@ -117,7 +117,7 @@ describe 'AddressApi' do
117
117
 
118
118
  # unit tests for address_validate_postal_code
119
119
  # Validate a postal code, get location information about it
120
- # Checks if the input postal code is valid, and returns information about it such as City, State and more.
120
+ # Checks if the input postal code is valid, and returns information about it such as City, State and more. Supports all major countries.
121
121
  # @param input Input parse request
122
122
  # @param [Hash] opts the optional parameters
123
123
  # @return [ValidatePostalCodeResponse]
@@ -129,7 +129,7 @@ describe 'AddressApi' do
129
129
 
130
130
  # unit tests for address_validate_state
131
131
  # Validate a state or province, name or abbreviation, get location information about it
132
- # Checks if the input state name or code is valid, and returns information about it such as normalized State name and more.
132
+ # Checks if the input state name or code is valid, and returns information about it such as normalized State name and more. Supports all major countries.
133
133
  # @param input Input parse request
134
134
  # @param [Hash] opts the optional parameters
135
135
  # @return [ValidateStateResponse]
@@ -32,6 +32,18 @@ describe 'IPAddressApi' do
32
32
  end
33
33
  end
34
34
 
35
+ # unit tests for i_p_address_is_threat
36
+ # Check if IP address is a known threat
37
+ # Check if the input IP address is a known threat IP address. Checks against known bad IPs, botnets, compromised servers, and other lists of threats.
38
+ # @param 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.
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [IPThreatResponse]
41
+ describe 'i_p_address_is_threat test' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
35
47
  # unit tests for i_p_address_is_tor_node
36
48
  # Check if IP address is a Tor node server
37
49
  # Check if the input IP address is a Tor exit node server. Tor servers are a type of privacy-preserving technology that can hide the original IP address who makes a request.
@@ -0,0 +1,47 @@
1
+ =begin
2
+ #validateapi
3
+
4
+ #The validation APIs help you validate data. Check if an E-mail address is real. Check if a domain is real. Check up on an IP address, and even where it is located. All this and much more is available in the validation API.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for CloudmersiveValidateApiClient::IPThreatResponse
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'IPThreatResponse' do
21
+ before do
22
+ # run before each test
23
+ @instance = CloudmersiveValidateApiClient::IPThreatResponse.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of IPThreatResponse' do
31
+ it 'should create an instance of IPThreatResponse' do
32
+ expect(@instance).to be_instance_of(CloudmersiveValidateApiClient::IPThreatResponse)
33
+ end
34
+ end
35
+ describe 'test attribute "is_threat"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "threat_type"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudmersive-validate-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cloudmersive
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-30 00:00:00.000000000 Z
11
+ date: 2020-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -222,6 +222,7 @@ files:
222
222
  - "./docs/GetTimezonesRequest.md"
223
223
  - "./docs/GetTimezonesResponse.md"
224
224
  - "./docs/IPAddressApi.md"
225
+ - "./docs/IPThreatResponse.md"
225
226
  - "./docs/LastNameValidationRequest.md"
226
227
  - "./docs/LastNameValidationResponse.md"
227
228
  - "./docs/LeadEnrichmentApi.md"
@@ -287,6 +288,7 @@ files:
287
288
  - "./lib/cloudmersive-validate-api-client/models/get_gender_response.rb"
288
289
  - "./lib/cloudmersive-validate-api-client/models/get_timezones_request.rb"
289
290
  - "./lib/cloudmersive-validate-api-client/models/get_timezones_response.rb"
291
+ - "./lib/cloudmersive-validate-api-client/models/ip_threat_response.rb"
290
292
  - "./lib/cloudmersive-validate-api-client/models/last_name_validation_request.rb"
291
293
  - "./lib/cloudmersive-validate-api-client/models/last_name_validation_response.rb"
292
294
  - "./lib/cloudmersive-validate-api-client/models/lead_enrichment_request.rb"
@@ -345,6 +347,7 @@ files:
345
347
  - "./spec/models/get_gender_response_spec.rb"
346
348
  - "./spec/models/get_timezones_request_spec.rb"
347
349
  - "./spec/models/get_timezones_response_spec.rb"
350
+ - "./spec/models/ip_threat_response_spec.rb"
348
351
  - "./spec/models/last_name_validation_request_spec.rb"
349
352
  - "./spec/models/last_name_validation_response_spec.rb"
350
353
  - "./spec/models/lead_enrichment_request_spec.rb"