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,280 @@
|
|
|
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 SfvbPreviewUrlResponse
|
|
18
|
+
# Seconds until the session expires.
|
|
19
|
+
attr_accessor :expires_in_seconds
|
|
20
|
+
|
|
21
|
+
# Storefront path being previewed.
|
|
22
|
+
attr_accessor :path
|
|
23
|
+
|
|
24
|
+
# The preview session id used.
|
|
25
|
+
attr_accessor :preview_session_id
|
|
26
|
+
|
|
27
|
+
# URL that renders the storefront page with the preview session's containers substituted for the stored ones.
|
|
28
|
+
attr_accessor :preview_url
|
|
29
|
+
|
|
30
|
+
# Always true. The preview only applies to a request carrying the UltraCart admin session cookie of the user who authorised this token. Fetched without it, the URL returns the LIVE page with a 200 and no error, so a successful fetch is not evidence the preview was applied. Present this URL for a human to open; do not fetch it.
|
|
31
|
+
attr_accessor :requires_browser_session
|
|
32
|
+
|
|
33
|
+
# Always false. The session is keyed by individual login, so anyone else opening this URL sees the live page rather than the preview.
|
|
34
|
+
attr_accessor :shareable
|
|
35
|
+
|
|
36
|
+
# Plain language restatement of the two flags above, safe to show a user.
|
|
37
|
+
attr_accessor :usage_note
|
|
38
|
+
|
|
39
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
40
|
+
def self.attribute_map
|
|
41
|
+
{
|
|
42
|
+
:'expires_in_seconds' => :'expiresInSeconds',
|
|
43
|
+
:'path' => :'path',
|
|
44
|
+
:'preview_session_id' => :'previewSessionId',
|
|
45
|
+
:'preview_url' => :'previewUrl',
|
|
46
|
+
:'requires_browser_session' => :'requiresBrowserSession',
|
|
47
|
+
:'shareable' => :'shareable',
|
|
48
|
+
:'usage_note' => :'usageNote'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Returns all the JSON keys this model knows about
|
|
53
|
+
def self.acceptable_attributes
|
|
54
|
+
attribute_map.values
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Attribute type mapping.
|
|
58
|
+
def self.openapi_types
|
|
59
|
+
{
|
|
60
|
+
:'expires_in_seconds' => :'Integer',
|
|
61
|
+
:'path' => :'String',
|
|
62
|
+
:'preview_session_id' => :'String',
|
|
63
|
+
:'preview_url' => :'String',
|
|
64
|
+
:'requires_browser_session' => :'Boolean',
|
|
65
|
+
:'shareable' => :'Boolean',
|
|
66
|
+
:'usage_note' => :'String'
|
|
67
|
+
}
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# List of attributes with nullable: true
|
|
71
|
+
def self.openapi_nullable
|
|
72
|
+
Set.new([
|
|
73
|
+
])
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Initializes the object
|
|
77
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
78
|
+
def initialize(attributes = {})
|
|
79
|
+
if (!attributes.is_a?(Hash))
|
|
80
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbPreviewUrlResponse` initialize method"
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
84
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
85
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
86
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbPreviewUrlResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
87
|
+
end
|
|
88
|
+
h[k.to_sym] = v
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if attributes.key?(:'expires_in_seconds')
|
|
92
|
+
self.expires_in_seconds = attributes[:'expires_in_seconds']
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'path')
|
|
96
|
+
self.path = attributes[:'path']
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'preview_session_id')
|
|
100
|
+
self.preview_session_id = attributes[:'preview_session_id']
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'preview_url')
|
|
104
|
+
self.preview_url = attributes[:'preview_url']
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'requires_browser_session')
|
|
108
|
+
self.requires_browser_session = attributes[:'requires_browser_session']
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'shareable')
|
|
112
|
+
self.shareable = attributes[:'shareable']
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.key?(:'usage_note')
|
|
116
|
+
self.usage_note = attributes[:'usage_note']
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
121
|
+
# @return Array for valid properties with the reasons
|
|
122
|
+
def list_invalid_properties
|
|
123
|
+
invalid_properties = Array.new
|
|
124
|
+
invalid_properties
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Check to see if the all the properties in the model are valid
|
|
128
|
+
# @return true if the model is valid
|
|
129
|
+
def valid?
|
|
130
|
+
true
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Checks equality by comparing each attribute.
|
|
134
|
+
# @param [Object] Object to be compared
|
|
135
|
+
def ==(o)
|
|
136
|
+
return true if self.equal?(o)
|
|
137
|
+
self.class == o.class &&
|
|
138
|
+
expires_in_seconds == o.expires_in_seconds &&
|
|
139
|
+
path == o.path &&
|
|
140
|
+
preview_session_id == o.preview_session_id &&
|
|
141
|
+
preview_url == o.preview_url &&
|
|
142
|
+
requires_browser_session == o.requires_browser_session &&
|
|
143
|
+
shareable == o.shareable &&
|
|
144
|
+
usage_note == o.usage_note
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# @see the `==` method
|
|
148
|
+
# @param [Object] Object to be compared
|
|
149
|
+
def eql?(o)
|
|
150
|
+
self == o
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Calculates hash code according to all attributes.
|
|
154
|
+
# @return [Integer] Hash code
|
|
155
|
+
def hash
|
|
156
|
+
[expires_in_seconds, path, preview_session_id, preview_url, requires_browser_session, shareable, usage_note].hash
|
|
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 self.build_from_hash(attributes)
|
|
163
|
+
new.build_from_hash(attributes)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Builds the object from hash
|
|
167
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
168
|
+
# @return [Object] Returns the model itself
|
|
169
|
+
def build_from_hash(attributes)
|
|
170
|
+
return nil unless attributes.is_a?(Hash)
|
|
171
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
172
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
173
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
174
|
+
self.send("#{key}=", nil)
|
|
175
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
176
|
+
# check to ensure the input is an array given that the attribute
|
|
177
|
+
# is documented as an array but the input is not
|
|
178
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
179
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
180
|
+
end
|
|
181
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
182
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
self
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Deserializes the data based on type
|
|
190
|
+
# @param string type Data type
|
|
191
|
+
# @param string value Value to be deserialized
|
|
192
|
+
# @return [Object] Deserialized data
|
|
193
|
+
def _deserialize(type, value)
|
|
194
|
+
case type.to_sym
|
|
195
|
+
when :Time
|
|
196
|
+
Time.parse(value)
|
|
197
|
+
when :Date
|
|
198
|
+
Date.parse(value)
|
|
199
|
+
when :String
|
|
200
|
+
value.to_s
|
|
201
|
+
when :Integer
|
|
202
|
+
value.to_i
|
|
203
|
+
when :Float
|
|
204
|
+
value.to_f
|
|
205
|
+
when :Boolean
|
|
206
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
207
|
+
true
|
|
208
|
+
else
|
|
209
|
+
false
|
|
210
|
+
end
|
|
211
|
+
when :Object
|
|
212
|
+
# generic object (usually a Hash), return directly
|
|
213
|
+
value
|
|
214
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
215
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
216
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
217
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
218
|
+
k_type = Regexp.last_match[:k_type]
|
|
219
|
+
v_type = Regexp.last_match[:v_type]
|
|
220
|
+
{}.tap do |hash|
|
|
221
|
+
value.each do |k, v|
|
|
222
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
223
|
+
end
|
|
224
|
+
end
|
|
225
|
+
else # model
|
|
226
|
+
# models (e.g. Pet) or oneOf
|
|
227
|
+
klass = UltracartClient.const_get(type)
|
|
228
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
229
|
+
end
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# Returns the string representation of the object
|
|
233
|
+
# @return [String] String presentation of the object
|
|
234
|
+
def to_s
|
|
235
|
+
to_hash.to_s
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
239
|
+
# @return [Hash] Returns the object in the form of hash
|
|
240
|
+
def to_body
|
|
241
|
+
to_hash
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# Returns the object in the form of hash
|
|
245
|
+
# @return [Hash] Returns the object in the form of hash
|
|
246
|
+
def to_hash
|
|
247
|
+
hash = {}
|
|
248
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
249
|
+
value = self.send(attr)
|
|
250
|
+
if value.nil?
|
|
251
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
252
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
hash[param] = _to_hash(value)
|
|
256
|
+
end
|
|
257
|
+
hash
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
# Outputs non-array value in the form of hash
|
|
261
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
262
|
+
# @param [Object] value Any valid value
|
|
263
|
+
# @return [Hash] Returns the value in the form of hash
|
|
264
|
+
def _to_hash(value)
|
|
265
|
+
if value.is_a?(Array)
|
|
266
|
+
value.compact.map { |v| _to_hash(v) }
|
|
267
|
+
elsif value.is_a?(Hash)
|
|
268
|
+
{}.tap do |hash|
|
|
269
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
270
|
+
end
|
|
271
|
+
elsif value.respond_to? :to_hash
|
|
272
|
+
value.to_hash
|
|
273
|
+
else
|
|
274
|
+
value
|
|
275
|
+
end
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
end
|
|
@@ -0,0 +1,330 @@
|
|
|
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 SfvbRenderRequest
|
|
18
|
+
# The chain of ancestor nodes above this one, as CJSON. Elements that inherit layout or styling from a parent render differently without it, so supply it when rendering a node from inside a container rather than a standalone fragment.
|
|
19
|
+
attr_accessor :ancestors_cjson
|
|
20
|
+
|
|
21
|
+
# Child containers this node references, as a JSON object keyed by container id. Compiled into the render context so nested containers resolve.
|
|
22
|
+
attr_accessor :child_containers_json
|
|
23
|
+
|
|
24
|
+
# The CJSON node to render.
|
|
25
|
+
attr_accessor :cjson
|
|
26
|
+
|
|
27
|
+
# Affiliate oid for the rendering context.
|
|
28
|
+
attr_accessor :context_affiliate_oid
|
|
29
|
+
|
|
30
|
+
# Blog post oid for the rendering context.
|
|
31
|
+
attr_accessor :context_blog_post_oid
|
|
32
|
+
|
|
33
|
+
# Catalog group path for the rendering context.
|
|
34
|
+
attr_accessor :context_group_path
|
|
35
|
+
|
|
36
|
+
# Item id for the rendering context. Required for item bound elements.
|
|
37
|
+
attr_accessor :context_item_id
|
|
38
|
+
|
|
39
|
+
# Order id for the rendering context.
|
|
40
|
+
attr_accessor :context_order_id
|
|
41
|
+
|
|
42
|
+
# Page number for paginated elements. Defaults to 1.
|
|
43
|
+
attr_accessor :context_page_number
|
|
44
|
+
|
|
45
|
+
# Upsell offer oid for the rendering context.
|
|
46
|
+
attr_accessor :context_upsell_offer_oid
|
|
47
|
+
|
|
48
|
+
# Language ISO code. Defaults to ENG.
|
|
49
|
+
attr_accessor :language_iso_code
|
|
50
|
+
|
|
51
|
+
# Storefront URI the node would appear on. Affects rendering of anything page relative.
|
|
52
|
+
attr_accessor :uri
|
|
53
|
+
|
|
54
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
55
|
+
def self.attribute_map
|
|
56
|
+
{
|
|
57
|
+
:'ancestors_cjson' => :'ancestorsCjson',
|
|
58
|
+
:'child_containers_json' => :'childContainersJson',
|
|
59
|
+
:'cjson' => :'cjson',
|
|
60
|
+
:'context_affiliate_oid' => :'contextAffiliateOid',
|
|
61
|
+
:'context_blog_post_oid' => :'contextBlogPostOid',
|
|
62
|
+
:'context_group_path' => :'contextGroupPath',
|
|
63
|
+
:'context_item_id' => :'contextItemId',
|
|
64
|
+
:'context_order_id' => :'contextOrderId',
|
|
65
|
+
:'context_page_number' => :'contextPageNumber',
|
|
66
|
+
:'context_upsell_offer_oid' => :'contextUpsellOfferOid',
|
|
67
|
+
:'language_iso_code' => :'languageIsoCode',
|
|
68
|
+
:'uri' => :'uri'
|
|
69
|
+
}
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Returns all the JSON keys this model knows about
|
|
73
|
+
def self.acceptable_attributes
|
|
74
|
+
attribute_map.values
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Attribute type mapping.
|
|
78
|
+
def self.openapi_types
|
|
79
|
+
{
|
|
80
|
+
:'ancestors_cjson' => :'String',
|
|
81
|
+
:'child_containers_json' => :'String',
|
|
82
|
+
:'cjson' => :'String',
|
|
83
|
+
:'context_affiliate_oid' => :'Integer',
|
|
84
|
+
:'context_blog_post_oid' => :'Integer',
|
|
85
|
+
:'context_group_path' => :'String',
|
|
86
|
+
:'context_item_id' => :'String',
|
|
87
|
+
:'context_order_id' => :'String',
|
|
88
|
+
:'context_page_number' => :'String',
|
|
89
|
+
:'context_upsell_offer_oid' => :'Integer',
|
|
90
|
+
:'language_iso_code' => :'String',
|
|
91
|
+
:'uri' => :'String'
|
|
92
|
+
}
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# List of attributes with nullable: true
|
|
96
|
+
def self.openapi_nullable
|
|
97
|
+
Set.new([
|
|
98
|
+
])
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Initializes the object
|
|
102
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
103
|
+
def initialize(attributes = {})
|
|
104
|
+
if (!attributes.is_a?(Hash))
|
|
105
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbRenderRequest` initialize method"
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
109
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
110
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
111
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbRenderRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
112
|
+
end
|
|
113
|
+
h[k.to_sym] = v
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'ancestors_cjson')
|
|
117
|
+
self.ancestors_cjson = attributes[:'ancestors_cjson']
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'child_containers_json')
|
|
121
|
+
self.child_containers_json = attributes[:'child_containers_json']
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'cjson')
|
|
125
|
+
self.cjson = attributes[:'cjson']
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'context_affiliate_oid')
|
|
129
|
+
self.context_affiliate_oid = attributes[:'context_affiliate_oid']
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'context_blog_post_oid')
|
|
133
|
+
self.context_blog_post_oid = attributes[:'context_blog_post_oid']
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'context_group_path')
|
|
137
|
+
self.context_group_path = attributes[:'context_group_path']
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if attributes.key?(:'context_item_id')
|
|
141
|
+
self.context_item_id = attributes[:'context_item_id']
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'context_order_id')
|
|
145
|
+
self.context_order_id = attributes[:'context_order_id']
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if attributes.key?(:'context_page_number')
|
|
149
|
+
self.context_page_number = attributes[:'context_page_number']
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if attributes.key?(:'context_upsell_offer_oid')
|
|
153
|
+
self.context_upsell_offer_oid = attributes[:'context_upsell_offer_oid']
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if attributes.key?(:'language_iso_code')
|
|
157
|
+
self.language_iso_code = attributes[:'language_iso_code']
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if attributes.key?(:'uri')
|
|
161
|
+
self.uri = attributes[:'uri']
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
166
|
+
# @return Array for valid properties with the reasons
|
|
167
|
+
def list_invalid_properties
|
|
168
|
+
invalid_properties = Array.new
|
|
169
|
+
invalid_properties
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Check to see if the all the properties in the model are valid
|
|
173
|
+
# @return true if the model is valid
|
|
174
|
+
def valid?
|
|
175
|
+
true
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Checks equality by comparing each attribute.
|
|
179
|
+
# @param [Object] Object to be compared
|
|
180
|
+
def ==(o)
|
|
181
|
+
return true if self.equal?(o)
|
|
182
|
+
self.class == o.class &&
|
|
183
|
+
ancestors_cjson == o.ancestors_cjson &&
|
|
184
|
+
child_containers_json == o.child_containers_json &&
|
|
185
|
+
cjson == o.cjson &&
|
|
186
|
+
context_affiliate_oid == o.context_affiliate_oid &&
|
|
187
|
+
context_blog_post_oid == o.context_blog_post_oid &&
|
|
188
|
+
context_group_path == o.context_group_path &&
|
|
189
|
+
context_item_id == o.context_item_id &&
|
|
190
|
+
context_order_id == o.context_order_id &&
|
|
191
|
+
context_page_number == o.context_page_number &&
|
|
192
|
+
context_upsell_offer_oid == o.context_upsell_offer_oid &&
|
|
193
|
+
language_iso_code == o.language_iso_code &&
|
|
194
|
+
uri == o.uri
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# @see the `==` method
|
|
198
|
+
# @param [Object] Object to be compared
|
|
199
|
+
def eql?(o)
|
|
200
|
+
self == o
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
# Calculates hash code according to all attributes.
|
|
204
|
+
# @return [Integer] Hash code
|
|
205
|
+
def hash
|
|
206
|
+
[ancestors_cjson, child_containers_json, cjson, context_affiliate_oid, context_blog_post_oid, context_group_path, context_item_id, context_order_id, context_page_number, context_upsell_offer_oid, language_iso_code, uri].hash
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
# Builds the object from hash
|
|
210
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
211
|
+
# @return [Object] Returns the model itself
|
|
212
|
+
def self.build_from_hash(attributes)
|
|
213
|
+
new.build_from_hash(attributes)
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Builds the object from hash
|
|
217
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
218
|
+
# @return [Object] Returns the model itself
|
|
219
|
+
def build_from_hash(attributes)
|
|
220
|
+
return nil unless attributes.is_a?(Hash)
|
|
221
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
222
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
223
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
224
|
+
self.send("#{key}=", nil)
|
|
225
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
226
|
+
# check to ensure the input is an array given that the attribute
|
|
227
|
+
# is documented as an array but the input is not
|
|
228
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
229
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
230
|
+
end
|
|
231
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
232
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
233
|
+
end
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
self
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# Deserializes the data based on type
|
|
240
|
+
# @param string type Data type
|
|
241
|
+
# @param string value Value to be deserialized
|
|
242
|
+
# @return [Object] Deserialized data
|
|
243
|
+
def _deserialize(type, value)
|
|
244
|
+
case type.to_sym
|
|
245
|
+
when :Time
|
|
246
|
+
Time.parse(value)
|
|
247
|
+
when :Date
|
|
248
|
+
Date.parse(value)
|
|
249
|
+
when :String
|
|
250
|
+
value.to_s
|
|
251
|
+
when :Integer
|
|
252
|
+
value.to_i
|
|
253
|
+
when :Float
|
|
254
|
+
value.to_f
|
|
255
|
+
when :Boolean
|
|
256
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
257
|
+
true
|
|
258
|
+
else
|
|
259
|
+
false
|
|
260
|
+
end
|
|
261
|
+
when :Object
|
|
262
|
+
# generic object (usually a Hash), return directly
|
|
263
|
+
value
|
|
264
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
265
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
266
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
267
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
268
|
+
k_type = Regexp.last_match[:k_type]
|
|
269
|
+
v_type = Regexp.last_match[:v_type]
|
|
270
|
+
{}.tap do |hash|
|
|
271
|
+
value.each do |k, v|
|
|
272
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
else # model
|
|
276
|
+
# models (e.g. Pet) or oneOf
|
|
277
|
+
klass = UltracartClient.const_get(type)
|
|
278
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
279
|
+
end
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
# Returns the string representation of the object
|
|
283
|
+
# @return [String] String presentation of the object
|
|
284
|
+
def to_s
|
|
285
|
+
to_hash.to_s
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
289
|
+
# @return [Hash] Returns the object in the form of hash
|
|
290
|
+
def to_body
|
|
291
|
+
to_hash
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
# Returns the object in the form of hash
|
|
295
|
+
# @return [Hash] Returns the object in the form of hash
|
|
296
|
+
def to_hash
|
|
297
|
+
hash = {}
|
|
298
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
299
|
+
value = self.send(attr)
|
|
300
|
+
if value.nil?
|
|
301
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
302
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
hash[param] = _to_hash(value)
|
|
306
|
+
end
|
|
307
|
+
hash
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
# Outputs non-array value in the form of hash
|
|
311
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
312
|
+
# @param [Object] value Any valid value
|
|
313
|
+
# @return [Hash] Returns the value in the form of hash
|
|
314
|
+
def _to_hash(value)
|
|
315
|
+
if value.is_a?(Array)
|
|
316
|
+
value.compact.map { |v| _to_hash(v) }
|
|
317
|
+
elsif value.is_a?(Hash)
|
|
318
|
+
{}.tap do |hash|
|
|
319
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
320
|
+
end
|
|
321
|
+
elsif value.respond_to? :to_hash
|
|
322
|
+
value.to_hash
|
|
323
|
+
else
|
|
324
|
+
value
|
|
325
|
+
end
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
end
|
|
329
|
+
|
|
330
|
+
end
|