cloudmersive-validate-api-client 2.1.0 → 2.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +32 -4
  3. data/docs/AddressApi.md +55 -0
  4. data/docs/BotCheckResponse.md +8 -0
  5. data/docs/DateTimeApi.md +222 -0
  6. data/docs/DateTimeNaturalLanguageParseRequest.md +8 -0
  7. data/docs/DateTimeNowResult.md +10 -0
  8. data/docs/DateTimeStandardizedParseRequest.md +9 -0
  9. data/docs/DateTimeStandardizedParseResponse.md +16 -0
  10. data/docs/DomainApi.md +3 -3
  11. data/docs/EmailApi.md +3 -3
  12. data/docs/GeolocateStreetAddressResponse.md +13 -0
  13. data/docs/GetPublicHolidaysRequest.md +9 -0
  14. data/docs/IPAddressApi.md +223 -3
  15. data/docs/IPIntelligenceResponse.md +16 -0
  16. data/docs/IPReverseDNSLookupResponse.md +9 -0
  17. data/docs/NormalizeAddressResponse.md +18 -0
  18. data/docs/PublicHolidayOccurrence.md +12 -0
  19. data/docs/PublicHolidaysResponse.md +9 -0
  20. data/docs/TextInputApi.md +173 -0
  21. data/docs/XssProtectionBatchRequest.md +8 -0
  22. data/docs/XssProtectionBatchResponse.md +8 -0
  23. data/docs/XssProtectionRequestItem.md +8 -0
  24. data/docs/XssProtectionResult.md +11 -0
  25. data/lib/cloudmersive-validate-api-client.rb +18 -0
  26. data/lib/cloudmersive-validate-api-client/api/address_api.rb +54 -0
  27. data/lib/cloudmersive-validate-api-client/api/date_time_api.rb +231 -0
  28. data/lib/cloudmersive-validate-api-client/api/domain_api.rb +3 -3
  29. data/lib/cloudmersive-validate-api-client/api/email_api.rb +3 -3
  30. data/lib/cloudmersive-validate-api-client/api/ip_address_api.rb +219 -3
  31. data/lib/cloudmersive-validate-api-client/api/text_input_api.rb +185 -0
  32. data/lib/cloudmersive-validate-api-client/models/bot_check_response.rb +186 -0
  33. data/lib/cloudmersive-validate-api-client/models/date_time_natural_language_parse_request.rb +186 -0
  34. data/lib/cloudmersive-validate-api-client/models/date_time_now_result.rb +206 -0
  35. data/lib/cloudmersive-validate-api-client/models/date_time_standardized_parse_request.rb +196 -0
  36. data/lib/cloudmersive-validate-api-client/models/date_time_standardized_parse_response.rb +266 -0
  37. data/lib/cloudmersive-validate-api-client/models/geolocate_response.rb +1 -1
  38. data/lib/cloudmersive-validate-api-client/models/geolocate_street_address_response.rb +236 -0
  39. data/lib/cloudmersive-validate-api-client/models/get_public_holidays_request.rb +196 -0
  40. data/lib/cloudmersive-validate-api-client/models/ip_intelligence_response.rb +266 -0
  41. data/lib/cloudmersive-validate-api-client/models/ip_reverse_dns_lookup_response.rb +196 -0
  42. data/lib/cloudmersive-validate-api-client/models/normalize_address_response.rb +286 -0
  43. data/lib/cloudmersive-validate-api-client/models/public_holiday_occurrence.rb +226 -0
  44. data/lib/cloudmersive-validate-api-client/models/public_holidays_response.rb +198 -0
  45. data/lib/cloudmersive-validate-api-client/models/xss_protection_batch_request.rb +188 -0
  46. data/lib/cloudmersive-validate-api-client/models/xss_protection_batch_response.rb +188 -0
  47. data/lib/cloudmersive-validate-api-client/models/xss_protection_request_item.rb +186 -0
  48. data/lib/cloudmersive-validate-api-client/models/xss_protection_result.rb +216 -0
  49. data/lib/cloudmersive-validate-api-client/version.rb +1 -1
  50. data/spec/api/address_api_spec.rb +12 -0
  51. data/spec/api/date_time_api_spec.rb +82 -0
  52. data/spec/api/ip_address_api_spec.rb +48 -0
  53. data/spec/api/text_input_api_spec.rb +71 -0
  54. data/spec/models/bot_check_response_spec.rb +41 -0
  55. data/spec/models/date_time_natural_language_parse_request_spec.rb +41 -0
  56. data/spec/models/date_time_now_result_spec.rb +53 -0
  57. data/spec/models/date_time_standardized_parse_request_spec.rb +47 -0
  58. data/spec/models/date_time_standardized_parse_response_spec.rb +89 -0
  59. data/spec/models/geolocate_street_address_response_spec.rb +71 -0
  60. data/spec/models/get_public_holidays_request_spec.rb +47 -0
  61. data/spec/models/ip_intelligence_response_spec.rb +89 -0
  62. data/spec/models/ip_reverse_dns_lookup_response_spec.rb +47 -0
  63. data/spec/models/normalize_address_response_spec.rb +101 -0
  64. data/spec/models/public_holiday_occurrence_spec.rb +65 -0
  65. data/spec/models/public_holidays_response_spec.rb +47 -0
  66. data/spec/models/xss_protection_batch_request_spec.rb +41 -0
  67. data/spec/models/xss_protection_batch_response_spec.rb +41 -0
  68. data/spec/models/xss_protection_request_item_spec.rb +41 -0
  69. data/spec/models/xss_protection_result_spec.rb +59 -0
  70. metadata +56 -2
@@ -0,0 +1,266 @@
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 date time parsing
17
+ class DateTimeStandardizedParseResponse
18
+ # True if successful, false otherwise
19
+ attr_accessor :successful
20
+
21
+ # Result of performing a date time parsing
22
+ attr_accessor :parsed_date_result
23
+
24
+ # Year of the parsed date time result
25
+ attr_accessor :year
26
+
27
+ # Month of the parsed date time result
28
+ attr_accessor :month
29
+
30
+ # Day of the parsed date time result
31
+ attr_accessor :day
32
+
33
+ # Hour of the parsed date time result (24-hour)
34
+ attr_accessor :hour
35
+
36
+ # Minute of the parsed date time result
37
+ attr_accessor :minute
38
+
39
+ # Second of the parsed date time result
40
+ attr_accessor :second
41
+
42
+ # Day of week
43
+ attr_accessor :day_of_week
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'successful' => :'Successful',
49
+ :'parsed_date_result' => :'ParsedDateResult',
50
+ :'year' => :'Year',
51
+ :'month' => :'Month',
52
+ :'day' => :'Day',
53
+ :'hour' => :'Hour',
54
+ :'minute' => :'Minute',
55
+ :'second' => :'Second',
56
+ :'day_of_week' => :'DayOfWeek'
57
+ }
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.swagger_types
62
+ {
63
+ :'successful' => :'BOOLEAN',
64
+ :'parsed_date_result' => :'DateTime',
65
+ :'year' => :'Integer',
66
+ :'month' => :'Integer',
67
+ :'day' => :'Integer',
68
+ :'hour' => :'Integer',
69
+ :'minute' => :'Integer',
70
+ :'second' => :'Integer',
71
+ :'day_of_week' => :'String'
72
+ }
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ return unless attributes.is_a?(Hash)
79
+
80
+ # convert string to symbol for hash key
81
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
82
+
83
+ if attributes.has_key?(:'Successful')
84
+ self.successful = attributes[:'Successful']
85
+ end
86
+
87
+ if attributes.has_key?(:'ParsedDateResult')
88
+ self.parsed_date_result = attributes[:'ParsedDateResult']
89
+ end
90
+
91
+ if attributes.has_key?(:'Year')
92
+ self.year = attributes[:'Year']
93
+ end
94
+
95
+ if attributes.has_key?(:'Month')
96
+ self.month = attributes[:'Month']
97
+ end
98
+
99
+ if attributes.has_key?(:'Day')
100
+ self.day = attributes[:'Day']
101
+ end
102
+
103
+ if attributes.has_key?(:'Hour')
104
+ self.hour = attributes[:'Hour']
105
+ end
106
+
107
+ if attributes.has_key?(:'Minute')
108
+ self.minute = attributes[:'Minute']
109
+ end
110
+
111
+ if attributes.has_key?(:'Second')
112
+ self.second = attributes[:'Second']
113
+ end
114
+
115
+ if attributes.has_key?(:'DayOfWeek')
116
+ self.day_of_week = attributes[:'DayOfWeek']
117
+ end
118
+ end
119
+
120
+ # Show invalid properties with the reasons. Usually used together with valid?
121
+ # @return Array for valid properties with the reasons
122
+ def list_invalid_properties
123
+ invalid_properties = Array.new
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ true
131
+ end
132
+
133
+ # Checks equality by comparing each attribute.
134
+ # @param [Object] Object to be compared
135
+ def ==(o)
136
+ return true if self.equal?(o)
137
+ self.class == o.class &&
138
+ successful == o.successful &&
139
+ parsed_date_result == o.parsed_date_result &&
140
+ year == o.year &&
141
+ month == o.month &&
142
+ day == o.day &&
143
+ hour == o.hour &&
144
+ minute == o.minute &&
145
+ second == o.second &&
146
+ day_of_week == o.day_of_week
147
+ end
148
+
149
+ # @see the `==` method
150
+ # @param [Object] Object to be compared
151
+ def eql?(o)
152
+ self == o
153
+ end
154
+
155
+ # Calculates hash code according to all attributes.
156
+ # @return [Fixnum] Hash code
157
+ def hash
158
+ [successful, parsed_date_result, year, month, day, hour, minute, second, day_of_week].hash
159
+ end
160
+
161
+ # Builds the object from hash
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ # @return [Object] Returns the model itself
164
+ def build_from_hash(attributes)
165
+ return nil unless attributes.is_a?(Hash)
166
+ self.class.swagger_types.each_pair do |key, type|
167
+ if type =~ /\AArray<(.*)>/i
168
+ # check to ensure the input is an array given that the attribute
169
+ # is documented as an array but the input is not
170
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
171
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
172
+ end
173
+ elsif !attributes[self.class.attribute_map[key]].nil?
174
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
175
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
176
+ end
177
+
178
+ self
179
+ end
180
+
181
+ # Deserializes the data based on type
182
+ # @param string type Data type
183
+ # @param string value Value to be deserialized
184
+ # @return [Object] Deserialized data
185
+ def _deserialize(type, value)
186
+ case type.to_sym
187
+ when :DateTime
188
+ DateTime.parse(value)
189
+ when :Date
190
+ Date.parse(value)
191
+ when :String
192
+ value.to_s
193
+ when :Integer
194
+ value.to_i
195
+ when :Float
196
+ value.to_f
197
+ when :BOOLEAN
198
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
199
+ true
200
+ else
201
+ false
202
+ end
203
+ when :Object
204
+ # generic object (usually a Hash), return directly
205
+ value
206
+ when /\AArray<(?<inner_type>.+)>\z/
207
+ inner_type = Regexp.last_match[:inner_type]
208
+ value.map { |v| _deserialize(inner_type, v) }
209
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
210
+ k_type = Regexp.last_match[:k_type]
211
+ v_type = Regexp.last_match[:v_type]
212
+ {}.tap do |hash|
213
+ value.each do |k, v|
214
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
215
+ end
216
+ end
217
+ else # model
218
+ temp_model = CloudmersiveValidateApiClient.const_get(type).new
219
+ temp_model.build_from_hash(value)
220
+ end
221
+ end
222
+
223
+ # Returns the string representation of the object
224
+ # @return [String] String presentation of the object
225
+ def to_s
226
+ to_hash.to_s
227
+ end
228
+
229
+ # to_body is an alias to to_hash (backward compatibility)
230
+ # @return [Hash] Returns the object in the form of hash
231
+ def to_body
232
+ to_hash
233
+ end
234
+
235
+ # Returns the object in the form of hash
236
+ # @return [Hash] Returns the object in the form of hash
237
+ def to_hash
238
+ hash = {}
239
+ self.class.attribute_map.each_pair do |attr, param|
240
+ value = self.send(attr)
241
+ next if value.nil?
242
+ hash[param] = _to_hash(value)
243
+ end
244
+ hash
245
+ end
246
+
247
+ # Outputs non-array value in the form of hash
248
+ # For object, use to_hash. Otherwise, just return the value
249
+ # @param [Object] value Any valid value
250
+ # @return [Hash] Returns the value in the form of hash
251
+ def _to_hash(value)
252
+ if value.is_a?(Array)
253
+ value.compact.map { |v| _to_hash(v) }
254
+ elsif value.is_a?(Hash)
255
+ {}.tap do |hash|
256
+ value.each { |k, v| hash[k] = _to_hash(v) }
257
+ end
258
+ elsif value.respond_to? :to_hash
259
+ value.to_hash
260
+ else
261
+ value
262
+ end
263
+ end
264
+
265
+ end
266
+ end
@@ -13,7 +13,7 @@ Swagger Codegen version: 2.4.14
13
13
  require 'date'
14
14
 
15
15
  module CloudmersiveValidateApiClient
16
- # Geolocation result
16
+ # Geolocation result of performing an IP address geolocation operation. This product includes GeoLite2 data created by MaxMind, available from www.maxmind.com.
17
17
  class GeolocateResponse
18
18
  # Two-letter country code of IP address
19
19
  attr_accessor :country_code
@@ -0,0 +1,236 @@
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
+ # Geolocation street address result
17
+ class GeolocateStreetAddressResponse
18
+ # Two-letter country code of IP address
19
+ attr_accessor :country_code
20
+
21
+ # Country name of IP address
22
+ attr_accessor :country_name
23
+
24
+ # Street address of IP address
25
+ attr_accessor :street_address
26
+
27
+ # City of IP address
28
+ attr_accessor :city
29
+
30
+ # State/region of IP address
31
+ attr_accessor :region_name
32
+
33
+ # Zip or postal code of IP address
34
+ attr_accessor :zip_code
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'country_code' => :'CountryCode',
40
+ :'country_name' => :'CountryName',
41
+ :'street_address' => :'StreetAddress',
42
+ :'city' => :'City',
43
+ :'region_name' => :'RegionName',
44
+ :'zip_code' => :'ZipCode'
45
+ }
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.swagger_types
50
+ {
51
+ :'country_code' => :'String',
52
+ :'country_name' => :'String',
53
+ :'street_address' => :'String',
54
+ :'city' => :'String',
55
+ :'region_name' => :'String',
56
+ :'zip_code' => :'String'
57
+ }
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ return unless attributes.is_a?(Hash)
64
+
65
+ # convert string to symbol for hash key
66
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
67
+
68
+ if attributes.has_key?(:'CountryCode')
69
+ self.country_code = attributes[:'CountryCode']
70
+ end
71
+
72
+ if attributes.has_key?(:'CountryName')
73
+ self.country_name = attributes[:'CountryName']
74
+ end
75
+
76
+ if attributes.has_key?(:'StreetAddress')
77
+ self.street_address = attributes[:'StreetAddress']
78
+ end
79
+
80
+ if attributes.has_key?(:'City')
81
+ self.city = attributes[:'City']
82
+ end
83
+
84
+ if attributes.has_key?(:'RegionName')
85
+ self.region_name = attributes[:'RegionName']
86
+ end
87
+
88
+ if attributes.has_key?(:'ZipCode')
89
+ self.zip_code = attributes[:'ZipCode']
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ invalid_properties = Array.new
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ true
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ country_code == o.country_code &&
112
+ country_name == o.country_name &&
113
+ street_address == o.street_address &&
114
+ city == o.city &&
115
+ region_name == o.region_name &&
116
+ zip_code == o.zip_code
117
+ end
118
+
119
+ # @see the `==` method
120
+ # @param [Object] Object to be compared
121
+ def eql?(o)
122
+ self == o
123
+ end
124
+
125
+ # Calculates hash code according to all attributes.
126
+ # @return [Fixnum] Hash code
127
+ def hash
128
+ [country_code, country_name, street_address, city, region_name, zip_code].hash
129
+ end
130
+
131
+ # Builds the object from hash
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ # @return [Object] Returns the model itself
134
+ def build_from_hash(attributes)
135
+ return nil unless attributes.is_a?(Hash)
136
+ self.class.swagger_types.each_pair do |key, type|
137
+ if type =~ /\AArray<(.*)>/i
138
+ # check to ensure the input is an array given that the attribute
139
+ # is documented as an array but the input is not
140
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
141
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
142
+ end
143
+ elsif !attributes[self.class.attribute_map[key]].nil?
144
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
145
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
146
+ end
147
+
148
+ self
149
+ end
150
+
151
+ # Deserializes the data based on type
152
+ # @param string type Data type
153
+ # @param string value Value to be deserialized
154
+ # @return [Object] Deserialized data
155
+ def _deserialize(type, value)
156
+ case type.to_sym
157
+ when :DateTime
158
+ DateTime.parse(value)
159
+ when :Date
160
+ Date.parse(value)
161
+ when :String
162
+ value.to_s
163
+ when :Integer
164
+ value.to_i
165
+ when :Float
166
+ value.to_f
167
+ when :BOOLEAN
168
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
169
+ true
170
+ else
171
+ false
172
+ end
173
+ when :Object
174
+ # generic object (usually a Hash), return directly
175
+ value
176
+ when /\AArray<(?<inner_type>.+)>\z/
177
+ inner_type = Regexp.last_match[:inner_type]
178
+ value.map { |v| _deserialize(inner_type, v) }
179
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
180
+ k_type = Regexp.last_match[:k_type]
181
+ v_type = Regexp.last_match[:v_type]
182
+ {}.tap do |hash|
183
+ value.each do |k, v|
184
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
185
+ end
186
+ end
187
+ else # model
188
+ temp_model = CloudmersiveValidateApiClient.const_get(type).new
189
+ temp_model.build_from_hash(value)
190
+ end
191
+ end
192
+
193
+ # Returns the string representation of the object
194
+ # @return [String] String presentation of the object
195
+ def to_s
196
+ to_hash.to_s
197
+ end
198
+
199
+ # to_body is an alias to to_hash (backward compatibility)
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_body
202
+ to_hash
203
+ end
204
+
205
+ # Returns the object in the form of hash
206
+ # @return [Hash] Returns the object in the form of hash
207
+ def to_hash
208
+ hash = {}
209
+ self.class.attribute_map.each_pair do |attr, param|
210
+ value = self.send(attr)
211
+ next if value.nil?
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ # Outputs non-array value in the form of hash
218
+ # For object, use to_hash. Otherwise, just return the value
219
+ # @param [Object] value Any valid value
220
+ # @return [Hash] Returns the value in the form of hash
221
+ def _to_hash(value)
222
+ if value.is_a?(Array)
223
+ value.compact.map { |v| _to_hash(v) }
224
+ elsif value.is_a?(Hash)
225
+ {}.tap do |hash|
226
+ value.each { |k, v| hash[k] = _to_hash(v) }
227
+ end
228
+ elsif value.respond_to? :to_hash
229
+ value.to_hash
230
+ else
231
+ value
232
+ end
233
+ end
234
+
235
+ end
236
+ end