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,222 @@
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 SfvbStorefrontsResponse
18
+ # Storefronts reachable with this token.
19
+ attr_accessor :storefronts
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'storefronts' => :'storefronts'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'storefronts' => :'Array<SfvbStorefront>'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbStorefrontsResponse` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbStorefrontsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'storefronts')
62
+ if (value = attributes[:'storefronts']).is_a?(Array)
63
+ self.storefronts = value
64
+ end
65
+ end
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properties with the reasons
70
+ def list_invalid_properties
71
+ invalid_properties = Array.new
72
+ invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ true
79
+ end
80
+
81
+ # Checks equality by comparing each attribute.
82
+ # @param [Object] Object to be compared
83
+ def ==(o)
84
+ return true if self.equal?(o)
85
+ self.class == o.class &&
86
+ storefronts == o.storefronts
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 [Integer] Hash code
97
+ def hash
98
+ [storefronts].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 self.build_from_hash(attributes)
105
+ new.build_from_hash(attributes)
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ attributes = attributes.transform_keys(&:to_sym)
114
+ self.class.openapi_types.each_pair do |key, type|
115
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
116
+ self.send("#{key}=", nil)
117
+ elsif type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
121
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
122
+ end
123
+ elsif !attributes[self.class.attribute_map[key]].nil?
124
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
125
+ end
126
+ end
127
+
128
+ self
129
+ end
130
+
131
+ # Deserializes the data based on type
132
+ # @param string type Data type
133
+ # @param string value Value to be deserialized
134
+ # @return [Object] Deserialized data
135
+ def _deserialize(type, value)
136
+ case type.to_sym
137
+ when :Time
138
+ Time.parse(value)
139
+ when :Date
140
+ Date.parse(value)
141
+ when :String
142
+ value.to_s
143
+ when :Integer
144
+ value.to_i
145
+ when :Float
146
+ value.to_f
147
+ when :Boolean
148
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
+ true
150
+ else
151
+ false
152
+ end
153
+ when :Object
154
+ # generic object (usually a Hash), return directly
155
+ value
156
+ when /\AArray<(?<inner_type>.+)>\z/
157
+ inner_type = Regexp.last_match[:inner_type]
158
+ value.map { |v| _deserialize(inner_type, v) }
159
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160
+ k_type = Regexp.last_match[:k_type]
161
+ v_type = Regexp.last_match[:v_type]
162
+ {}.tap do |hash|
163
+ value.each do |k, v|
164
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
+ end
166
+ end
167
+ else # model
168
+ # models (e.g. Pet) or oneOf
169
+ klass = UltracartClient.const_get(type)
170
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
171
+ end
172
+ end
173
+
174
+ # Returns the string representation of the object
175
+ # @return [String] String presentation of the object
176
+ def to_s
177
+ to_hash.to_s
178
+ end
179
+
180
+ # to_body is an alias to to_hash (backward compatibility)
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_body
183
+ to_hash
184
+ end
185
+
186
+ # Returns the object in the form of hash
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_hash
189
+ hash = {}
190
+ self.class.attribute_map.each_pair do |attr, param|
191
+ value = self.send(attr)
192
+ if value.nil?
193
+ is_nullable = self.class.openapi_nullable.include?(attr)
194
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
195
+ end
196
+
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ # Outputs non-array value in the form of hash
203
+ # For object, use to_hash. Otherwise, just return the value
204
+ # @param [Object] value Any valid value
205
+ # @return [Hash] Returns the value in the form of hash
206
+ def _to_hash(value)
207
+ if value.is_a?(Array)
208
+ value.compact.map { |v| _to_hash(v) }
209
+ elsif value.is_a?(Hash)
210
+ {}.tap do |hash|
211
+ value.each { |k, v| hash[k] = _to_hash(v) }
212
+ end
213
+ elsif value.respond_to? :to_hash
214
+ value.to_hash
215
+ else
216
+ value
217
+ end
218
+ end
219
+
220
+ end
221
+
222
+ end
@@ -0,0 +1,310 @@
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 SfvbTheme
18
+ # True when this theme is the one serving live traffic. Writing to an active theme requires the sfvb_publish scope.
19
+ attr_accessor :active
20
+
21
+ # What the theme is, where the author supplied a description.
22
+ attr_accessor :description
23
+
24
+ # Oid of the theme root directory in the storefront file system.
25
+ attr_accessor :fs_directory_oid
26
+
27
+ # Root path of the theme in the storefront file system, for example /themes/mytheme/
28
+ attr_accessor :path
29
+
30
+ # StoreFront oid this theme belongs to.
31
+ attr_accessor :storefront_oid
32
+
33
+ # Theme name.
34
+ attr_accessor :theme_name
35
+
36
+ # StoreFront theme oid.
37
+ attr_accessor :theme_oid
38
+
39
+ # True when a newer version of this theme exists. Relevant because an upgrade is what produces the merge conflicts that block activation.
40
+ attr_accessor :upgrade_available
41
+
42
+ # False when the theme contains templates that failed validation. Worth checking before choosing a theme to work in.
43
+ attr_accessor :valid
44
+
45
+ # Theme version.
46
+ attr_accessor :version
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'active' => :'active',
52
+ :'description' => :'description',
53
+ :'fs_directory_oid' => :'fsDirectoryOid',
54
+ :'path' => :'path',
55
+ :'storefront_oid' => :'storefrontOid',
56
+ :'theme_name' => :'themeName',
57
+ :'theme_oid' => :'themeOid',
58
+ :'upgrade_available' => :'upgradeAvailable',
59
+ :'valid' => :'valid',
60
+ :'version' => :'version'
61
+ }
62
+ end
63
+
64
+ # Returns all the JSON keys this model knows about
65
+ def self.acceptable_attributes
66
+ attribute_map.values
67
+ end
68
+
69
+ # Attribute type mapping.
70
+ def self.openapi_types
71
+ {
72
+ :'active' => :'Boolean',
73
+ :'description' => :'String',
74
+ :'fs_directory_oid' => :'Integer',
75
+ :'path' => :'String',
76
+ :'storefront_oid' => :'Integer',
77
+ :'theme_name' => :'String',
78
+ :'theme_oid' => :'Integer',
79
+ :'upgrade_available' => :'Boolean',
80
+ :'valid' => :'Boolean',
81
+ :'version' => :'String'
82
+ }
83
+ end
84
+
85
+ # List of attributes with nullable: true
86
+ def self.openapi_nullable
87
+ Set.new([
88
+ ])
89
+ end
90
+
91
+ # Initializes the object
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ def initialize(attributes = {})
94
+ if (!attributes.is_a?(Hash))
95
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbTheme` initialize method"
96
+ end
97
+
98
+ # check to see if the attribute exists and convert string to symbol for hash key
99
+ attributes = attributes.each_with_object({}) { |(k, v), h|
100
+ if (!self.class.attribute_map.key?(k.to_sym))
101
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbTheme`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
102
+ end
103
+ h[k.to_sym] = v
104
+ }
105
+
106
+ if attributes.key?(:'active')
107
+ self.active = attributes[:'active']
108
+ end
109
+
110
+ if attributes.key?(:'description')
111
+ self.description = attributes[:'description']
112
+ end
113
+
114
+ if attributes.key?(:'fs_directory_oid')
115
+ self.fs_directory_oid = attributes[:'fs_directory_oid']
116
+ end
117
+
118
+ if attributes.key?(:'path')
119
+ self.path = attributes[:'path']
120
+ end
121
+
122
+ if attributes.key?(:'storefront_oid')
123
+ self.storefront_oid = attributes[:'storefront_oid']
124
+ end
125
+
126
+ if attributes.key?(:'theme_name')
127
+ self.theme_name = attributes[:'theme_name']
128
+ end
129
+
130
+ if attributes.key?(:'theme_oid')
131
+ self.theme_oid = attributes[:'theme_oid']
132
+ end
133
+
134
+ if attributes.key?(:'upgrade_available')
135
+ self.upgrade_available = attributes[:'upgrade_available']
136
+ end
137
+
138
+ if attributes.key?(:'valid')
139
+ self.valid = attributes[:'valid']
140
+ end
141
+
142
+ if attributes.key?(:'version')
143
+ self.version = attributes[:'version']
144
+ end
145
+ end
146
+
147
+ # Show invalid properties with the reasons. Usually used together with valid?
148
+ # @return Array for valid properties with the reasons
149
+ def list_invalid_properties
150
+ invalid_properties = Array.new
151
+ invalid_properties
152
+ end
153
+
154
+ # Check to see if the all the properties in the model are valid
155
+ # @return true if the model is valid
156
+ def valid?
157
+ true
158
+ end
159
+
160
+ # Checks equality by comparing each attribute.
161
+ # @param [Object] Object to be compared
162
+ def ==(o)
163
+ return true if self.equal?(o)
164
+ self.class == o.class &&
165
+ active == o.active &&
166
+ description == o.description &&
167
+ fs_directory_oid == o.fs_directory_oid &&
168
+ path == o.path &&
169
+ storefront_oid == o.storefront_oid &&
170
+ theme_name == o.theme_name &&
171
+ theme_oid == o.theme_oid &&
172
+ upgrade_available == o.upgrade_available &&
173
+ valid == o.valid &&
174
+ version == o.version
175
+ end
176
+
177
+ # @see the `==` method
178
+ # @param [Object] Object to be compared
179
+ def eql?(o)
180
+ self == o
181
+ end
182
+
183
+ # Calculates hash code according to all attributes.
184
+ # @return [Integer] Hash code
185
+ def hash
186
+ [active, description, fs_directory_oid, path, storefront_oid, theme_name, theme_oid, upgrade_available, valid, version].hash
187
+ end
188
+
189
+ # Builds the object from hash
190
+ # @param [Hash] attributes Model attributes in the form of hash
191
+ # @return [Object] Returns the model itself
192
+ def self.build_from_hash(attributes)
193
+ new.build_from_hash(attributes)
194
+ end
195
+
196
+ # Builds the object from hash
197
+ # @param [Hash] attributes Model attributes in the form of hash
198
+ # @return [Object] Returns the model itself
199
+ def build_from_hash(attributes)
200
+ return nil unless attributes.is_a?(Hash)
201
+ attributes = attributes.transform_keys(&:to_sym)
202
+ self.class.openapi_types.each_pair do |key, type|
203
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
204
+ self.send("#{key}=", nil)
205
+ elsif type =~ /\AArray<(.*)>/i
206
+ # check to ensure the input is an array given that the attribute
207
+ # is documented as an array but the input is not
208
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
209
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
210
+ end
211
+ elsif !attributes[self.class.attribute_map[key]].nil?
212
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
213
+ end
214
+ end
215
+
216
+ self
217
+ end
218
+
219
+ # Deserializes the data based on type
220
+ # @param string type Data type
221
+ # @param string value Value to be deserialized
222
+ # @return [Object] Deserialized data
223
+ def _deserialize(type, value)
224
+ case type.to_sym
225
+ when :Time
226
+ Time.parse(value)
227
+ when :Date
228
+ Date.parse(value)
229
+ when :String
230
+ value.to_s
231
+ when :Integer
232
+ value.to_i
233
+ when :Float
234
+ value.to_f
235
+ when :Boolean
236
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
237
+ true
238
+ else
239
+ false
240
+ end
241
+ when :Object
242
+ # generic object (usually a Hash), return directly
243
+ value
244
+ when /\AArray<(?<inner_type>.+)>\z/
245
+ inner_type = Regexp.last_match[:inner_type]
246
+ value.map { |v| _deserialize(inner_type, v) }
247
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
248
+ k_type = Regexp.last_match[:k_type]
249
+ v_type = Regexp.last_match[:v_type]
250
+ {}.tap do |hash|
251
+ value.each do |k, v|
252
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
253
+ end
254
+ end
255
+ else # model
256
+ # models (e.g. Pet) or oneOf
257
+ klass = UltracartClient.const_get(type)
258
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
259
+ end
260
+ end
261
+
262
+ # Returns the string representation of the object
263
+ # @return [String] String presentation of the object
264
+ def to_s
265
+ to_hash.to_s
266
+ end
267
+
268
+ # to_body is an alias to to_hash (backward compatibility)
269
+ # @return [Hash] Returns the object in the form of hash
270
+ def to_body
271
+ to_hash
272
+ end
273
+
274
+ # Returns the object in the form of hash
275
+ # @return [Hash] Returns the object in the form of hash
276
+ def to_hash
277
+ hash = {}
278
+ self.class.attribute_map.each_pair do |attr, param|
279
+ value = self.send(attr)
280
+ if value.nil?
281
+ is_nullable = self.class.openapi_nullable.include?(attr)
282
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
283
+ end
284
+
285
+ hash[param] = _to_hash(value)
286
+ end
287
+ hash
288
+ end
289
+
290
+ # Outputs non-array value in the form of hash
291
+ # For object, use to_hash. Otherwise, just return the value
292
+ # @param [Object] value Any valid value
293
+ # @return [Hash] Returns the value in the form of hash
294
+ def _to_hash(value)
295
+ if value.is_a?(Array)
296
+ value.compact.map { |v| _to_hash(v) }
297
+ elsif value.is_a?(Hash)
298
+ {}.tap do |hash|
299
+ value.each { |k, v| hash[k] = _to_hash(v) }
300
+ end
301
+ elsif value.respond_to? :to_hash
302
+ value.to_hash
303
+ else
304
+ value
305
+ end
306
+ end
307
+
308
+ end
309
+
310
+ end