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.
- checksums.yaml +4 -4
- data/README.md +87 -2
- data/docs/ChannelPartnerOrder.md +2 -0
- data/docs/ConversationApi.md +52 -0
- data/docs/ConversationPbxPayConnector.md +32 -0
- data/docs/ConversationPbxPayConnectorsResponse.md +26 -0
- data/docs/OrderChannelPartner.md +2 -0
- data/docs/SfvbApi.md +1933 -0
- data/docs/SfvbCompileRequest.md +26 -0
- data/docs/SfvbCompileResponse.md +28 -0
- data/docs/SfvbContainerResponse.md +36 -0
- data/docs/SfvbContainerRevertRequest.md +20 -0
- data/docs/SfvbContainerVersion.md +40 -0
- data/docs/SfvbContainerVersionsResponse.md +18 -0
- data/docs/SfvbContainerWriteRequest.md +24 -0
- data/docs/SfvbElement.md +20 -0
- data/docs/SfvbElementSchemaResponse.md +20 -0
- data/docs/SfvbElementsResponse.md +22 -0
- data/docs/SfvbErrorDetail.md +36 -0
- data/docs/SfvbFileContentResponse.md +38 -0
- data/docs/SfvbFileEntry.md +46 -0
- data/docs/SfvbFileRevertRequest.md +22 -0
- data/docs/SfvbFileSearchRequest.md +48 -0
- data/docs/SfvbFileSearchResponse.md +32 -0
- data/docs/SfvbFileVersion.md +34 -0
- data/docs/SfvbFileVersionsResponse.md +22 -0
- data/docs/SfvbFileWriteRequest.md +22 -0
- data/docs/SfvbFileWriteResponse.md +28 -0
- data/docs/SfvbFilesResponse.md +28 -0
- data/docs/SfvbLibraryEntry.md +38 -0
- data/docs/SfvbLibraryFacet.md +22 -0
- data/docs/SfvbLibraryResponse.md +28 -0
- data/docs/SfvbPreviewSessionRequest.md +20 -0
- data/docs/SfvbPreviewSessionResponse.md +30 -0
- data/docs/SfvbPreviewUrlResponse.md +30 -0
- data/docs/SfvbRenderRequest.md +40 -0
- data/docs/SfvbRenderResponse.md +28 -0
- data/docs/SfvbStorefront.md +22 -0
- data/docs/SfvbStorefrontsResponse.md +18 -0
- data/docs/SfvbTheme.md +36 -0
- data/docs/SfvbThemeDuplicateRequest.md +22 -0
- data/docs/SfvbThemeJobResponse.md +40 -0
- data/docs/SfvbThemesResponse.md +20 -0
- data/docs/SfvbUpsellOffer.md +34 -0
- data/docs/SfvbUpsellOffersResponse.md +18 -0
- data/docs/SfvbValidateRequest.md +26 -0
- data/docs/SfvbValidationResponse.md +24 -0
- data/docs/SfvbVelocityValidateRequest.md +20 -0
- data/docs/SfvbVersionResponse.md +36 -0
- data/docs/SfvbWhoamiResponse.md +36 -0
- data/docs/SfvbWidgetIdsResponse.md +22 -0
- data/lib/ultracart_api/api/conversation_api.rb +58 -0
- data/lib/ultracart_api/api/sfvb_api.rb +2565 -0
- data/lib/ultracart_api/models/channel_partner_order.rb +13 -1
- data/lib/ultracart_api/models/conversation_pbx_pay_connector.rb +426 -0
- data/lib/ultracart_api/models/conversation_pbx_pay_connectors_response.rb +258 -0
- data/lib/ultracart_api/models/order_channel_partner.rb +13 -1
- data/lib/ultracart_api/models/sfvb_compile_request.rb +260 -0
- data/lib/ultracart_api/models/sfvb_compile_response.rb +273 -0
- data/lib/ultracart_api/models/sfvb_container_response.rb +344 -0
- data/lib/ultracart_api/models/sfvb_container_revert_request.rb +230 -0
- data/lib/ultracart_api/models/sfvb_container_version.rb +376 -0
- data/lib/ultracart_api/models/sfvb_container_versions_response.rb +222 -0
- data/lib/ultracart_api/models/sfvb_container_write_request.rb +250 -0
- data/lib/ultracart_api/models/sfvb_element.rb +230 -0
- data/lib/ultracart_api/models/sfvb_element_schema_response.rb +230 -0
- data/lib/ultracart_api/models/sfvb_elements_response.rb +242 -0
- data/lib/ultracart_api/models/sfvb_error_detail.rb +346 -0
- data/lib/ultracart_api/models/sfvb_file_content_response.rb +320 -0
- data/lib/ultracart_api/models/sfvb_file_entry.rb +360 -0
- data/lib/ultracart_api/models/sfvb_file_revert_request.rb +240 -0
- data/lib/ultracart_api/models/sfvb_file_search_request.rb +370 -0
- data/lib/ultracart_api/models/sfvb_file_search_response.rb +292 -0
- data/lib/ultracart_api/models/sfvb_file_version.rb +300 -0
- data/lib/ultracart_api/models/sfvb_file_versions_response.rb +242 -0
- data/lib/ultracart_api/models/sfvb_file_write_request.rb +240 -0
- data/lib/ultracart_api/models/sfvb_file_write_response.rb +268 -0
- data/lib/ultracart_api/models/sfvb_files_response.rb +272 -0
- data/lib/ultracart_api/models/sfvb_library_entry.rb +322 -0
- data/lib/ultracart_api/models/sfvb_library_facet.rb +242 -0
- data/lib/ultracart_api/models/sfvb_library_response.rb +274 -0
- data/lib/ultracart_api/models/sfvb_preview_session_request.rb +230 -0
- data/lib/ultracart_api/models/sfvb_preview_session_response.rb +284 -0
- data/lib/ultracart_api/models/sfvb_preview_url_response.rb +280 -0
- data/lib/ultracart_api/models/sfvb_render_request.rb +330 -0
- data/lib/ultracart_api/models/sfvb_render_response.rb +274 -0
- data/lib/ultracart_api/models/sfvb_storefront.rb +240 -0
- data/lib/ultracart_api/models/sfvb_storefronts_response.rb +222 -0
- data/lib/ultracart_api/models/sfvb_theme.rb +310 -0
- data/lib/ultracart_api/models/sfvb_theme_duplicate_request.rb +240 -0
- data/lib/ultracart_api/models/sfvb_theme_job_response.rb +364 -0
- data/lib/ultracart_api/models/sfvb_themes_response.rb +232 -0
- data/lib/ultracart_api/models/sfvb_upsell_offer.rb +300 -0
- data/lib/ultracart_api/models/sfvb_upsell_offers_response.rb +222 -0
- data/lib/ultracart_api/models/sfvb_validate_request.rb +294 -0
- data/lib/ultracart_api/models/sfvb_validation_response.rb +256 -0
- data/lib/ultracart_api/models/sfvb_velocity_validate_request.rb +230 -0
- data/lib/ultracart_api/models/sfvb_version_response.rb +344 -0
- data/lib/ultracart_api/models/sfvb_whoami_response.rb +314 -0
- data/lib/ultracart_api/models/sfvb_widget_ids_response.rb +242 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +46 -0
- metadata +94 -2
|
@@ -0,0 +1,258 @@
|
|
|
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 ConversationPbxPayConnectorsResponse
|
|
18
|
+
attr_accessor :error
|
|
19
|
+
|
|
20
|
+
attr_accessor :metadata
|
|
21
|
+
|
|
22
|
+
attr_accessor :pay_connectors
|
|
23
|
+
|
|
24
|
+
# Indicates if API call was successful
|
|
25
|
+
attr_accessor :success
|
|
26
|
+
|
|
27
|
+
attr_accessor :warning
|
|
28
|
+
|
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
30
|
+
def self.attribute_map
|
|
31
|
+
{
|
|
32
|
+
:'error' => :'error',
|
|
33
|
+
:'metadata' => :'metadata',
|
|
34
|
+
:'pay_connectors' => :'pay_connectors',
|
|
35
|
+
:'success' => :'success',
|
|
36
|
+
:'warning' => :'warning'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Returns all the JSON keys this model knows about
|
|
41
|
+
def self.acceptable_attributes
|
|
42
|
+
attribute_map.values
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Attribute type mapping.
|
|
46
|
+
def self.openapi_types
|
|
47
|
+
{
|
|
48
|
+
:'error' => :'Error',
|
|
49
|
+
:'metadata' => :'ResponseMetadata',
|
|
50
|
+
:'pay_connectors' => :'Array<ConversationPbxPayConnector>',
|
|
51
|
+
:'success' => :'Boolean',
|
|
52
|
+
:'warning' => :'Warning'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# List of attributes with nullable: true
|
|
57
|
+
def self.openapi_nullable
|
|
58
|
+
Set.new([
|
|
59
|
+
])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Initializes the object
|
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
+
def initialize(attributes = {})
|
|
65
|
+
if (!attributes.is_a?(Hash))
|
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationPbxPayConnectorsResponse` initialize method"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
71
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationPbxPayConnectorsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
73
|
+
end
|
|
74
|
+
h[k.to_sym] = v
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'error')
|
|
78
|
+
self.error = attributes[:'error']
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
if attributes.key?(:'metadata')
|
|
82
|
+
self.metadata = attributes[:'metadata']
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
if attributes.key?(:'pay_connectors')
|
|
86
|
+
if (value = attributes[:'pay_connectors']).is_a?(Array)
|
|
87
|
+
self.pay_connectors = value
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
if attributes.key?(:'success')
|
|
92
|
+
self.success = attributes[:'success']
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'warning')
|
|
96
|
+
self.warning = attributes[:'warning']
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
101
|
+
# @return Array for valid properties with the reasons
|
|
102
|
+
def list_invalid_properties
|
|
103
|
+
invalid_properties = Array.new
|
|
104
|
+
invalid_properties
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Check to see if the all the properties in the model are valid
|
|
108
|
+
# @return true if the model is valid
|
|
109
|
+
def valid?
|
|
110
|
+
true
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Checks equality by comparing each attribute.
|
|
114
|
+
# @param [Object] Object to be compared
|
|
115
|
+
def ==(o)
|
|
116
|
+
return true if self.equal?(o)
|
|
117
|
+
self.class == o.class &&
|
|
118
|
+
error == o.error &&
|
|
119
|
+
metadata == o.metadata &&
|
|
120
|
+
pay_connectors == o.pay_connectors &&
|
|
121
|
+
success == o.success &&
|
|
122
|
+
warning == o.warning
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# @see the `==` method
|
|
126
|
+
# @param [Object] Object to be compared
|
|
127
|
+
def eql?(o)
|
|
128
|
+
self == o
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Calculates hash code according to all attributes.
|
|
132
|
+
# @return [Integer] Hash code
|
|
133
|
+
def hash
|
|
134
|
+
[error, metadata, pay_connectors, success, warning].hash
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Builds the object from hash
|
|
138
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
139
|
+
# @return [Object] Returns the model itself
|
|
140
|
+
def self.build_from_hash(attributes)
|
|
141
|
+
new.build_from_hash(attributes)
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Builds the object from hash
|
|
145
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
146
|
+
# @return [Object] Returns the model itself
|
|
147
|
+
def build_from_hash(attributes)
|
|
148
|
+
return nil unless attributes.is_a?(Hash)
|
|
149
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
150
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
151
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
152
|
+
self.send("#{key}=", nil)
|
|
153
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
154
|
+
# check to ensure the input is an array given that the attribute
|
|
155
|
+
# is documented as an array but the input is not
|
|
156
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
157
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
158
|
+
end
|
|
159
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
160
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
self
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Deserializes the data based on type
|
|
168
|
+
# @param string type Data type
|
|
169
|
+
# @param string value Value to be deserialized
|
|
170
|
+
# @return [Object] Deserialized data
|
|
171
|
+
def _deserialize(type, value)
|
|
172
|
+
case type.to_sym
|
|
173
|
+
when :Time
|
|
174
|
+
Time.parse(value)
|
|
175
|
+
when :Date
|
|
176
|
+
Date.parse(value)
|
|
177
|
+
when :String
|
|
178
|
+
value.to_s
|
|
179
|
+
when :Integer
|
|
180
|
+
value.to_i
|
|
181
|
+
when :Float
|
|
182
|
+
value.to_f
|
|
183
|
+
when :Boolean
|
|
184
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
185
|
+
true
|
|
186
|
+
else
|
|
187
|
+
false
|
|
188
|
+
end
|
|
189
|
+
when :Object
|
|
190
|
+
# generic object (usually a Hash), return directly
|
|
191
|
+
value
|
|
192
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
193
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
194
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
195
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
196
|
+
k_type = Regexp.last_match[:k_type]
|
|
197
|
+
v_type = Regexp.last_match[:v_type]
|
|
198
|
+
{}.tap do |hash|
|
|
199
|
+
value.each do |k, v|
|
|
200
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
else # model
|
|
204
|
+
# models (e.g. Pet) or oneOf
|
|
205
|
+
klass = UltracartClient.const_get(type)
|
|
206
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Returns the string representation of the object
|
|
211
|
+
# @return [String] String presentation of the object
|
|
212
|
+
def to_s
|
|
213
|
+
to_hash.to_s
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
217
|
+
# @return [Hash] Returns the object in the form of hash
|
|
218
|
+
def to_body
|
|
219
|
+
to_hash
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# Returns the object in the form of hash
|
|
223
|
+
# @return [Hash] Returns the object in the form of hash
|
|
224
|
+
def to_hash
|
|
225
|
+
hash = {}
|
|
226
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
227
|
+
value = self.send(attr)
|
|
228
|
+
if value.nil?
|
|
229
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
230
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
hash[param] = _to_hash(value)
|
|
234
|
+
end
|
|
235
|
+
hash
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# Outputs non-array value in the form of hash
|
|
239
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
240
|
+
# @param [Object] value Any valid value
|
|
241
|
+
# @return [Hash] Returns the value in the form of hash
|
|
242
|
+
def _to_hash(value)
|
|
243
|
+
if value.is_a?(Array)
|
|
244
|
+
value.compact.map { |v| _to_hash(v) }
|
|
245
|
+
elsif value.is_a?(Hash)
|
|
246
|
+
{}.tap do |hash|
|
|
247
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
248
|
+
end
|
|
249
|
+
elsif value.respond_to? :to_hash
|
|
250
|
+
value.to_hash
|
|
251
|
+
else
|
|
252
|
+
value
|
|
253
|
+
end
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
end
|
|
@@ -15,6 +15,9 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module UltracartClient
|
|
17
17
|
class OrderChannelPartner
|
|
18
|
+
# Names of pricing tiers to price this order against, without associating a customer profile. An unknown tier name will fail the import. An item that also supplies arbitrary_unit_cost keeps that cost and ignores the tier. If a customer profile is attached to this order during checkout, these tiers are granted to that profile permanently. Only applicable on inserting orders.
|
|
19
|
+
attr_accessor :arbitrary_pricing_tier_names
|
|
20
|
+
|
|
18
21
|
# If true, any purchase order submitted is automatically approved
|
|
19
22
|
attr_accessor :auto_approve_purchase_order
|
|
20
23
|
|
|
@@ -54,6 +57,7 @@ module UltracartClient
|
|
|
54
57
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
55
58
|
def self.attribute_map
|
|
56
59
|
{
|
|
60
|
+
:'arbitrary_pricing_tier_names' => :'arbitrary_pricing_tier_names',
|
|
57
61
|
:'auto_approve_purchase_order' => :'auto_approve_purchase_order',
|
|
58
62
|
:'channel_partner_code' => :'channel_partner_code',
|
|
59
63
|
:'channel_partner_data' => :'channel_partner_data',
|
|
@@ -77,6 +81,7 @@ module UltracartClient
|
|
|
77
81
|
# Attribute type mapping.
|
|
78
82
|
def self.openapi_types
|
|
79
83
|
{
|
|
84
|
+
:'arbitrary_pricing_tier_names' => :'Array<String>',
|
|
80
85
|
:'auto_approve_purchase_order' => :'Boolean',
|
|
81
86
|
:'channel_partner_code' => :'String',
|
|
82
87
|
:'channel_partner_data' => :'String',
|
|
@@ -113,6 +118,12 @@ module UltracartClient
|
|
|
113
118
|
h[k.to_sym] = v
|
|
114
119
|
}
|
|
115
120
|
|
|
121
|
+
if attributes.key?(:'arbitrary_pricing_tier_names')
|
|
122
|
+
if (value = attributes[:'arbitrary_pricing_tier_names']).is_a?(Array)
|
|
123
|
+
self.arbitrary_pricing_tier_names = value
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
|
|
116
127
|
if attributes.key?(:'auto_approve_purchase_order')
|
|
117
128
|
self.auto_approve_purchase_order = attributes[:'auto_approve_purchase_order']
|
|
118
129
|
end
|
|
@@ -195,6 +206,7 @@ module UltracartClient
|
|
|
195
206
|
def ==(o)
|
|
196
207
|
return true if self.equal?(o)
|
|
197
208
|
self.class == o.class &&
|
|
209
|
+
arbitrary_pricing_tier_names == o.arbitrary_pricing_tier_names &&
|
|
198
210
|
auto_approve_purchase_order == o.auto_approve_purchase_order &&
|
|
199
211
|
channel_partner_code == o.channel_partner_code &&
|
|
200
212
|
channel_partner_data == o.channel_partner_data &&
|
|
@@ -218,7 +230,7 @@ module UltracartClient
|
|
|
218
230
|
# Calculates hash code according to all attributes.
|
|
219
231
|
# @return [Integer] Hash code
|
|
220
232
|
def hash
|
|
221
|
-
[auto_approve_purchase_order, channel_partner_code, channel_partner_data, channel_partner_oid, channel_partner_order_id, ignore_invalid_shipping_method, no_realtime_payment_processing, skip_auto_order_setup, skip_payment_processing, store_completed, store_if_payment_declines, treat_warnings_as_errors].hash
|
|
233
|
+
[arbitrary_pricing_tier_names, auto_approve_purchase_order, channel_partner_code, channel_partner_data, channel_partner_oid, channel_partner_order_id, ignore_invalid_shipping_method, no_realtime_payment_processing, skip_auto_order_setup, skip_payment_processing, store_completed, store_if_payment_declines, treat_warnings_as_errors].hash
|
|
222
234
|
end
|
|
223
235
|
|
|
224
236
|
# Builds the object from hash
|
|
@@ -0,0 +1,260 @@
|
|
|
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 SfvbCompileRequest
|
|
18
|
+
# The container JSON to compile.
|
|
19
|
+
attr_accessor :cjson
|
|
20
|
+
|
|
21
|
+
# Optional container name, used to derive the container id the same way a .cjson file name would. Omit and the id on the document is kept.
|
|
22
|
+
attr_accessor :container_name
|
|
23
|
+
|
|
24
|
+
# Optional storefront oid. Required when theme_oid is supplied.
|
|
25
|
+
attr_accessor :storefront_oid
|
|
26
|
+
|
|
27
|
+
# Optional theme oid. Supplies the theme's inherit groups configuration so compilation matches what the theme would produce. Omit to compile without inheritance.
|
|
28
|
+
attr_accessor :theme_oid
|
|
29
|
+
|
|
30
|
+
# Run validation before compiling and fail on errors. Defaults to true.
|
|
31
|
+
attr_accessor :validate
|
|
32
|
+
|
|
33
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
34
|
+
def self.attribute_map
|
|
35
|
+
{
|
|
36
|
+
:'cjson' => :'cjson',
|
|
37
|
+
:'container_name' => :'containerName',
|
|
38
|
+
:'storefront_oid' => :'storefrontOid',
|
|
39
|
+
:'theme_oid' => :'themeOid',
|
|
40
|
+
:'validate' => :'validate'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Returns all the JSON keys this model knows about
|
|
45
|
+
def self.acceptable_attributes
|
|
46
|
+
attribute_map.values
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Attribute type mapping.
|
|
50
|
+
def self.openapi_types
|
|
51
|
+
{
|
|
52
|
+
:'cjson' => :'String',
|
|
53
|
+
:'container_name' => :'String',
|
|
54
|
+
:'storefront_oid' => :'Integer',
|
|
55
|
+
:'theme_oid' => :'Integer',
|
|
56
|
+
:'validate' => :'Boolean'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# List of attributes with nullable: true
|
|
61
|
+
def self.openapi_nullable
|
|
62
|
+
Set.new([
|
|
63
|
+
])
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Initializes the object
|
|
67
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
68
|
+
def initialize(attributes = {})
|
|
69
|
+
if (!attributes.is_a?(Hash))
|
|
70
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbCompileRequest` initialize method"
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
74
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
75
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
76
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbCompileRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
77
|
+
end
|
|
78
|
+
h[k.to_sym] = v
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if attributes.key?(:'cjson')
|
|
82
|
+
self.cjson = attributes[:'cjson']
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
if attributes.key?(:'container_name')
|
|
86
|
+
self.container_name = attributes[:'container_name']
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'storefront_oid')
|
|
90
|
+
self.storefront_oid = attributes[:'storefront_oid']
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
if attributes.key?(:'theme_oid')
|
|
94
|
+
self.theme_oid = attributes[:'theme_oid']
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
if attributes.key?(:'validate')
|
|
98
|
+
self.validate = attributes[:'validate']
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
103
|
+
# @return Array for valid properties with the reasons
|
|
104
|
+
def list_invalid_properties
|
|
105
|
+
invalid_properties = Array.new
|
|
106
|
+
invalid_properties
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Check to see if the all the properties in the model are valid
|
|
110
|
+
# @return true if the model is valid
|
|
111
|
+
def valid?
|
|
112
|
+
true
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Checks equality by comparing each attribute.
|
|
116
|
+
# @param [Object] Object to be compared
|
|
117
|
+
def ==(o)
|
|
118
|
+
return true if self.equal?(o)
|
|
119
|
+
self.class == o.class &&
|
|
120
|
+
cjson == o.cjson &&
|
|
121
|
+
container_name == o.container_name &&
|
|
122
|
+
storefront_oid == o.storefront_oid &&
|
|
123
|
+
theme_oid == o.theme_oid &&
|
|
124
|
+
validate == o.validate
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# @see the `==` method
|
|
128
|
+
# @param [Object] Object to be compared
|
|
129
|
+
def eql?(o)
|
|
130
|
+
self == o
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Calculates hash code according to all attributes.
|
|
134
|
+
# @return [Integer] Hash code
|
|
135
|
+
def hash
|
|
136
|
+
[cjson, container_name, storefront_oid, theme_oid, validate].hash
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Builds the object from hash
|
|
140
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
141
|
+
# @return [Object] Returns the model itself
|
|
142
|
+
def self.build_from_hash(attributes)
|
|
143
|
+
new.build_from_hash(attributes)
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Builds the object from hash
|
|
147
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
148
|
+
# @return [Object] Returns the model itself
|
|
149
|
+
def build_from_hash(attributes)
|
|
150
|
+
return nil unless attributes.is_a?(Hash)
|
|
151
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
152
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
153
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
154
|
+
self.send("#{key}=", nil)
|
|
155
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
156
|
+
# check to ensure the input is an array given that the attribute
|
|
157
|
+
# is documented as an array but the input is not
|
|
158
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
159
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
160
|
+
end
|
|
161
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
162
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
self
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Deserializes the data based on type
|
|
170
|
+
# @param string type Data type
|
|
171
|
+
# @param string value Value to be deserialized
|
|
172
|
+
# @return [Object] Deserialized data
|
|
173
|
+
def _deserialize(type, value)
|
|
174
|
+
case type.to_sym
|
|
175
|
+
when :Time
|
|
176
|
+
Time.parse(value)
|
|
177
|
+
when :Date
|
|
178
|
+
Date.parse(value)
|
|
179
|
+
when :String
|
|
180
|
+
value.to_s
|
|
181
|
+
when :Integer
|
|
182
|
+
value.to_i
|
|
183
|
+
when :Float
|
|
184
|
+
value.to_f
|
|
185
|
+
when :Boolean
|
|
186
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
187
|
+
true
|
|
188
|
+
else
|
|
189
|
+
false
|
|
190
|
+
end
|
|
191
|
+
when :Object
|
|
192
|
+
# generic object (usually a Hash), return directly
|
|
193
|
+
value
|
|
194
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
195
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
196
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
197
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
198
|
+
k_type = Regexp.last_match[:k_type]
|
|
199
|
+
v_type = Regexp.last_match[:v_type]
|
|
200
|
+
{}.tap do |hash|
|
|
201
|
+
value.each do |k, v|
|
|
202
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
else # model
|
|
206
|
+
# models (e.g. Pet) or oneOf
|
|
207
|
+
klass = UltracartClient.const_get(type)
|
|
208
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Returns the string representation of the object
|
|
213
|
+
# @return [String] String presentation of the object
|
|
214
|
+
def to_s
|
|
215
|
+
to_hash.to_s
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
219
|
+
# @return [Hash] Returns the object in the form of hash
|
|
220
|
+
def to_body
|
|
221
|
+
to_hash
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# Returns the object in the form of hash
|
|
225
|
+
# @return [Hash] Returns the object in the form of hash
|
|
226
|
+
def to_hash
|
|
227
|
+
hash = {}
|
|
228
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
229
|
+
value = self.send(attr)
|
|
230
|
+
if value.nil?
|
|
231
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
232
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
hash[param] = _to_hash(value)
|
|
236
|
+
end
|
|
237
|
+
hash
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
# Outputs non-array value in the form of hash
|
|
241
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
242
|
+
# @param [Object] value Any valid value
|
|
243
|
+
# @return [Hash] Returns the value in the form of hash
|
|
244
|
+
def _to_hash(value)
|
|
245
|
+
if value.is_a?(Array)
|
|
246
|
+
value.compact.map { |v| _to_hash(v) }
|
|
247
|
+
elsif value.is_a?(Hash)
|
|
248
|
+
{}.tap do |hash|
|
|
249
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
250
|
+
end
|
|
251
|
+
elsif value.respond_to? :to_hash
|
|
252
|
+
value.to_hash
|
|
253
|
+
else
|
|
254
|
+
value
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
end
|