ultracart_api 4.1.136 → 4.1.140

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 (103) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +87 -2
  3. data/docs/ChannelPartnerOrder.md +2 -0
  4. data/docs/ConversationApi.md +52 -0
  5. data/docs/ConversationPbxPayConnector.md +32 -0
  6. data/docs/ConversationPbxPayConnectorsResponse.md +26 -0
  7. data/docs/OrderChannelPartner.md +2 -0
  8. data/docs/SfvbApi.md +1933 -0
  9. data/docs/SfvbCompileRequest.md +26 -0
  10. data/docs/SfvbCompileResponse.md +28 -0
  11. data/docs/SfvbContainerResponse.md +36 -0
  12. data/docs/SfvbContainerRevertRequest.md +20 -0
  13. data/docs/SfvbContainerVersion.md +40 -0
  14. data/docs/SfvbContainerVersionsResponse.md +18 -0
  15. data/docs/SfvbContainerWriteRequest.md +24 -0
  16. data/docs/SfvbElement.md +20 -0
  17. data/docs/SfvbElementSchemaResponse.md +20 -0
  18. data/docs/SfvbElementsResponse.md +22 -0
  19. data/docs/SfvbErrorDetail.md +36 -0
  20. data/docs/SfvbFileContentResponse.md +38 -0
  21. data/docs/SfvbFileEntry.md +46 -0
  22. data/docs/SfvbFileRevertRequest.md +22 -0
  23. data/docs/SfvbFileSearchRequest.md +48 -0
  24. data/docs/SfvbFileSearchResponse.md +32 -0
  25. data/docs/SfvbFileVersion.md +34 -0
  26. data/docs/SfvbFileVersionsResponse.md +22 -0
  27. data/docs/SfvbFileWriteRequest.md +22 -0
  28. data/docs/SfvbFileWriteResponse.md +28 -0
  29. data/docs/SfvbFilesResponse.md +28 -0
  30. data/docs/SfvbLibraryEntry.md +38 -0
  31. data/docs/SfvbLibraryFacet.md +22 -0
  32. data/docs/SfvbLibraryResponse.md +28 -0
  33. data/docs/SfvbPreviewSessionRequest.md +20 -0
  34. data/docs/SfvbPreviewSessionResponse.md +30 -0
  35. data/docs/SfvbPreviewUrlResponse.md +30 -0
  36. data/docs/SfvbRenderRequest.md +40 -0
  37. data/docs/SfvbRenderResponse.md +28 -0
  38. data/docs/SfvbStorefront.md +22 -0
  39. data/docs/SfvbStorefrontsResponse.md +18 -0
  40. data/docs/SfvbTheme.md +36 -0
  41. data/docs/SfvbThemeDuplicateRequest.md +22 -0
  42. data/docs/SfvbThemeJobResponse.md +40 -0
  43. data/docs/SfvbThemesResponse.md +20 -0
  44. data/docs/SfvbUpsellOffer.md +34 -0
  45. data/docs/SfvbUpsellOffersResponse.md +18 -0
  46. data/docs/SfvbValidateRequest.md +26 -0
  47. data/docs/SfvbValidationResponse.md +24 -0
  48. data/docs/SfvbVelocityValidateRequest.md +20 -0
  49. data/docs/SfvbVersionResponse.md +36 -0
  50. data/docs/SfvbWhoamiResponse.md +36 -0
  51. data/docs/SfvbWidgetIdsResponse.md +22 -0
  52. data/lib/ultracart_api/api/conversation_api.rb +58 -0
  53. data/lib/ultracart_api/api/sfvb_api.rb +2565 -0
  54. data/lib/ultracart_api/models/channel_partner_order.rb +13 -1
  55. data/lib/ultracart_api/models/conversation_pbx_pay_connector.rb +426 -0
  56. data/lib/ultracart_api/models/conversation_pbx_pay_connectors_response.rb +258 -0
  57. data/lib/ultracart_api/models/order_channel_partner.rb +13 -1
  58. data/lib/ultracart_api/models/sfvb_compile_request.rb +260 -0
  59. data/lib/ultracart_api/models/sfvb_compile_response.rb +273 -0
  60. data/lib/ultracart_api/models/sfvb_container_response.rb +344 -0
  61. data/lib/ultracart_api/models/sfvb_container_revert_request.rb +230 -0
  62. data/lib/ultracart_api/models/sfvb_container_version.rb +376 -0
  63. data/lib/ultracart_api/models/sfvb_container_versions_response.rb +222 -0
  64. data/lib/ultracart_api/models/sfvb_container_write_request.rb +250 -0
  65. data/lib/ultracart_api/models/sfvb_element.rb +230 -0
  66. data/lib/ultracart_api/models/sfvb_element_schema_response.rb +230 -0
  67. data/lib/ultracart_api/models/sfvb_elements_response.rb +242 -0
  68. data/lib/ultracart_api/models/sfvb_error_detail.rb +346 -0
  69. data/lib/ultracart_api/models/sfvb_file_content_response.rb +320 -0
  70. data/lib/ultracart_api/models/sfvb_file_entry.rb +360 -0
  71. data/lib/ultracart_api/models/sfvb_file_revert_request.rb +240 -0
  72. data/lib/ultracart_api/models/sfvb_file_search_request.rb +370 -0
  73. data/lib/ultracart_api/models/sfvb_file_search_response.rb +292 -0
  74. data/lib/ultracart_api/models/sfvb_file_version.rb +300 -0
  75. data/lib/ultracart_api/models/sfvb_file_versions_response.rb +242 -0
  76. data/lib/ultracart_api/models/sfvb_file_write_request.rb +240 -0
  77. data/lib/ultracart_api/models/sfvb_file_write_response.rb +268 -0
  78. data/lib/ultracart_api/models/sfvb_files_response.rb +272 -0
  79. data/lib/ultracart_api/models/sfvb_library_entry.rb +322 -0
  80. data/lib/ultracart_api/models/sfvb_library_facet.rb +242 -0
  81. data/lib/ultracart_api/models/sfvb_library_response.rb +274 -0
  82. data/lib/ultracart_api/models/sfvb_preview_session_request.rb +230 -0
  83. data/lib/ultracart_api/models/sfvb_preview_session_response.rb +284 -0
  84. data/lib/ultracart_api/models/sfvb_preview_url_response.rb +280 -0
  85. data/lib/ultracart_api/models/sfvb_render_request.rb +330 -0
  86. data/lib/ultracart_api/models/sfvb_render_response.rb +274 -0
  87. data/lib/ultracart_api/models/sfvb_storefront.rb +240 -0
  88. data/lib/ultracart_api/models/sfvb_storefronts_response.rb +222 -0
  89. data/lib/ultracart_api/models/sfvb_theme.rb +310 -0
  90. data/lib/ultracart_api/models/sfvb_theme_duplicate_request.rb +240 -0
  91. data/lib/ultracart_api/models/sfvb_theme_job_response.rb +364 -0
  92. data/lib/ultracart_api/models/sfvb_themes_response.rb +232 -0
  93. data/lib/ultracart_api/models/sfvb_upsell_offer.rb +300 -0
  94. data/lib/ultracart_api/models/sfvb_upsell_offers_response.rb +222 -0
  95. data/lib/ultracart_api/models/sfvb_validate_request.rb +294 -0
  96. data/lib/ultracart_api/models/sfvb_validation_response.rb +256 -0
  97. data/lib/ultracart_api/models/sfvb_velocity_validate_request.rb +230 -0
  98. data/lib/ultracart_api/models/sfvb_version_response.rb +344 -0
  99. data/lib/ultracart_api/models/sfvb_whoami_response.rb +314 -0
  100. data/lib/ultracart_api/models/sfvb_widget_ids_response.rb +242 -0
  101. data/lib/ultracart_api/version.rb +1 -1
  102. data/lib/ultracart_api.rb +46 -0
  103. metadata +94 -2
@@ -0,0 +1,370 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class SfvbFileSearchRequest
18
+ # Whether the text search is case sensitive. Defaults to false.
19
+ attr_accessor :case_sensitive
20
+
21
+ # Only dynamic HTML (arbitrary) files.
22
+ attr_accessor :dynamic_html
23
+
24
+ # Comma separated file name patterns, matched case insensitively with wildcards.
25
+ attr_accessor :file_name
26
+
27
+ # Only files with internationalization violations.
28
+ attr_accessor :i18n_violations
29
+
30
+ # Only files that failed Velocity validation.
31
+ attr_accessor :invalid
32
+
33
+ # Maximum results to return. Clamped to the server maximum.
34
+ attr_accessor :max_results
35
+
36
+ # Only files with unresolved theme merge conflicts.
37
+ attr_accessor :merge_conflicts
38
+
39
+ # Restrict to a mime type.
40
+ attr_accessor :mime_type
41
+
42
+ # Only files modified at or before this ISO-8601 timestamp.
43
+ attr_accessor :modified_max
44
+
45
+ # Only files modified at or after this ISO-8601 timestamp.
46
+ attr_accessor :modified_min
47
+
48
+ # Results to skip. Send the next_offset from a truncated response to continue. Ordering is by path with the file oid as a tie breaker, so pages do not overlap or skip entries between calls.
49
+ attr_accessor :offset
50
+
51
+ # Restrict to a directory path. Strongly recommended alongside text.
52
+ attr_accessor :path
53
+
54
+ # Maximum size in bytes.
55
+ attr_accessor :size_max
56
+
57
+ # Minimum size in bytes.
58
+ attr_accessor :size_min
59
+
60
+ # Recurse below path. Defaults to true.
61
+ attr_accessor :sub_directories
62
+
63
+ # Text to find inside files. Only text/* files are searched. This is the expensive filter; narrow with path or file_name where possible.
64
+ attr_accessor :text
65
+
66
+ # Attribute mapping from ruby-style variable name to JSON key.
67
+ def self.attribute_map
68
+ {
69
+ :'case_sensitive' => :'caseSensitive',
70
+ :'dynamic_html' => :'dynamicHtml',
71
+ :'file_name' => :'fileName',
72
+ :'i18n_violations' => :'i18nViolations',
73
+ :'invalid' => :'invalid',
74
+ :'max_results' => :'maxResults',
75
+ :'merge_conflicts' => :'mergeConflicts',
76
+ :'mime_type' => :'mimeType',
77
+ :'modified_max' => :'modifiedMax',
78
+ :'modified_min' => :'modifiedMin',
79
+ :'offset' => :'offset',
80
+ :'path' => :'path',
81
+ :'size_max' => :'sizeMax',
82
+ :'size_min' => :'sizeMin',
83
+ :'sub_directories' => :'subDirectories',
84
+ :'text' => :'text'
85
+ }
86
+ end
87
+
88
+ # Returns all the JSON keys this model knows about
89
+ def self.acceptable_attributes
90
+ attribute_map.values
91
+ end
92
+
93
+ # Attribute type mapping.
94
+ def self.openapi_types
95
+ {
96
+ :'case_sensitive' => :'Boolean',
97
+ :'dynamic_html' => :'Boolean',
98
+ :'file_name' => :'String',
99
+ :'i18n_violations' => :'Boolean',
100
+ :'invalid' => :'Boolean',
101
+ :'max_results' => :'Integer',
102
+ :'merge_conflicts' => :'Boolean',
103
+ :'mime_type' => :'String',
104
+ :'modified_max' => :'String',
105
+ :'modified_min' => :'String',
106
+ :'offset' => :'Integer',
107
+ :'path' => :'String',
108
+ :'size_max' => :'Integer',
109
+ :'size_min' => :'Integer',
110
+ :'sub_directories' => :'Boolean',
111
+ :'text' => :'String'
112
+ }
113
+ end
114
+
115
+ # List of attributes with nullable: true
116
+ def self.openapi_nullable
117
+ Set.new([
118
+ ])
119
+ end
120
+
121
+ # Initializes the object
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ def initialize(attributes = {})
124
+ if (!attributes.is_a?(Hash))
125
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbFileSearchRequest` initialize method"
126
+ end
127
+
128
+ # check to see if the attribute exists and convert string to symbol for hash key
129
+ attributes = attributes.each_with_object({}) { |(k, v), h|
130
+ if (!self.class.attribute_map.key?(k.to_sym))
131
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbFileSearchRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
132
+ end
133
+ h[k.to_sym] = v
134
+ }
135
+
136
+ if attributes.key?(:'case_sensitive')
137
+ self.case_sensitive = attributes[:'case_sensitive']
138
+ end
139
+
140
+ if attributes.key?(:'dynamic_html')
141
+ self.dynamic_html = attributes[:'dynamic_html']
142
+ end
143
+
144
+ if attributes.key?(:'file_name')
145
+ self.file_name = attributes[:'file_name']
146
+ end
147
+
148
+ if attributes.key?(:'i18n_violations')
149
+ self.i18n_violations = attributes[:'i18n_violations']
150
+ end
151
+
152
+ if attributes.key?(:'invalid')
153
+ self.invalid = attributes[:'invalid']
154
+ end
155
+
156
+ if attributes.key?(:'max_results')
157
+ self.max_results = attributes[:'max_results']
158
+ end
159
+
160
+ if attributes.key?(:'merge_conflicts')
161
+ self.merge_conflicts = attributes[:'merge_conflicts']
162
+ end
163
+
164
+ if attributes.key?(:'mime_type')
165
+ self.mime_type = attributes[:'mime_type']
166
+ end
167
+
168
+ if attributes.key?(:'modified_max')
169
+ self.modified_max = attributes[:'modified_max']
170
+ end
171
+
172
+ if attributes.key?(:'modified_min')
173
+ self.modified_min = attributes[:'modified_min']
174
+ end
175
+
176
+ if attributes.key?(:'offset')
177
+ self.offset = attributes[:'offset']
178
+ end
179
+
180
+ if attributes.key?(:'path')
181
+ self.path = attributes[:'path']
182
+ end
183
+
184
+ if attributes.key?(:'size_max')
185
+ self.size_max = attributes[:'size_max']
186
+ end
187
+
188
+ if attributes.key?(:'size_min')
189
+ self.size_min = attributes[:'size_min']
190
+ end
191
+
192
+ if attributes.key?(:'sub_directories')
193
+ self.sub_directories = attributes[:'sub_directories']
194
+ end
195
+
196
+ if attributes.key?(:'text')
197
+ self.text = attributes[:'text']
198
+ end
199
+ end
200
+
201
+ # Show invalid properties with the reasons. Usually used together with valid?
202
+ # @return Array for valid properties with the reasons
203
+ def list_invalid_properties
204
+ invalid_properties = Array.new
205
+ invalid_properties
206
+ end
207
+
208
+ # Check to see if the all the properties in the model are valid
209
+ # @return true if the model is valid
210
+ def valid?
211
+ true
212
+ end
213
+
214
+ # Checks equality by comparing each attribute.
215
+ # @param [Object] Object to be compared
216
+ def ==(o)
217
+ return true if self.equal?(o)
218
+ self.class == o.class &&
219
+ case_sensitive == o.case_sensitive &&
220
+ dynamic_html == o.dynamic_html &&
221
+ file_name == o.file_name &&
222
+ i18n_violations == o.i18n_violations &&
223
+ invalid == o.invalid &&
224
+ max_results == o.max_results &&
225
+ merge_conflicts == o.merge_conflicts &&
226
+ mime_type == o.mime_type &&
227
+ modified_max == o.modified_max &&
228
+ modified_min == o.modified_min &&
229
+ offset == o.offset &&
230
+ path == o.path &&
231
+ size_max == o.size_max &&
232
+ size_min == o.size_min &&
233
+ sub_directories == o.sub_directories &&
234
+ text == o.text
235
+ end
236
+
237
+ # @see the `==` method
238
+ # @param [Object] Object to be compared
239
+ def eql?(o)
240
+ self == o
241
+ end
242
+
243
+ # Calculates hash code according to all attributes.
244
+ # @return [Integer] Hash code
245
+ def hash
246
+ [case_sensitive, dynamic_html, file_name, i18n_violations, invalid, max_results, merge_conflicts, mime_type, modified_max, modified_min, offset, path, size_max, size_min, sub_directories, text].hash
247
+ end
248
+
249
+ # Builds the object from hash
250
+ # @param [Hash] attributes Model attributes in the form of hash
251
+ # @return [Object] Returns the model itself
252
+ def self.build_from_hash(attributes)
253
+ new.build_from_hash(attributes)
254
+ end
255
+
256
+ # Builds the object from hash
257
+ # @param [Hash] attributes Model attributes in the form of hash
258
+ # @return [Object] Returns the model itself
259
+ def build_from_hash(attributes)
260
+ return nil unless attributes.is_a?(Hash)
261
+ attributes = attributes.transform_keys(&:to_sym)
262
+ self.class.openapi_types.each_pair do |key, type|
263
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
264
+ self.send("#{key}=", nil)
265
+ elsif type =~ /\AArray<(.*)>/i
266
+ # check to ensure the input is an array given that the attribute
267
+ # is documented as an array but the input is not
268
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
269
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
270
+ end
271
+ elsif !attributes[self.class.attribute_map[key]].nil?
272
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
273
+ end
274
+ end
275
+
276
+ self
277
+ end
278
+
279
+ # Deserializes the data based on type
280
+ # @param string type Data type
281
+ # @param string value Value to be deserialized
282
+ # @return [Object] Deserialized data
283
+ def _deserialize(type, value)
284
+ case type.to_sym
285
+ when :Time
286
+ Time.parse(value)
287
+ when :Date
288
+ Date.parse(value)
289
+ when :String
290
+ value.to_s
291
+ when :Integer
292
+ value.to_i
293
+ when :Float
294
+ value.to_f
295
+ when :Boolean
296
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
297
+ true
298
+ else
299
+ false
300
+ end
301
+ when :Object
302
+ # generic object (usually a Hash), return directly
303
+ value
304
+ when /\AArray<(?<inner_type>.+)>\z/
305
+ inner_type = Regexp.last_match[:inner_type]
306
+ value.map { |v| _deserialize(inner_type, v) }
307
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
308
+ k_type = Regexp.last_match[:k_type]
309
+ v_type = Regexp.last_match[:v_type]
310
+ {}.tap do |hash|
311
+ value.each do |k, v|
312
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
313
+ end
314
+ end
315
+ else # model
316
+ # models (e.g. Pet) or oneOf
317
+ klass = UltracartClient.const_get(type)
318
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
319
+ end
320
+ end
321
+
322
+ # Returns the string representation of the object
323
+ # @return [String] String presentation of the object
324
+ def to_s
325
+ to_hash.to_s
326
+ end
327
+
328
+ # to_body is an alias to to_hash (backward compatibility)
329
+ # @return [Hash] Returns the object in the form of hash
330
+ def to_body
331
+ to_hash
332
+ end
333
+
334
+ # Returns the object in the form of hash
335
+ # @return [Hash] Returns the object in the form of hash
336
+ def to_hash
337
+ hash = {}
338
+ self.class.attribute_map.each_pair do |attr, param|
339
+ value = self.send(attr)
340
+ if value.nil?
341
+ is_nullable = self.class.openapi_nullable.include?(attr)
342
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
343
+ end
344
+
345
+ hash[param] = _to_hash(value)
346
+ end
347
+ hash
348
+ end
349
+
350
+ # Outputs non-array value in the form of hash
351
+ # For object, use to_hash. Otherwise, just return the value
352
+ # @param [Object] value Any valid value
353
+ # @return [Hash] Returns the value in the form of hash
354
+ def _to_hash(value)
355
+ if value.is_a?(Array)
356
+ value.compact.map { |v| _to_hash(v) }
357
+ elsif value.is_a?(Hash)
358
+ {}.tap do |hash|
359
+ value.each { |k, v| hash[k] = _to_hash(v) }
360
+ end
361
+ elsif value.respond_to? :to_hash
362
+ value.to_hash
363
+ else
364
+ value
365
+ end
366
+ end
367
+
368
+ end
369
+
370
+ end
@@ -0,0 +1,292 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class SfvbFileSearchResponse
18
+ # Matching files.
19
+ attr_accessor :files
20
+
21
+ # The cap that was applied.
22
+ attr_accessor :max_results
23
+
24
+ # Offset to send for the next page. Zero when truncated is false. Never truncates without giving a way to continue.
25
+ attr_accessor :next_offset
26
+
27
+ # Results skipped to produce this page.
28
+ attr_accessor :offset
29
+
30
+ # Number of results returned.
31
+ attr_accessor :result_count
32
+
33
+ # Total matches found. Available because the underlying query is unbounded and returns everything anyway; it is not evidence that fetching them all is cheap.
34
+ attr_accessor :total_count
35
+
36
+ # True when matches exist beyond this page. next_offset is populated when it is.
37
+ attr_accessor :truncated
38
+
39
+ # Advice for the caller when truncated is true.
40
+ attr_accessor :truncation_advice
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'files' => :'files',
46
+ :'max_results' => :'maxResults',
47
+ :'next_offset' => :'nextOffset',
48
+ :'offset' => :'offset',
49
+ :'result_count' => :'resultCount',
50
+ :'total_count' => :'totalCount',
51
+ :'truncated' => :'truncated',
52
+ :'truncation_advice' => :'truncationAdvice'
53
+ }
54
+ end
55
+
56
+ # Returns all the JSON keys this model knows about
57
+ def self.acceptable_attributes
58
+ attribute_map.values
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.openapi_types
63
+ {
64
+ :'files' => :'Array<SfvbFileEntry>',
65
+ :'max_results' => :'Integer',
66
+ :'next_offset' => :'Integer',
67
+ :'offset' => :'Integer',
68
+ :'result_count' => :'Integer',
69
+ :'total_count' => :'Integer',
70
+ :'truncated' => :'Boolean',
71
+ :'truncation_advice' => :'String'
72
+ }
73
+ end
74
+
75
+ # List of attributes with nullable: true
76
+ def self.openapi_nullable
77
+ Set.new([
78
+ ])
79
+ end
80
+
81
+ # Initializes the object
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ def initialize(attributes = {})
84
+ if (!attributes.is_a?(Hash))
85
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbFileSearchResponse` initialize method"
86
+ end
87
+
88
+ # check to see if the attribute exists and convert string to symbol for hash key
89
+ attributes = attributes.each_with_object({}) { |(k, v), h|
90
+ if (!self.class.attribute_map.key?(k.to_sym))
91
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbFileSearchResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
92
+ end
93
+ h[k.to_sym] = v
94
+ }
95
+
96
+ if attributes.key?(:'files')
97
+ if (value = attributes[:'files']).is_a?(Array)
98
+ self.files = value
99
+ end
100
+ end
101
+
102
+ if attributes.key?(:'max_results')
103
+ self.max_results = attributes[:'max_results']
104
+ end
105
+
106
+ if attributes.key?(:'next_offset')
107
+ self.next_offset = attributes[:'next_offset']
108
+ end
109
+
110
+ if attributes.key?(:'offset')
111
+ self.offset = attributes[:'offset']
112
+ end
113
+
114
+ if attributes.key?(:'result_count')
115
+ self.result_count = attributes[:'result_count']
116
+ end
117
+
118
+ if attributes.key?(:'total_count')
119
+ self.total_count = attributes[:'total_count']
120
+ end
121
+
122
+ if attributes.key?(:'truncated')
123
+ self.truncated = attributes[:'truncated']
124
+ end
125
+
126
+ if attributes.key?(:'truncation_advice')
127
+ self.truncation_advice = attributes[:'truncation_advice']
128
+ end
129
+ end
130
+
131
+ # Show invalid properties with the reasons. Usually used together with valid?
132
+ # @return Array for valid properties with the reasons
133
+ def list_invalid_properties
134
+ invalid_properties = Array.new
135
+ invalid_properties
136
+ end
137
+
138
+ # Check to see if the all the properties in the model are valid
139
+ # @return true if the model is valid
140
+ def valid?
141
+ true
142
+ end
143
+
144
+ # Checks equality by comparing each attribute.
145
+ # @param [Object] Object to be compared
146
+ def ==(o)
147
+ return true if self.equal?(o)
148
+ self.class == o.class &&
149
+ files == o.files &&
150
+ max_results == o.max_results &&
151
+ next_offset == o.next_offset &&
152
+ offset == o.offset &&
153
+ result_count == o.result_count &&
154
+ total_count == o.total_count &&
155
+ truncated == o.truncated &&
156
+ truncation_advice == o.truncation_advice
157
+ end
158
+
159
+ # @see the `==` method
160
+ # @param [Object] Object to be compared
161
+ def eql?(o)
162
+ self == o
163
+ end
164
+
165
+ # Calculates hash code according to all attributes.
166
+ # @return [Integer] Hash code
167
+ def hash
168
+ [files, max_results, next_offset, offset, result_count, total_count, truncated, truncation_advice].hash
169
+ end
170
+
171
+ # Builds the object from hash
172
+ # @param [Hash] attributes Model attributes in the form of hash
173
+ # @return [Object] Returns the model itself
174
+ def self.build_from_hash(attributes)
175
+ new.build_from_hash(attributes)
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ attributes = attributes.transform_keys(&:to_sym)
184
+ self.class.openapi_types.each_pair do |key, type|
185
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
186
+ self.send("#{key}=", nil)
187
+ elsif type =~ /\AArray<(.*)>/i
188
+ # check to ensure the input is an array given that the attribute
189
+ # is documented as an array but the input is not
190
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
191
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
192
+ end
193
+ elsif !attributes[self.class.attribute_map[key]].nil?
194
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
195
+ end
196
+ end
197
+
198
+ self
199
+ end
200
+
201
+ # Deserializes the data based on type
202
+ # @param string type Data type
203
+ # @param string value Value to be deserialized
204
+ # @return [Object] Deserialized data
205
+ def _deserialize(type, value)
206
+ case type.to_sym
207
+ when :Time
208
+ Time.parse(value)
209
+ when :Date
210
+ Date.parse(value)
211
+ when :String
212
+ value.to_s
213
+ when :Integer
214
+ value.to_i
215
+ when :Float
216
+ value.to_f
217
+ when :Boolean
218
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
219
+ true
220
+ else
221
+ false
222
+ end
223
+ when :Object
224
+ # generic object (usually a Hash), return directly
225
+ value
226
+ when /\AArray<(?<inner_type>.+)>\z/
227
+ inner_type = Regexp.last_match[:inner_type]
228
+ value.map { |v| _deserialize(inner_type, v) }
229
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
230
+ k_type = Regexp.last_match[:k_type]
231
+ v_type = Regexp.last_match[:v_type]
232
+ {}.tap do |hash|
233
+ value.each do |k, v|
234
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
235
+ end
236
+ end
237
+ else # model
238
+ # models (e.g. Pet) or oneOf
239
+ klass = UltracartClient.const_get(type)
240
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
241
+ end
242
+ end
243
+
244
+ # Returns the string representation of the object
245
+ # @return [String] String presentation of the object
246
+ def to_s
247
+ to_hash.to_s
248
+ end
249
+
250
+ # to_body is an alias to to_hash (backward compatibility)
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_body
253
+ to_hash
254
+ end
255
+
256
+ # Returns the object in the form of hash
257
+ # @return [Hash] Returns the object in the form of hash
258
+ def to_hash
259
+ hash = {}
260
+ self.class.attribute_map.each_pair do |attr, param|
261
+ value = self.send(attr)
262
+ if value.nil?
263
+ is_nullable = self.class.openapi_nullable.include?(attr)
264
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
265
+ end
266
+
267
+ hash[param] = _to_hash(value)
268
+ end
269
+ hash
270
+ end
271
+
272
+ # Outputs non-array value in the form of hash
273
+ # For object, use to_hash. Otherwise, just return the value
274
+ # @param [Object] value Any valid value
275
+ # @return [Hash] Returns the value in the form of hash
276
+ def _to_hash(value)
277
+ if value.is_a?(Array)
278
+ value.compact.map { |v| _to_hash(v) }
279
+ elsif value.is_a?(Hash)
280
+ {}.tap do |hash|
281
+ value.each { |k, v| hash[k] = _to_hash(v) }
282
+ end
283
+ elsif value.respond_to? :to_hash
284
+ value.to_hash
285
+ else
286
+ value
287
+ end
288
+ end
289
+
290
+ end
291
+
292
+ end