cloudmersive-validate-api-client 2.2.3 → 2.2.4

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: 2fb56107e866366c0bbe0cb0406b1a577b4ecd93769850a24144912c942ca33c
4
- data.tar.gz: 79013bc0deb6aadca1c1c17bac8d78bcbfbbb2012d4619f797cee37928d3861f
3
+ metadata.gz: bda2d29aed6f694cefad741670033ee4c4413bca97f808db708b6d96e7bfc623
4
+ data.tar.gz: e98072e83bfa227d8fdc5eda4d050297eaef91fa387b03229051c9b6f66c74bb
5
5
  SHA512:
6
- metadata.gz: 43fd253ae8999d42507d0fe7a8fbf5aeb2b43891b21cb2d53d16c4a1584ccfda4a6aa9f91457b5600dbc2e2180d90cccf2f5a00b106078b9187a3400061292b8
7
- data.tar.gz: 0d0456435a45f680ed768b49b778b50cd72115f8da1515374ac369e0008d64cc6ec84bc717516ccf0db0b93a3028cba1f4b449caee45ed06b7d34c7965f92d48
6
+ metadata.gz: 6833aa20a67fbeba89dfd15e5b5c6278c79610c830813ced064432c472b0cd1de6a6d4645c9802fdde217a918f96c3fa0c19c894d32f5272fe56860cbf090ab1
7
+ data.tar.gz: 6b7bb18a5c190a57f15af84fd75bcc019ebde4d27f832493d23430d844a1a2a869eba4b4f285546175a55411f8148815944e866672f4420a123fa672509faca0
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.2.3
10
+ - Package version: 2.2.4
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.2.3.gem
26
+ gem install ./cloudmersive-validate-api-client-2.2.4.gem
27
27
  ```
28
- (for development, run `gem install --dev ./cloudmersive-validate-api-client-2.2.3.gem` to install the development dependencies)
28
+ (for development, run `gem install --dev ./cloudmersive-validate-api-client-2.2.4.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.2.3'
34
+ gem 'cloudmersive-validate-api-client', '~> 2.2.4'
35
35
 
36
36
  ### Install from Git
37
37
 
@@ -111,6 +111,7 @@ Class | Method | HTTP request | Description
111
111
  *CloudmersiveValidateApiClient::DomainApi* | [**domain_ssrf_check**](docs/DomainApi.md#domain_ssrf_check) | **POST** /validate/domain/url/ssrf-threat-check | Check a URL for SSRF threats
112
112
  *CloudmersiveValidateApiClient::DomainApi* | [**domain_ssrf_check_batch**](docs/DomainApi.md#domain_ssrf_check_batch) | **POST** /validate/domain/url/ssrf-threat-check/batch | Check a URL for SSRF threats in batches
113
113
  *CloudmersiveValidateApiClient::DomainApi* | [**domain_url_full**](docs/DomainApi.md#domain_url_full) | **POST** /validate/domain/url/full | Validate a URL fully
114
+ *CloudmersiveValidateApiClient::DomainApi* | [**domain_url_html_ssrf_check**](docs/DomainApi.md#domain_url_html_ssrf_check) | **POST** /validate/domain/url/ssrf-threat-check/html-embedded | Check a URL for HTML embedded SSRF threats
114
115
  *CloudmersiveValidateApiClient::DomainApi* | [**domain_url_syntax_only**](docs/DomainApi.md#domain_url_syntax_only) | **POST** /validate/domain/url/syntax-only | Validate a URL syntactically
115
116
  *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
116
117
  *CloudmersiveValidateApiClient::EmailApi* | [**email_full_validation**](docs/EmailApi.md#email_full_validation) | **POST** /validate/email/address/full | Fully validate an email address
@@ -192,6 +193,8 @@ Class | Method | HTTP request | Description
192
193
  - [CloudmersiveValidateApiClient::SqlInjectionDetectionResult](docs/SqlInjectionDetectionResult.md)
193
194
  - [CloudmersiveValidateApiClient::Timezone](docs/Timezone.md)
194
195
  - [CloudmersiveValidateApiClient::TorNodeResponse](docs/TorNodeResponse.md)
196
+ - [CloudmersiveValidateApiClient::UrlHtmlSsrfRequestFull](docs/UrlHtmlSsrfRequestFull.md)
197
+ - [CloudmersiveValidateApiClient::UrlHtmlSsrfResponseFull](docs/UrlHtmlSsrfResponseFull.md)
195
198
  - [CloudmersiveValidateApiClient::UrlSafetyCheckRequestFull](docs/UrlSafetyCheckRequestFull.md)
196
199
  - [CloudmersiveValidateApiClient::UrlSafetyCheckResponseFull](docs/UrlSafetyCheckResponseFull.md)
197
200
  - [CloudmersiveValidateApiClient::UrlSsrfRequestBatch](docs/UrlSsrfRequestBatch.md)
data/docs/DomainApi.md CHANGED
@@ -14,6 +14,7 @@ Method | HTTP request | Description
14
14
  [**domain_ssrf_check**](DomainApi.md#domain_ssrf_check) | **POST** /validate/domain/url/ssrf-threat-check | Check a URL for SSRF threats
15
15
  [**domain_ssrf_check_batch**](DomainApi.md#domain_ssrf_check_batch) | **POST** /validate/domain/url/ssrf-threat-check/batch | Check a URL for SSRF threats in batches
16
16
  [**domain_url_full**](DomainApi.md#domain_url_full) | **POST** /validate/domain/url/full | Validate a URL fully
17
+ [**domain_url_html_ssrf_check**](DomainApi.md#domain_url_html_ssrf_check) | **POST** /validate/domain/url/ssrf-threat-check/html-embedded | Check a URL for HTML embedded SSRF threats
17
18
  [**domain_url_syntax_only**](DomainApi.md#domain_url_syntax_only) | **POST** /validate/domain/url/syntax-only | Validate a URL syntactically
18
19
 
19
20
 
@@ -557,6 +558,60 @@ Name | Type | Description | Notes
557
558
 
558
559
 
559
560
 
561
+ # **domain_url_html_ssrf_check**
562
+ > UrlHtmlSsrfResponseFull domain_url_html_ssrf_check(request)
563
+
564
+ Check a URL for HTML embedded SSRF threats
565
+
566
+ Checks if an input URL HTML is at risk of containing one or more embedded SSRF (Server-side request forgery) threats or attacks.
567
+
568
+ ### Example
569
+ ```ruby
570
+ # load the gem
571
+ require 'cloudmersive-validate-api-client'
572
+ # setup authorization
573
+ CloudmersiveValidateApiClient.configure do |config|
574
+ # Configure API key authorization: Apikey
575
+ config.api_key['Apikey'] = 'YOUR API KEY'
576
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
577
+ #config.api_key_prefix['Apikey'] = 'Bearer'
578
+ end
579
+
580
+ api_instance = CloudmersiveValidateApiClient::DomainApi.new
581
+
582
+ request = CloudmersiveValidateApiClient::UrlHtmlSsrfRequestFull.new # UrlHtmlSsrfRequestFull | Input URL request
583
+
584
+
585
+ begin
586
+ #Check a URL for HTML embedded SSRF threats
587
+ result = api_instance.domain_url_html_ssrf_check(request)
588
+ p result
589
+ rescue CloudmersiveValidateApiClient::ApiError => e
590
+ puts "Exception when calling DomainApi->domain_url_html_ssrf_check: #{e}"
591
+ end
592
+ ```
593
+
594
+ ### Parameters
595
+
596
+ Name | Type | Description | Notes
597
+ ------------- | ------------- | ------------- | -------------
598
+ **request** | [**UrlHtmlSsrfRequestFull**](UrlHtmlSsrfRequestFull.md)| Input URL request |
599
+
600
+ ### Return type
601
+
602
+ [**UrlHtmlSsrfResponseFull**](UrlHtmlSsrfResponseFull.md)
603
+
604
+ ### Authorization
605
+
606
+ [Apikey](../README.md#Apikey)
607
+
608
+ ### HTTP request headers
609
+
610
+ - **Content-Type**: application/json, text/json
611
+ - **Accept**: application/json, text/json, application/xml, text/xml
612
+
613
+
614
+
560
615
  # **domain_url_syntax_only**
561
616
  > ValidateUrlResponseSyntaxOnly domain_url_syntax_only(request)
562
617
 
@@ -0,0 +1,8 @@
1
+ # CloudmersiveValidateApiClient::UrlHtmlSsrfRequestFull
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **url** | **String** | URL to validate | [optional]
7
+
8
+
@@ -0,0 +1,9 @@
1
+ # CloudmersiveValidateApiClient::UrlHtmlSsrfResponseFull
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **clean_url** | **BOOLEAN** | True if the URL is clean, false if it is at risk of containing an SSRF threat or attack | [optional]
7
+ **http_response_code** | **Integer** | HTTP response code from the URL | [optional]
8
+
9
+
@@ -66,6 +66,8 @@ require 'cloudmersive-validate-api-client/models/sql_injection_check_request_ite
66
66
  require 'cloudmersive-validate-api-client/models/sql_injection_detection_result'
67
67
  require 'cloudmersive-validate-api-client/models/timezone'
68
68
  require 'cloudmersive-validate-api-client/models/tor_node_response'
69
+ require 'cloudmersive-validate-api-client/models/url_html_ssrf_request_full'
70
+ require 'cloudmersive-validate-api-client/models/url_html_ssrf_response_full'
69
71
  require 'cloudmersive-validate-api-client/models/url_safety_check_request_full'
70
72
  require 'cloudmersive-validate-api-client/models/url_safety_check_response_full'
71
73
  require 'cloudmersive-validate-api-client/models/url_ssrf_request_batch'
@@ -559,6 +559,60 @@ module CloudmersiveValidateApiClient
559
559
  end
560
560
  return data, status_code, headers
561
561
  end
562
+ # Check a URL for HTML embedded SSRF threats
563
+ # Checks if an input URL HTML is at risk of containing one or more embedded SSRF (Server-side request forgery) threats or attacks.
564
+ # @param request Input URL request
565
+ # @param [Hash] opts the optional parameters
566
+ # @return [UrlHtmlSsrfResponseFull]
567
+ def domain_url_html_ssrf_check(request, opts = {})
568
+ data, _status_code, _headers = domain_url_html_ssrf_check_with_http_info(request, opts)
569
+ data
570
+ end
571
+
572
+ # Check a URL for HTML embedded SSRF threats
573
+ # Checks if an input URL HTML is at risk of containing one or more embedded SSRF (Server-side request forgery) threats or attacks.
574
+ # @param request Input URL request
575
+ # @param [Hash] opts the optional parameters
576
+ # @return [Array<(UrlHtmlSsrfResponseFull, Fixnum, Hash)>] UrlHtmlSsrfResponseFull data, response status code and response headers
577
+ def domain_url_html_ssrf_check_with_http_info(request, opts = {})
578
+ if @api_client.config.debugging
579
+ @api_client.config.logger.debug 'Calling API: DomainApi.domain_url_html_ssrf_check ...'
580
+ end
581
+ # verify the required parameter 'request' is set
582
+ if @api_client.config.client_side_validation && request.nil?
583
+ fail ArgumentError, "Missing the required parameter 'request' when calling DomainApi.domain_url_html_ssrf_check"
584
+ end
585
+ # resource path
586
+ local_var_path = '/validate/domain/url/ssrf-threat-check/html-embedded'
587
+
588
+ # query parameters
589
+ query_params = {}
590
+
591
+ # header parameters
592
+ header_params = {}
593
+ # HTTP header 'Accept' (if needed)
594
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
595
+ # HTTP header 'Content-Type'
596
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json'])
597
+
598
+ # form parameters
599
+ form_params = {}
600
+
601
+ # http body (model)
602
+ post_body = @api_client.object_to_http_body(request)
603
+ auth_names = ['Apikey']
604
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
605
+ :header_params => header_params,
606
+ :query_params => query_params,
607
+ :form_params => form_params,
608
+ :body => post_body,
609
+ :auth_names => auth_names,
610
+ :return_type => 'UrlHtmlSsrfResponseFull')
611
+ if @api_client.config.debugging
612
+ @api_client.config.logger.debug "API called: DomainApi#domain_url_html_ssrf_check\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
613
+ end
614
+ return data, status_code, headers
615
+ end
562
616
  # Validate a URL syntactically
563
617
  # Validate whether a URL is syntactically valid (does not check endpoint for validity). Accepts various types of input and produces a well-formed URL as output.
564
618
  # @param request Input URL information
@@ -0,0 +1,186 @@
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
+ # Request to determine if a URL contains HTML-embedded SSRF threats
17
+ class UrlHtmlSsrfRequestFull
18
+ # URL to validate
19
+ attr_accessor :url
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'url' => :'URL'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.swagger_types
30
+ {
31
+ :'url' => :'String'
32
+ }
33
+ end
34
+
35
+ # Initializes the object
36
+ # @param [Hash] attributes Model attributes in the form of hash
37
+ def initialize(attributes = {})
38
+ return unless attributes.is_a?(Hash)
39
+
40
+ # convert string to symbol for hash key
41
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
42
+
43
+ if attributes.has_key?(:'URL')
44
+ self.url = attributes[:'URL']
45
+ end
46
+ end
47
+
48
+ # Show invalid properties with the reasons. Usually used together with valid?
49
+ # @return Array for valid properties with the reasons
50
+ def list_invalid_properties
51
+ invalid_properties = Array.new
52
+ invalid_properties
53
+ end
54
+
55
+ # Check to see if the all the properties in the model are valid
56
+ # @return true if the model is valid
57
+ def valid?
58
+ true
59
+ end
60
+
61
+ # Checks equality by comparing each attribute.
62
+ # @param [Object] Object to be compared
63
+ def ==(o)
64
+ return true if self.equal?(o)
65
+ self.class == o.class &&
66
+ url == o.url
67
+ end
68
+
69
+ # @see the `==` method
70
+ # @param [Object] Object to be compared
71
+ def eql?(o)
72
+ self == o
73
+ end
74
+
75
+ # Calculates hash code according to all attributes.
76
+ # @return [Fixnum] Hash code
77
+ def hash
78
+ [url].hash
79
+ end
80
+
81
+ # Builds the object from hash
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ # @return [Object] Returns the model itself
84
+ def build_from_hash(attributes)
85
+ return nil unless attributes.is_a?(Hash)
86
+ self.class.swagger_types.each_pair do |key, type|
87
+ if type =~ /\AArray<(.*)>/i
88
+ # check to ensure the input is an array given that the attribute
89
+ # is documented as an array but the input is not
90
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
91
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
92
+ end
93
+ elsif !attributes[self.class.attribute_map[key]].nil?
94
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
95
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
96
+ end
97
+
98
+ self
99
+ end
100
+
101
+ # Deserializes the data based on type
102
+ # @param string type Data type
103
+ # @param string value Value to be deserialized
104
+ # @return [Object] Deserialized data
105
+ def _deserialize(type, value)
106
+ case type.to_sym
107
+ when :DateTime
108
+ DateTime.parse(value)
109
+ when :Date
110
+ Date.parse(value)
111
+ when :String
112
+ value.to_s
113
+ when :Integer
114
+ value.to_i
115
+ when :Float
116
+ value.to_f
117
+ when :BOOLEAN
118
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
119
+ true
120
+ else
121
+ false
122
+ end
123
+ when :Object
124
+ # generic object (usually a Hash), return directly
125
+ value
126
+ when /\AArray<(?<inner_type>.+)>\z/
127
+ inner_type = Regexp.last_match[:inner_type]
128
+ value.map { |v| _deserialize(inner_type, v) }
129
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
130
+ k_type = Regexp.last_match[:k_type]
131
+ v_type = Regexp.last_match[:v_type]
132
+ {}.tap do |hash|
133
+ value.each do |k, v|
134
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
135
+ end
136
+ end
137
+ else # model
138
+ temp_model = CloudmersiveValidateApiClient.const_get(type).new
139
+ temp_model.build_from_hash(value)
140
+ end
141
+ end
142
+
143
+ # Returns the string representation of the object
144
+ # @return [String] String presentation of the object
145
+ def to_s
146
+ to_hash.to_s
147
+ end
148
+
149
+ # to_body is an alias to to_hash (backward compatibility)
150
+ # @return [Hash] Returns the object in the form of hash
151
+ def to_body
152
+ to_hash
153
+ end
154
+
155
+ # Returns the object in the form of hash
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_hash
158
+ hash = {}
159
+ self.class.attribute_map.each_pair do |attr, param|
160
+ value = self.send(attr)
161
+ next if value.nil?
162
+ hash[param] = _to_hash(value)
163
+ end
164
+ hash
165
+ end
166
+
167
+ # Outputs non-array value in the form of hash
168
+ # For object, use to_hash. Otherwise, just return the value
169
+ # @param [Object] value Any valid value
170
+ # @return [Hash] Returns the value in the form of hash
171
+ def _to_hash(value)
172
+ if value.is_a?(Array)
173
+ value.compact.map { |v| _to_hash(v) }
174
+ elsif value.is_a?(Hash)
175
+ {}.tap do |hash|
176
+ value.each { |k, v| hash[k] = _to_hash(v) }
177
+ end
178
+ elsif value.respond_to? :to_hash
179
+ value.to_hash
180
+ else
181
+ value
182
+ end
183
+ end
184
+
185
+ end
186
+ end
@@ -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 checking a URL for HTML-embedded SSRF threats
17
+ class UrlHtmlSsrfResponseFull
18
+ # True if the URL is clean, false if it is at risk of containing an SSRF threat or attack
19
+ attr_accessor :clean_url
20
+
21
+ # HTTP response code from the URL
22
+ attr_accessor :http_response_code
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'clean_url' => :'CleanURL',
28
+ :'http_response_code' => :'HttpResponseCode'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ :'clean_url' => :'BOOLEAN',
36
+ :'http_response_code' => :'Integer'
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?(:'CleanURL')
49
+ self.clean_url = attributes[:'CleanURL']
50
+ end
51
+
52
+ if attributes.has_key?(:'HttpResponseCode')
53
+ self.http_response_code = attributes[:'HttpResponseCode']
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
+ clean_url == o.clean_url &&
76
+ http_response_code == o.http_response_code
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
+ [clean_url, http_response_code].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.2.3'
14
+ VERSION = '2.2.4'
15
15
  end
@@ -152,6 +152,18 @@ describe 'DomainApi' do
152
152
  end
153
153
  end
154
154
 
155
+ # unit tests for domain_url_html_ssrf_check
156
+ # Check a URL for HTML embedded SSRF threats
157
+ # Checks if an input URL HTML is at risk of containing one or more embedded SSRF (Server-side request forgery) threats or attacks.
158
+ # @param request Input URL request
159
+ # @param [Hash] opts the optional parameters
160
+ # @return [UrlHtmlSsrfResponseFull]
161
+ describe 'domain_url_html_ssrf_check test' do
162
+ it 'should work' do
163
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
164
+ end
165
+ end
166
+
155
167
  # unit tests for domain_url_syntax_only
156
168
  # Validate a URL syntactically
157
169
  # Validate whether a URL is syntactically valid (does not check endpoint for validity). Accepts various types of input and produces a well-formed URL as output.
@@ -0,0 +1,41 @@
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::UrlHtmlSsrfRequestFull
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'UrlHtmlSsrfRequestFull' do
21
+ before do
22
+ # run before each test
23
+ @instance = CloudmersiveValidateApiClient::UrlHtmlSsrfRequestFull.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of UrlHtmlSsrfRequestFull' do
31
+ it 'should create an instance of UrlHtmlSsrfRequestFull' do
32
+ expect(@instance).to be_instance_of(CloudmersiveValidateApiClient::UrlHtmlSsrfRequestFull)
33
+ end
34
+ end
35
+ describe 'test attribute "url"' 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
+ end
@@ -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::UrlHtmlSsrfResponseFull
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'UrlHtmlSsrfResponseFull' do
21
+ before do
22
+ # run before each test
23
+ @instance = CloudmersiveValidateApiClient::UrlHtmlSsrfResponseFull.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of UrlHtmlSsrfResponseFull' do
31
+ it 'should create an instance of UrlHtmlSsrfResponseFull' do
32
+ expect(@instance).to be_instance_of(CloudmersiveValidateApiClient::UrlHtmlSsrfResponseFull)
33
+ end
34
+ end
35
+ describe 'test attribute "clean_url"' 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 "http_response_code"' 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.2.3
4
+ version: 2.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cloudmersive
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-28 00:00:00.000000000 Z
11
+ date: 2021-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -261,6 +261,8 @@ files:
261
261
  - "./docs/TextInputApi.md"
262
262
  - "./docs/Timezone.md"
263
263
  - "./docs/TorNodeResponse.md"
264
+ - "./docs/UrlHtmlSsrfRequestFull.md"
265
+ - "./docs/UrlHtmlSsrfResponseFull.md"
264
266
  - "./docs/UrlSafetyCheckRequestFull.md"
265
267
  - "./docs/UrlSafetyCheckResponseFull.md"
266
268
  - "./docs/UrlSsrfRequestBatch.md"
@@ -363,6 +365,8 @@ files:
363
365
  - "./lib/cloudmersive-validate-api-client/models/sql_injection_detection_result.rb"
364
366
  - "./lib/cloudmersive-validate-api-client/models/timezone.rb"
365
367
  - "./lib/cloudmersive-validate-api-client/models/tor_node_response.rb"
368
+ - "./lib/cloudmersive-validate-api-client/models/url_html_ssrf_request_full.rb"
369
+ - "./lib/cloudmersive-validate-api-client/models/url_html_ssrf_response_full.rb"
366
370
  - "./lib/cloudmersive-validate-api-client/models/url_safety_check_request_full.rb"
367
371
  - "./lib/cloudmersive-validate-api-client/models/url_safety_check_response_full.rb"
368
372
  - "./lib/cloudmersive-validate-api-client/models/url_ssrf_request_batch.rb"
@@ -461,6 +465,8 @@ files:
461
465
  - "./spec/models/sql_injection_detection_result_spec.rb"
462
466
  - "./spec/models/timezone_spec.rb"
463
467
  - "./spec/models/tor_node_response_spec.rb"
468
+ - "./spec/models/url_html_ssrf_request_full_spec.rb"
469
+ - "./spec/models/url_html_ssrf_response_full_spec.rb"
464
470
  - "./spec/models/url_safety_check_request_full_spec.rb"
465
471
  - "./spec/models/url_safety_check_response_full_spec.rb"
466
472
  - "./spec/models/url_ssrf_request_batch_spec.rb"