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,273 @@
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 SfvbCompileResponse
18
+ # Container id the document compiled under.
19
+ attr_accessor :container_id
20
+
21
+ # Velocity directives the compiled output declares.
22
+ attr_accessor :directives
23
+
24
+ # True when compilation produced output.
25
+ attr_accessor :success
26
+
27
+ # Element types used, sorted.
28
+ attr_accessor :used_elements
29
+
30
+ attr_accessor :validation
31
+
32
+ # The compiled Velocity. This is the body only; the cache wrapper a stored .cjson gets is not included.
33
+ attr_accessor :velocity
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'container_id' => :'containerId',
39
+ :'directives' => :'directives',
40
+ :'success' => :'success',
41
+ :'used_elements' => :'usedElements',
42
+ :'validation' => :'validation',
43
+ :'velocity' => :'velocity'
44
+ }
45
+ end
46
+
47
+ # Returns all the JSON keys this model knows about
48
+ def self.acceptable_attributes
49
+ attribute_map.values
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.openapi_types
54
+ {
55
+ :'container_id' => :'String',
56
+ :'directives' => :'Array<String>',
57
+ :'success' => :'Boolean',
58
+ :'used_elements' => :'Array<String>',
59
+ :'validation' => :'SfvbValidationResponse',
60
+ :'velocity' => :'String'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbCompileResponse` initialize method"
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}) { |(k, v), h|
79
+ if (!self.class.attribute_map.key?(k.to_sym))
80
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbCompileResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
81
+ end
82
+ h[k.to_sym] = v
83
+ }
84
+
85
+ if attributes.key?(:'container_id')
86
+ self.container_id = attributes[:'container_id']
87
+ end
88
+
89
+ if attributes.key?(:'directives')
90
+ if (value = attributes[:'directives']).is_a?(Array)
91
+ self.directives = value
92
+ end
93
+ end
94
+
95
+ if attributes.key?(:'success')
96
+ self.success = attributes[:'success']
97
+ end
98
+
99
+ if attributes.key?(:'used_elements')
100
+ if (value = attributes[:'used_elements']).is_a?(Array)
101
+ self.used_elements = value
102
+ end
103
+ end
104
+
105
+ if attributes.key?(:'validation')
106
+ self.validation = attributes[:'validation']
107
+ end
108
+
109
+ if attributes.key?(:'velocity')
110
+ self.velocity = attributes[:'velocity']
111
+ end
112
+ end
113
+
114
+ # Show invalid properties with the reasons. Usually used together with valid?
115
+ # @return Array for valid properties with the reasons
116
+ def list_invalid_properties
117
+ invalid_properties = Array.new
118
+ invalid_properties
119
+ end
120
+
121
+ # Check to see if the all the properties in the model are valid
122
+ # @return true if the model is valid
123
+ def valid?
124
+ true
125
+ end
126
+
127
+ # Checks equality by comparing each attribute.
128
+ # @param [Object] Object to be compared
129
+ def ==(o)
130
+ return true if self.equal?(o)
131
+ self.class == o.class &&
132
+ container_id == o.container_id &&
133
+ directives == o.directives &&
134
+ success == o.success &&
135
+ used_elements == o.used_elements &&
136
+ validation == o.validation &&
137
+ velocity == o.velocity
138
+ end
139
+
140
+ # @see the `==` method
141
+ # @param [Object] Object to be compared
142
+ def eql?(o)
143
+ self == o
144
+ end
145
+
146
+ # Calculates hash code according to all attributes.
147
+ # @return [Integer] Hash code
148
+ def hash
149
+ [container_id, directives, success, used_elements, validation, velocity].hash
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def self.build_from_hash(attributes)
156
+ new.build_from_hash(attributes)
157
+ end
158
+
159
+ # Builds the object from hash
160
+ # @param [Hash] attributes Model attributes in the form of hash
161
+ # @return [Object] Returns the model itself
162
+ def build_from_hash(attributes)
163
+ return nil unless attributes.is_a?(Hash)
164
+ attributes = attributes.transform_keys(&:to_sym)
165
+ self.class.openapi_types.each_pair do |key, type|
166
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
167
+ self.send("#{key}=", nil)
168
+ elsif type =~ /\AArray<(.*)>/i
169
+ # check to ensure the input is an array given that the attribute
170
+ # is documented as an array but the input is not
171
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
172
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
173
+ end
174
+ elsif !attributes[self.class.attribute_map[key]].nil?
175
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
176
+ end
177
+ end
178
+
179
+ self
180
+ end
181
+
182
+ # Deserializes the data based on type
183
+ # @param string type Data type
184
+ # @param string value Value to be deserialized
185
+ # @return [Object] Deserialized data
186
+ def _deserialize(type, value)
187
+ case type.to_sym
188
+ when :Time
189
+ Time.parse(value)
190
+ when :Date
191
+ Date.parse(value)
192
+ when :String
193
+ value.to_s
194
+ when :Integer
195
+ value.to_i
196
+ when :Float
197
+ value.to_f
198
+ when :Boolean
199
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
200
+ true
201
+ else
202
+ false
203
+ end
204
+ when :Object
205
+ # generic object (usually a Hash), return directly
206
+ value
207
+ when /\AArray<(?<inner_type>.+)>\z/
208
+ inner_type = Regexp.last_match[:inner_type]
209
+ value.map { |v| _deserialize(inner_type, v) }
210
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
211
+ k_type = Regexp.last_match[:k_type]
212
+ v_type = Regexp.last_match[:v_type]
213
+ {}.tap do |hash|
214
+ value.each do |k, v|
215
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
216
+ end
217
+ end
218
+ else # model
219
+ # models (e.g. Pet) or oneOf
220
+ klass = UltracartClient.const_get(type)
221
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
222
+ end
223
+ end
224
+
225
+ # Returns the string representation of the object
226
+ # @return [String] String presentation of the object
227
+ def to_s
228
+ to_hash.to_s
229
+ end
230
+
231
+ # to_body is an alias to to_hash (backward compatibility)
232
+ # @return [Hash] Returns the object in the form of hash
233
+ def to_body
234
+ to_hash
235
+ end
236
+
237
+ # Returns the object in the form of hash
238
+ # @return [Hash] Returns the object in the form of hash
239
+ def to_hash
240
+ hash = {}
241
+ self.class.attribute_map.each_pair do |attr, param|
242
+ value = self.send(attr)
243
+ if value.nil?
244
+ is_nullable = self.class.openapi_nullable.include?(attr)
245
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
246
+ end
247
+
248
+ hash[param] = _to_hash(value)
249
+ end
250
+ hash
251
+ end
252
+
253
+ # Outputs non-array value in the form of hash
254
+ # For object, use to_hash. Otherwise, just return the value
255
+ # @param [Object] value Any valid value
256
+ # @return [Hash] Returns the value in the form of hash
257
+ def _to_hash(value)
258
+ if value.is_a?(Array)
259
+ value.compact.map { |v| _to_hash(v) }
260
+ elsif value.is_a?(Hash)
261
+ {}.tap do |hash|
262
+ value.each { |k, v| hash[k] = _to_hash(v) }
263
+ end
264
+ elsif value.respond_to? :to_hash
265
+ value.to_hash
266
+ else
267
+ value
268
+ end
269
+ end
270
+
271
+ end
272
+
273
+ end
@@ -0,0 +1,344 @@
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 SfvbContainerResponse
18
+ # True when this container lives in the theme currently serving live traffic. Writing to it requires the sfvb_publish scope.
19
+ attr_accessor :active_theme
20
+
21
+ # The container JSON. Runtime state is stripped on the way out.
22
+ attr_accessor :cjson
23
+
24
+ # Container id as the compiler will derive it.
25
+ attr_accessor :container_id
26
+
27
+ # Container name.
28
+ attr_accessor :container_name
29
+
30
+ # SHA-256 of the cjson. Send back as If-Match when writing.
31
+ attr_accessor :hash_sha256
32
+
33
+ # When the container was last modified, where the store records it.
34
+ attr_accessor :last_modified
35
+
36
+ # Identifier of the owning object within its store.
37
+ attr_accessor :owner_object_id
38
+
39
+ # Where this container lives.
40
+ attr_accessor :owner_type
41
+
42
+ # File path, for theme and page containers only.
43
+ attr_accessor :path
44
+
45
+ # File version, for theme and page containers only.
46
+ attr_accessor :version
47
+
48
+ class EnumAttributeValidator
49
+ attr_reader :datatype
50
+ attr_reader :allowable_values
51
+
52
+ def initialize(datatype, allowable_values)
53
+ @allowable_values = allowable_values.map do |value|
54
+ case datatype.to_s
55
+ when /Integer/i
56
+ value.to_i
57
+ when /Float/i
58
+ value.to_f
59
+ else
60
+ value
61
+ end
62
+ end
63
+ end
64
+
65
+ def valid?(value)
66
+ !value || allowable_values.include?(value)
67
+ end
68
+ end
69
+
70
+ # Attribute mapping from ruby-style variable name to JSON key.
71
+ def self.attribute_map
72
+ {
73
+ :'active_theme' => :'activeTheme',
74
+ :'cjson' => :'cjson',
75
+ :'container_id' => :'containerId',
76
+ :'container_name' => :'containerName',
77
+ :'hash_sha256' => :'hashSha256',
78
+ :'last_modified' => :'lastModified',
79
+ :'owner_object_id' => :'ownerObjectId',
80
+ :'owner_type' => :'ownerType',
81
+ :'path' => :'path',
82
+ :'version' => :'version'
83
+ }
84
+ end
85
+
86
+ # Returns all the JSON keys this model knows about
87
+ def self.acceptable_attributes
88
+ attribute_map.values
89
+ end
90
+
91
+ # Attribute type mapping.
92
+ def self.openapi_types
93
+ {
94
+ :'active_theme' => :'Boolean',
95
+ :'cjson' => :'String',
96
+ :'container_id' => :'String',
97
+ :'container_name' => :'String',
98
+ :'hash_sha256' => :'String',
99
+ :'last_modified' => :'String',
100
+ :'owner_object_id' => :'String',
101
+ :'owner_type' => :'String',
102
+ :'path' => :'String',
103
+ :'version' => :'Integer'
104
+ }
105
+ end
106
+
107
+ # List of attributes with nullable: true
108
+ def self.openapi_nullable
109
+ Set.new([
110
+ ])
111
+ end
112
+
113
+ # Initializes the object
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ def initialize(attributes = {})
116
+ if (!attributes.is_a?(Hash))
117
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbContainerResponse` initialize method"
118
+ end
119
+
120
+ # check to see if the attribute exists and convert string to symbol for hash key
121
+ attributes = attributes.each_with_object({}) { |(k, v), h|
122
+ if (!self.class.attribute_map.key?(k.to_sym))
123
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbContainerResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
124
+ end
125
+ h[k.to_sym] = v
126
+ }
127
+
128
+ if attributes.key?(:'active_theme')
129
+ self.active_theme = attributes[:'active_theme']
130
+ end
131
+
132
+ if attributes.key?(:'cjson')
133
+ self.cjson = attributes[:'cjson']
134
+ end
135
+
136
+ if attributes.key?(:'container_id')
137
+ self.container_id = attributes[:'container_id']
138
+ end
139
+
140
+ if attributes.key?(:'container_name')
141
+ self.container_name = attributes[:'container_name']
142
+ end
143
+
144
+ if attributes.key?(:'hash_sha256')
145
+ self.hash_sha256 = attributes[:'hash_sha256']
146
+ end
147
+
148
+ if attributes.key?(:'last_modified')
149
+ self.last_modified = attributes[:'last_modified']
150
+ end
151
+
152
+ if attributes.key?(:'owner_object_id')
153
+ self.owner_object_id = attributes[:'owner_object_id']
154
+ end
155
+
156
+ if attributes.key?(:'owner_type')
157
+ self.owner_type = attributes[:'owner_type']
158
+ end
159
+
160
+ if attributes.key?(:'path')
161
+ self.path = attributes[:'path']
162
+ end
163
+
164
+ if attributes.key?(:'version')
165
+ self.version = attributes[:'version']
166
+ end
167
+ end
168
+
169
+ # Show invalid properties with the reasons. Usually used together with valid?
170
+ # @return Array for valid properties with the reasons
171
+ def list_invalid_properties
172
+ invalid_properties = Array.new
173
+ invalid_properties
174
+ end
175
+
176
+ # Check to see if the all the properties in the model are valid
177
+ # @return true if the model is valid
178
+ def valid?
179
+ owner_type_validator = EnumAttributeValidator.new('String', ["theme", "page", "item", "upsell", "email", "postcard"])
180
+ return false unless owner_type_validator.valid?(@owner_type)
181
+ true
182
+ end
183
+
184
+ # Custom attribute writer method checking allowed values (enum).
185
+ # @param [Object] owner_type Object to be assigned
186
+ def owner_type=(owner_type)
187
+ validator = EnumAttributeValidator.new('String', ["theme", "page", "item", "upsell", "email", "postcard"])
188
+ unless validator.valid?(owner_type)
189
+ fail ArgumentError, "invalid value for \"owner_type\", must be one of #{validator.allowable_values}."
190
+ end
191
+ @owner_type = owner_type
192
+ end
193
+
194
+ # Checks equality by comparing each attribute.
195
+ # @param [Object] Object to be compared
196
+ def ==(o)
197
+ return true if self.equal?(o)
198
+ self.class == o.class &&
199
+ active_theme == o.active_theme &&
200
+ cjson == o.cjson &&
201
+ container_id == o.container_id &&
202
+ container_name == o.container_name &&
203
+ hash_sha256 == o.hash_sha256 &&
204
+ last_modified == o.last_modified &&
205
+ owner_object_id == o.owner_object_id &&
206
+ owner_type == o.owner_type &&
207
+ path == o.path &&
208
+ version == o.version
209
+ end
210
+
211
+ # @see the `==` method
212
+ # @param [Object] Object to be compared
213
+ def eql?(o)
214
+ self == o
215
+ end
216
+
217
+ # Calculates hash code according to all attributes.
218
+ # @return [Integer] Hash code
219
+ def hash
220
+ [active_theme, cjson, container_id, container_name, hash_sha256, last_modified, owner_object_id, owner_type, path, version].hash
221
+ end
222
+
223
+ # Builds the object from hash
224
+ # @param [Hash] attributes Model attributes in the form of hash
225
+ # @return [Object] Returns the model itself
226
+ def self.build_from_hash(attributes)
227
+ new.build_from_hash(attributes)
228
+ end
229
+
230
+ # Builds the object from hash
231
+ # @param [Hash] attributes Model attributes in the form of hash
232
+ # @return [Object] Returns the model itself
233
+ def build_from_hash(attributes)
234
+ return nil unless attributes.is_a?(Hash)
235
+ attributes = attributes.transform_keys(&:to_sym)
236
+ self.class.openapi_types.each_pair do |key, type|
237
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
238
+ self.send("#{key}=", nil)
239
+ elsif type =~ /\AArray<(.*)>/i
240
+ # check to ensure the input is an array given that the attribute
241
+ # is documented as an array but the input is not
242
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
243
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
244
+ end
245
+ elsif !attributes[self.class.attribute_map[key]].nil?
246
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
247
+ end
248
+ end
249
+
250
+ self
251
+ end
252
+
253
+ # Deserializes the data based on type
254
+ # @param string type Data type
255
+ # @param string value Value to be deserialized
256
+ # @return [Object] Deserialized data
257
+ def _deserialize(type, value)
258
+ case type.to_sym
259
+ when :Time
260
+ Time.parse(value)
261
+ when :Date
262
+ Date.parse(value)
263
+ when :String
264
+ value.to_s
265
+ when :Integer
266
+ value.to_i
267
+ when :Float
268
+ value.to_f
269
+ when :Boolean
270
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
271
+ true
272
+ else
273
+ false
274
+ end
275
+ when :Object
276
+ # generic object (usually a Hash), return directly
277
+ value
278
+ when /\AArray<(?<inner_type>.+)>\z/
279
+ inner_type = Regexp.last_match[:inner_type]
280
+ value.map { |v| _deserialize(inner_type, v) }
281
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
282
+ k_type = Regexp.last_match[:k_type]
283
+ v_type = Regexp.last_match[:v_type]
284
+ {}.tap do |hash|
285
+ value.each do |k, v|
286
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
287
+ end
288
+ end
289
+ else # model
290
+ # models (e.g. Pet) or oneOf
291
+ klass = UltracartClient.const_get(type)
292
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
293
+ end
294
+ end
295
+
296
+ # Returns the string representation of the object
297
+ # @return [String] String presentation of the object
298
+ def to_s
299
+ to_hash.to_s
300
+ end
301
+
302
+ # to_body is an alias to to_hash (backward compatibility)
303
+ # @return [Hash] Returns the object in the form of hash
304
+ def to_body
305
+ to_hash
306
+ end
307
+
308
+ # Returns the object in the form of hash
309
+ # @return [Hash] Returns the object in the form of hash
310
+ def to_hash
311
+ hash = {}
312
+ self.class.attribute_map.each_pair do |attr, param|
313
+ value = self.send(attr)
314
+ if value.nil?
315
+ is_nullable = self.class.openapi_nullable.include?(attr)
316
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
317
+ end
318
+
319
+ hash[param] = _to_hash(value)
320
+ end
321
+ hash
322
+ end
323
+
324
+ # Outputs non-array value in the form of hash
325
+ # For object, use to_hash. Otherwise, just return the value
326
+ # @param [Object] value Any valid value
327
+ # @return [Hash] Returns the value in the form of hash
328
+ def _to_hash(value)
329
+ if value.is_a?(Array)
330
+ value.compact.map { |v| _to_hash(v) }
331
+ elsif value.is_a?(Hash)
332
+ {}.tap do |hash|
333
+ value.each { |k, v| hash[k] = _to_hash(v) }
334
+ end
335
+ elsif value.respond_to? :to_hash
336
+ value.to_hash
337
+ else
338
+ value
339
+ end
340
+ end
341
+
342
+ end
343
+
344
+ end