cloudmersive-phishing-detection-api-client 2.2.2 → 2.2.4

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 (26) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +14 -9
  3. data/docs/PhishingDetectionAdvancedRequest.md +8 -1
  4. data/docs/PhishingDetectionAdvancedResponse.md +7 -1
  5. data/docs/PhishingDetectionApi.md +66 -12
  6. data/docs/PhishingDetectionTextStringRequest.md +10 -0
  7. data/docs/PhishingDetectionTextStringResponse.md +10 -0
  8. data/docs/PriorHistoryItem.md +15 -0
  9. data/docs/UnsafeUrlResult.md +12 -0
  10. data/lib/cloudmersive-phishing-detection-api-client/api/phishing_detection_api.rb +56 -8
  11. data/lib/cloudmersive-phishing-detection-api-client/models/phishing_detection_advanced_request.rb +86 -14
  12. data/lib/cloudmersive-phishing-detection-api-client/models/phishing_detection_advanced_response.rb +73 -11
  13. data/lib/cloudmersive-phishing-detection-api-client/models/phishing_detection_text_string_request.rb +206 -0
  14. data/lib/cloudmersive-phishing-detection-api-client/models/phishing_detection_text_string_response.rb +206 -0
  15. data/lib/cloudmersive-phishing-detection-api-client/models/prior_history_item.rb +256 -0
  16. data/lib/cloudmersive-phishing-detection-api-client/models/unsafe_url_result.rb +226 -0
  17. data/lib/cloudmersive-phishing-detection-api-client/version.rb +1 -1
  18. data/lib/cloudmersive-phishing-detection-api-client.rb +4 -0
  19. data/spec/api/phishing_detection_api_spec.rb +15 -4
  20. data/spec/models/phishing_detection_advanced_request_spec.rb +45 -3
  21. data/spec/models/phishing_detection_advanced_response_spec.rb +37 -1
  22. data/spec/models/phishing_detection_text_string_request_spec.rb +53 -0
  23. data/spec/models/phishing_detection_text_string_response_spec.rb +53 -0
  24. data/spec/models/prior_history_item_spec.rb +83 -0
  25. data/spec/models/unsafe_url_result_spec.rb +65 -0
  26. metadata +14 -2
@@ -0,0 +1,206 @@
1
+ =begin
2
+ #phishingapi
3
+
4
+ #Easily and directly scan and block phishing security threats in input.
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 CloudmersivePhishingDetectionApiClient
16
+ # Result of detecting phishing using AI for basic text string analysis
17
+ class PhishingDetectionTextStringResponse
18
+ # True if the result is not phishing (clean), and false otherwise
19
+ attr_accessor :clean_result
20
+
21
+ # Confidence level between 0.0 and 1.0 where values over 0.9 indicate high confidence
22
+ attr_accessor :confidence_level
23
+
24
+ # Rationale for why the conclusion was formed
25
+ attr_accessor :analysis_rationale
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'clean_result' => :'CleanResult',
31
+ :'confidence_level' => :'ConfidenceLevel',
32
+ :'analysis_rationale' => :'AnalysisRationale'
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.swagger_types
38
+ {
39
+ :'clean_result' => :'BOOLEAN',
40
+ :'confidence_level' => :'Float',
41
+ :'analysis_rationale' => :'String'
42
+ }
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ return unless attributes.is_a?(Hash)
49
+
50
+ # convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
52
+
53
+ if attributes.has_key?(:'CleanResult')
54
+ self.clean_result = attributes[:'CleanResult']
55
+ end
56
+
57
+ if attributes.has_key?(:'ConfidenceLevel')
58
+ self.confidence_level = attributes[:'ConfidenceLevel']
59
+ end
60
+
61
+ if attributes.has_key?(:'AnalysisRationale')
62
+ self.analysis_rationale = attributes[:'AnalysisRationale']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ clean_result == o.clean_result &&
85
+ confidence_level == o.confidence_level &&
86
+ analysis_rationale == o.analysis_rationale
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Fixnum] Hash code
97
+ def hash
98
+ [clean_result, confidence_level, analysis_rationale].hash
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def build_from_hash(attributes)
105
+ return nil unless attributes.is_a?(Hash)
106
+ self.class.swagger_types.each_pair do |key, type|
107
+ if type =~ /\AArray<(.*)>/i
108
+ # check to ensure the input is an array given that the attribute
109
+ # is documented as an array but the input is not
110
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
111
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
112
+ end
113
+ elsif !attributes[self.class.attribute_map[key]].nil?
114
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
115
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
116
+ end
117
+
118
+ self
119
+ end
120
+
121
+ # Deserializes the data based on type
122
+ # @param string type Data type
123
+ # @param string value Value to be deserialized
124
+ # @return [Object] Deserialized data
125
+ def _deserialize(type, value)
126
+ case type.to_sym
127
+ when :DateTime
128
+ DateTime.parse(value)
129
+ when :Date
130
+ Date.parse(value)
131
+ when :String
132
+ value.to_s
133
+ when :Integer
134
+ value.to_i
135
+ when :Float
136
+ value.to_f
137
+ when :BOOLEAN
138
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
139
+ true
140
+ else
141
+ false
142
+ end
143
+ when :Object
144
+ # generic object (usually a Hash), return directly
145
+ value
146
+ when /\AArray<(?<inner_type>.+)>\z/
147
+ inner_type = Regexp.last_match[:inner_type]
148
+ value.map { |v| _deserialize(inner_type, v) }
149
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
150
+ k_type = Regexp.last_match[:k_type]
151
+ v_type = Regexp.last_match[:v_type]
152
+ {}.tap do |hash|
153
+ value.each do |k, v|
154
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
155
+ end
156
+ end
157
+ else # model
158
+ temp_model = CloudmersivePhishingDetectionApiClient.const_get(type).new
159
+ temp_model.build_from_hash(value)
160
+ end
161
+ end
162
+
163
+ # Returns the string representation of the object
164
+ # @return [String] String presentation of the object
165
+ def to_s
166
+ to_hash.to_s
167
+ end
168
+
169
+ # to_body is an alias to to_hash (backward compatibility)
170
+ # @return [Hash] Returns the object in the form of hash
171
+ def to_body
172
+ to_hash
173
+ end
174
+
175
+ # Returns the object in the form of hash
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_hash
178
+ hash = {}
179
+ self.class.attribute_map.each_pair do |attr, param|
180
+ value = self.send(attr)
181
+ next if value.nil?
182
+ hash[param] = _to_hash(value)
183
+ end
184
+ hash
185
+ end
186
+
187
+ # Outputs non-array value in the form of hash
188
+ # For object, use to_hash. Otherwise, just return the value
189
+ # @param [Object] value Any valid value
190
+ # @return [Hash] Returns the value in the form of hash
191
+ def _to_hash(value)
192
+ if value.is_a?(Array)
193
+ value.compact.map { |v| _to_hash(v) }
194
+ elsif value.is_a?(Hash)
195
+ {}.tap do |hash|
196
+ value.each { |k, v| hash[k] = _to_hash(v) }
197
+ end
198
+ elsif value.respond_to? :to_hash
199
+ value.to_hash
200
+ else
201
+ value
202
+ end
203
+ end
204
+
205
+ end
206
+ end
@@ -0,0 +1,256 @@
1
+ =begin
2
+ #phishingapi
3
+
4
+ #Easily and directly scan and block phishing security threats in input.
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 CloudmersivePhishingDetectionApiClient
16
+ # A single message in the prior conversation history
17
+ class PriorHistoryItem
18
+ # The text content of this historical message
19
+ attr_accessor :input_string
20
+
21
+ # Optional: Name of the sender
22
+ attr_accessor :from_name
23
+
24
+ # Optional: Name of the recipient
25
+ attr_accessor :to_name
26
+
27
+ # Optional: Phone number of the sender
28
+ attr_accessor :from_phone_number
29
+
30
+ # Optional: Phone number of the recipient
31
+ attr_accessor :to_phone_number
32
+
33
+ # Optional: Email address of the sender
34
+ attr_accessor :from_email_address
35
+
36
+ # Optional: Email address of the recipient
37
+ attr_accessor :to_email_address
38
+
39
+ # Optional: True if this message is from a trusted party (such as our own company), false otherwise
40
+ attr_accessor :trusted_party
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'input_string' => :'InputString',
46
+ :'from_name' => :'FromName',
47
+ :'to_name' => :'ToName',
48
+ :'from_phone_number' => :'FromPhoneNumber',
49
+ :'to_phone_number' => :'ToPhoneNumber',
50
+ :'from_email_address' => :'FromEmailAddress',
51
+ :'to_email_address' => :'ToEmailAddress',
52
+ :'trusted_party' => :'TrustedParty'
53
+ }
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.swagger_types
58
+ {
59
+ :'input_string' => :'String',
60
+ :'from_name' => :'String',
61
+ :'to_name' => :'String',
62
+ :'from_phone_number' => :'String',
63
+ :'to_phone_number' => :'String',
64
+ :'from_email_address' => :'String',
65
+ :'to_email_address' => :'String',
66
+ :'trusted_party' => :'BOOLEAN'
67
+ }
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ return unless attributes.is_a?(Hash)
74
+
75
+ # convert string to symbol for hash key
76
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
77
+
78
+ if attributes.has_key?(:'InputString')
79
+ self.input_string = attributes[:'InputString']
80
+ end
81
+
82
+ if attributes.has_key?(:'FromName')
83
+ self.from_name = attributes[:'FromName']
84
+ end
85
+
86
+ if attributes.has_key?(:'ToName')
87
+ self.to_name = attributes[:'ToName']
88
+ end
89
+
90
+ if attributes.has_key?(:'FromPhoneNumber')
91
+ self.from_phone_number = attributes[:'FromPhoneNumber']
92
+ end
93
+
94
+ if attributes.has_key?(:'ToPhoneNumber')
95
+ self.to_phone_number = attributes[:'ToPhoneNumber']
96
+ end
97
+
98
+ if attributes.has_key?(:'FromEmailAddress')
99
+ self.from_email_address = attributes[:'FromEmailAddress']
100
+ end
101
+
102
+ if attributes.has_key?(:'ToEmailAddress')
103
+ self.to_email_address = attributes[:'ToEmailAddress']
104
+ end
105
+
106
+ if attributes.has_key?(:'TrustedParty')
107
+ self.trusted_party = attributes[:'TrustedParty']
108
+ end
109
+ end
110
+
111
+ # Show invalid properties with the reasons. Usually used together with valid?
112
+ # @return Array for valid properties with the reasons
113
+ def list_invalid_properties
114
+ invalid_properties = Array.new
115
+ invalid_properties
116
+ end
117
+
118
+ # Check to see if the all the properties in the model are valid
119
+ # @return true if the model is valid
120
+ def valid?
121
+ true
122
+ end
123
+
124
+ # Checks equality by comparing each attribute.
125
+ # @param [Object] Object to be compared
126
+ def ==(o)
127
+ return true if self.equal?(o)
128
+ self.class == o.class &&
129
+ input_string == o.input_string &&
130
+ from_name == o.from_name &&
131
+ to_name == o.to_name &&
132
+ from_phone_number == o.from_phone_number &&
133
+ to_phone_number == o.to_phone_number &&
134
+ from_email_address == o.from_email_address &&
135
+ to_email_address == o.to_email_address &&
136
+ trusted_party == o.trusted_party
137
+ end
138
+
139
+ # @see the `==` method
140
+ # @param [Object] Object to be compared
141
+ def eql?(o)
142
+ self == o
143
+ end
144
+
145
+ # Calculates hash code according to all attributes.
146
+ # @return [Fixnum] Hash code
147
+ def hash
148
+ [input_string, from_name, to_name, from_phone_number, to_phone_number, from_email_address, to_email_address, trusted_party].hash
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def build_from_hash(attributes)
155
+ return nil unless attributes.is_a?(Hash)
156
+ self.class.swagger_types.each_pair do |key, type|
157
+ if type =~ /\AArray<(.*)>/i
158
+ # check to ensure the input is an array given that the attribute
159
+ # is documented as an array but the input is not
160
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
161
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
162
+ end
163
+ elsif !attributes[self.class.attribute_map[key]].nil?
164
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
165
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
166
+ end
167
+
168
+ self
169
+ end
170
+
171
+ # Deserializes the data based on type
172
+ # @param string type Data type
173
+ # @param string value Value to be deserialized
174
+ # @return [Object] Deserialized data
175
+ def _deserialize(type, value)
176
+ case type.to_sym
177
+ when :DateTime
178
+ DateTime.parse(value)
179
+ when :Date
180
+ Date.parse(value)
181
+ when :String
182
+ value.to_s
183
+ when :Integer
184
+ value.to_i
185
+ when :Float
186
+ value.to_f
187
+ when :BOOLEAN
188
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
189
+ true
190
+ else
191
+ false
192
+ end
193
+ when :Object
194
+ # generic object (usually a Hash), return directly
195
+ value
196
+ when /\AArray<(?<inner_type>.+)>\z/
197
+ inner_type = Regexp.last_match[:inner_type]
198
+ value.map { |v| _deserialize(inner_type, v) }
199
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
200
+ k_type = Regexp.last_match[:k_type]
201
+ v_type = Regexp.last_match[:v_type]
202
+ {}.tap do |hash|
203
+ value.each do |k, v|
204
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
205
+ end
206
+ end
207
+ else # model
208
+ temp_model = CloudmersivePhishingDetectionApiClient.const_get(type).new
209
+ temp_model.build_from_hash(value)
210
+ end
211
+ end
212
+
213
+ # Returns the string representation of the object
214
+ # @return [String] String presentation of the object
215
+ def to_s
216
+ to_hash.to_s
217
+ end
218
+
219
+ # to_body is an alias to to_hash (backward compatibility)
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_body
222
+ to_hash
223
+ end
224
+
225
+ # Returns the object in the form of hash
226
+ # @return [Hash] Returns the object in the form of hash
227
+ def to_hash
228
+ hash = {}
229
+ self.class.attribute_map.each_pair do |attr, param|
230
+ value = self.send(attr)
231
+ next if value.nil?
232
+ hash[param] = _to_hash(value)
233
+ end
234
+ hash
235
+ end
236
+
237
+ # Outputs non-array value in the form of hash
238
+ # For object, use to_hash. Otherwise, just return the value
239
+ # @param [Object] value Any valid value
240
+ # @return [Hash] Returns the value in the form of hash
241
+ def _to_hash(value)
242
+ if value.is_a?(Array)
243
+ value.compact.map { |v| _to_hash(v) }
244
+ elsif value.is_a?(Hash)
245
+ {}.tap do |hash|
246
+ value.each { |k, v| hash[k] = _to_hash(v) }
247
+ end
248
+ elsif value.respond_to? :to_hash
249
+ value.to_hash
250
+ else
251
+ value
252
+ end
253
+ end
254
+
255
+ end
256
+ end
@@ -0,0 +1,226 @@
1
+ =begin
2
+ #phishingapi
3
+
4
+ #Easily and directly scan and block phishing security threats in input.
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 CloudmersivePhishingDetectionApiClient
16
+ # Result of analyzing an individual URL found in text
17
+ class UnsafeUrlResult
18
+ # The URL that was detected and analyzed
19
+ attr_accessor :url
20
+
21
+ # True if the result is not phishing (clean), and false otherwise
22
+ attr_accessor :clean_result
23
+
24
+ # True if the URL is an SSRF threat
25
+ attr_accessor :is_ssrf_threat
26
+
27
+ # True if the URL contains phishing threat risks, false otherwise
28
+ attr_accessor :contains_phishing
29
+
30
+ # True if the URL contains a phishing attempt, false otherwise
31
+ attr_accessor :contains_phishing_attempt
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'url' => :'Url',
37
+ :'clean_result' => :'CleanResult',
38
+ :'is_ssrf_threat' => :'IsSsrfThreat',
39
+ :'contains_phishing' => :'ContainsPhishing',
40
+ :'contains_phishing_attempt' => :'ContainsPhishingAttempt'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.swagger_types
46
+ {
47
+ :'url' => :'String',
48
+ :'clean_result' => :'BOOLEAN',
49
+ :'is_ssrf_threat' => :'BOOLEAN',
50
+ :'contains_phishing' => :'BOOLEAN',
51
+ :'contains_phishing_attempt' => :'BOOLEAN'
52
+ }
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ return unless attributes.is_a?(Hash)
59
+
60
+ # convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
62
+
63
+ if attributes.has_key?(:'Url')
64
+ self.url = attributes[:'Url']
65
+ end
66
+
67
+ if attributes.has_key?(:'CleanResult')
68
+ self.clean_result = attributes[:'CleanResult']
69
+ end
70
+
71
+ if attributes.has_key?(:'IsSsrfThreat')
72
+ self.is_ssrf_threat = attributes[:'IsSsrfThreat']
73
+ end
74
+
75
+ if attributes.has_key?(:'ContainsPhishing')
76
+ self.contains_phishing = attributes[:'ContainsPhishing']
77
+ end
78
+
79
+ if attributes.has_key?(:'ContainsPhishingAttempt')
80
+ self.contains_phishing_attempt = attributes[:'ContainsPhishingAttempt']
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ invalid_properties = Array.new
88
+ invalid_properties
89
+ end
90
+
91
+ # Check to see if the all the properties in the model are valid
92
+ # @return true if the model is valid
93
+ def valid?
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ url == o.url &&
103
+ clean_result == o.clean_result &&
104
+ is_ssrf_threat == o.is_ssrf_threat &&
105
+ contains_phishing == o.contains_phishing &&
106
+ contains_phishing_attempt == o.contains_phishing_attempt
107
+ end
108
+
109
+ # @see the `==` method
110
+ # @param [Object] Object to be compared
111
+ def eql?(o)
112
+ self == o
113
+ end
114
+
115
+ # Calculates hash code according to all attributes.
116
+ # @return [Fixnum] Hash code
117
+ def hash
118
+ [url, clean_result, is_ssrf_threat, contains_phishing, contains_phishing_attempt].hash
119
+ end
120
+
121
+ # Builds the object from hash
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ # @return [Object] Returns the model itself
124
+ def build_from_hash(attributes)
125
+ return nil unless attributes.is_a?(Hash)
126
+ self.class.swagger_types.each_pair do |key, type|
127
+ if type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
131
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
132
+ end
133
+ elsif !attributes[self.class.attribute_map[key]].nil?
134
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
136
+ end
137
+
138
+ self
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def _deserialize(type, value)
146
+ case type.to_sym
147
+ when :DateTime
148
+ DateTime.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :BOOLEAN
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ temp_model = CloudmersivePhishingDetectionApiClient.const_get(type).new
179
+ temp_model.build_from_hash(value)
180
+ end
181
+ end
182
+
183
+ # Returns the string representation of the object
184
+ # @return [String] String presentation of the object
185
+ def to_s
186
+ to_hash.to_s
187
+ end
188
+
189
+ # to_body is an alias to to_hash (backward compatibility)
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_body
192
+ to_hash
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ next if value.nil?
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ # Outputs non-array value in the form of hash
208
+ # For object, use to_hash. Otherwise, just return the value
209
+ # @param [Object] value Any valid value
210
+ # @return [Hash] Returns the value in the form of hash
211
+ def _to_hash(value)
212
+ if value.is_a?(Array)
213
+ value.compact.map { |v| _to_hash(v) }
214
+ elsif value.is_a?(Hash)
215
+ {}.tap do |hash|
216
+ value.each { |k, v| hash[k] = _to_hash(v) }
217
+ end
218
+ elsif value.respond_to? :to_hash
219
+ value.to_hash
220
+ else
221
+ value
222
+ end
223
+ end
224
+
225
+ end
226
+ end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.14
11
11
  =end
12
12
 
13
13
  module CloudmersivePhishingDetectionApiClient
14
- VERSION = '2.2.2'
14
+ VERSION = '2.2.4'
15
15
  end
@@ -23,7 +23,11 @@ require 'cloudmersive-phishing-detection-api-client/models/phishing_detection_ad
23
23
  require 'cloudmersive-phishing-detection-api-client/models/phishing_detection_advanced_response'
24
24
  require 'cloudmersive-phishing-detection-api-client/models/phishing_detection_email_advanced_response'
25
25
  require 'cloudmersive-phishing-detection-api-client/models/phishing_detection_response'
26
+ require 'cloudmersive-phishing-detection-api-client/models/phishing_detection_text_string_request'
27
+ require 'cloudmersive-phishing-detection-api-client/models/phishing_detection_text_string_response'
26
28
  require 'cloudmersive-phishing-detection-api-client/models/phishing_detection_url_advanced_response'
29
+ require 'cloudmersive-phishing-detection-api-client/models/prior_history_item'
30
+ require 'cloudmersive-phishing-detection-api-client/models/unsafe_url_result'
27
31
 
28
32
  # APIs
29
33
  require 'cloudmersive-phishing-detection-api-client/api/phishing_detection_api'