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,230 @@
|
|
|
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 SfvbContainerRevertRequest
|
|
18
|
+
# Optional comment recorded against the new version the revert creates.
|
|
19
|
+
attr_accessor :comment
|
|
20
|
+
|
|
21
|
+
# History record oid to restore, as returned by container_versions.
|
|
22
|
+
attr_accessor :container_history_oid
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'comment' => :'comment',
|
|
28
|
+
:'container_history_oid' => :'containerHistoryOid'
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns all the JSON keys this model knows about
|
|
33
|
+
def self.acceptable_attributes
|
|
34
|
+
attribute_map.values
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Attribute type mapping.
|
|
38
|
+
def self.openapi_types
|
|
39
|
+
{
|
|
40
|
+
:'comment' => :'String',
|
|
41
|
+
:'container_history_oid' => :'Integer'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# List of attributes with nullable: true
|
|
46
|
+
def self.openapi_nullable
|
|
47
|
+
Set.new([
|
|
48
|
+
])
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Initializes the object
|
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
53
|
+
def initialize(attributes = {})
|
|
54
|
+
if (!attributes.is_a?(Hash))
|
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbContainerRevertRequest` initialize method"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
60
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbContainerRevertRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
62
|
+
end
|
|
63
|
+
h[k.to_sym] = v
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if attributes.key?(:'comment')
|
|
67
|
+
self.comment = attributes[:'comment']
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'container_history_oid')
|
|
71
|
+
self.container_history_oid = attributes[:'container_history_oid']
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
76
|
+
# @return Array for valid properties with the reasons
|
|
77
|
+
def list_invalid_properties
|
|
78
|
+
invalid_properties = Array.new
|
|
79
|
+
invalid_properties
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Check to see if the all the properties in the model are valid
|
|
83
|
+
# @return true if the model is valid
|
|
84
|
+
def valid?
|
|
85
|
+
true
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Checks equality by comparing each attribute.
|
|
89
|
+
# @param [Object] Object to be compared
|
|
90
|
+
def ==(o)
|
|
91
|
+
return true if self.equal?(o)
|
|
92
|
+
self.class == o.class &&
|
|
93
|
+
comment == o.comment &&
|
|
94
|
+
container_history_oid == o.container_history_oid
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# @see the `==` method
|
|
98
|
+
# @param [Object] Object to be compared
|
|
99
|
+
def eql?(o)
|
|
100
|
+
self == o
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Calculates hash code according to all attributes.
|
|
104
|
+
# @return [Integer] Hash code
|
|
105
|
+
def hash
|
|
106
|
+
[comment, container_history_oid].hash
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Builds the object from hash
|
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
111
|
+
# @return [Object] Returns the model itself
|
|
112
|
+
def self.build_from_hash(attributes)
|
|
113
|
+
new.build_from_hash(attributes)
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Builds the object from hash
|
|
117
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
118
|
+
# @return [Object] Returns the model itself
|
|
119
|
+
def build_from_hash(attributes)
|
|
120
|
+
return nil unless attributes.is_a?(Hash)
|
|
121
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
122
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
123
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
124
|
+
self.send("#{key}=", nil)
|
|
125
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
126
|
+
# check to ensure the input is an array given that the attribute
|
|
127
|
+
# is documented as an array but the input is not
|
|
128
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
129
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
130
|
+
end
|
|
131
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
132
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
self
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Deserializes the data based on type
|
|
140
|
+
# @param string type Data type
|
|
141
|
+
# @param string value Value to be deserialized
|
|
142
|
+
# @return [Object] Deserialized data
|
|
143
|
+
def _deserialize(type, value)
|
|
144
|
+
case type.to_sym
|
|
145
|
+
when :Time
|
|
146
|
+
Time.parse(value)
|
|
147
|
+
when :Date
|
|
148
|
+
Date.parse(value)
|
|
149
|
+
when :String
|
|
150
|
+
value.to_s
|
|
151
|
+
when :Integer
|
|
152
|
+
value.to_i
|
|
153
|
+
when :Float
|
|
154
|
+
value.to_f
|
|
155
|
+
when :Boolean
|
|
156
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
157
|
+
true
|
|
158
|
+
else
|
|
159
|
+
false
|
|
160
|
+
end
|
|
161
|
+
when :Object
|
|
162
|
+
# generic object (usually a Hash), return directly
|
|
163
|
+
value
|
|
164
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
165
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
166
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
167
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
168
|
+
k_type = Regexp.last_match[:k_type]
|
|
169
|
+
v_type = Regexp.last_match[:v_type]
|
|
170
|
+
{}.tap do |hash|
|
|
171
|
+
value.each do |k, v|
|
|
172
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
else # model
|
|
176
|
+
# models (e.g. Pet) or oneOf
|
|
177
|
+
klass = UltracartClient.const_get(type)
|
|
178
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Returns the string representation of the object
|
|
183
|
+
# @return [String] String presentation of the object
|
|
184
|
+
def to_s
|
|
185
|
+
to_hash.to_s
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
189
|
+
# @return [Hash] Returns the object in the form of hash
|
|
190
|
+
def to_body
|
|
191
|
+
to_hash
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Returns the object in the form of hash
|
|
195
|
+
# @return [Hash] Returns the object in the form of hash
|
|
196
|
+
def to_hash
|
|
197
|
+
hash = {}
|
|
198
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
199
|
+
value = self.send(attr)
|
|
200
|
+
if value.nil?
|
|
201
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
202
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
hash[param] = _to_hash(value)
|
|
206
|
+
end
|
|
207
|
+
hash
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Outputs non-array value in the form of hash
|
|
211
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
212
|
+
# @param [Object] value Any valid value
|
|
213
|
+
# @return [Hash] Returns the value in the form of hash
|
|
214
|
+
def _to_hash(value)
|
|
215
|
+
if value.is_a?(Array)
|
|
216
|
+
value.compact.map { |v| _to_hash(v) }
|
|
217
|
+
elsif value.is_a?(Hash)
|
|
218
|
+
{}.tap do |hash|
|
|
219
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
220
|
+
end
|
|
221
|
+
elsif value.respond_to? :to_hash
|
|
222
|
+
value.to_hash
|
|
223
|
+
else
|
|
224
|
+
value
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
end
|
|
@@ -0,0 +1,376 @@
|
|
|
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 SfvbContainerVersion
|
|
18
|
+
# The CJSON this version held. Populated only when reading a single version, and null when the operation is create. Listings omit it because container CJSON is large.
|
|
19
|
+
attr_accessor :cjson
|
|
20
|
+
|
|
21
|
+
# Comment recorded with the write that replaced this version.
|
|
22
|
+
attr_accessor :comment
|
|
23
|
+
|
|
24
|
+
# History record oid. Pass to the revert operation on the owning container.
|
|
25
|
+
attr_accessor :container_history_oid
|
|
26
|
+
|
|
27
|
+
# Container name, where the owner has more than one container.
|
|
28
|
+
attr_accessor :container_name
|
|
29
|
+
|
|
30
|
+
# When this snapshot was taken.
|
|
31
|
+
attr_accessor :created_dts
|
|
32
|
+
|
|
33
|
+
# True for the value currently stored.
|
|
34
|
+
attr_accessor :current
|
|
35
|
+
|
|
36
|
+
# Login of whoever caused this snapshot.
|
|
37
|
+
attr_accessor :edited_by
|
|
38
|
+
|
|
39
|
+
# SHA-256 of this version's CJSON.
|
|
40
|
+
attr_accessor :hash_sha256
|
|
41
|
+
|
|
42
|
+
# What the container was before the write this entry precedes. create means it did not exist, so reverting to this entry removes it again; update means it held the cjson recorded here.
|
|
43
|
+
attr_accessor :operation
|
|
44
|
+
|
|
45
|
+
# Owner object identifier.
|
|
46
|
+
attr_accessor :owner_object_id
|
|
47
|
+
|
|
48
|
+
# Owner type.
|
|
49
|
+
attr_accessor :owner_type
|
|
50
|
+
|
|
51
|
+
# Size of this version's CJSON in bytes.
|
|
52
|
+
attr_accessor :size
|
|
53
|
+
|
|
54
|
+
class EnumAttributeValidator
|
|
55
|
+
attr_reader :datatype
|
|
56
|
+
attr_reader :allowable_values
|
|
57
|
+
|
|
58
|
+
def initialize(datatype, allowable_values)
|
|
59
|
+
@allowable_values = allowable_values.map do |value|
|
|
60
|
+
case datatype.to_s
|
|
61
|
+
when /Integer/i
|
|
62
|
+
value.to_i
|
|
63
|
+
when /Float/i
|
|
64
|
+
value.to_f
|
|
65
|
+
else
|
|
66
|
+
value
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def valid?(value)
|
|
72
|
+
!value || allowable_values.include?(value)
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
77
|
+
def self.attribute_map
|
|
78
|
+
{
|
|
79
|
+
:'cjson' => :'cjson',
|
|
80
|
+
:'comment' => :'comment',
|
|
81
|
+
:'container_history_oid' => :'containerHistoryOid',
|
|
82
|
+
:'container_name' => :'containerName',
|
|
83
|
+
:'created_dts' => :'createdDts',
|
|
84
|
+
:'current' => :'current',
|
|
85
|
+
:'edited_by' => :'editedBy',
|
|
86
|
+
:'hash_sha256' => :'hashSha256',
|
|
87
|
+
:'operation' => :'operation',
|
|
88
|
+
:'owner_object_id' => :'ownerObjectId',
|
|
89
|
+
:'owner_type' => :'ownerType',
|
|
90
|
+
:'size' => :'size'
|
|
91
|
+
}
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Returns all the JSON keys this model knows about
|
|
95
|
+
def self.acceptable_attributes
|
|
96
|
+
attribute_map.values
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Attribute type mapping.
|
|
100
|
+
def self.openapi_types
|
|
101
|
+
{
|
|
102
|
+
:'cjson' => :'String',
|
|
103
|
+
:'comment' => :'String',
|
|
104
|
+
:'container_history_oid' => :'Integer',
|
|
105
|
+
:'container_name' => :'String',
|
|
106
|
+
:'created_dts' => :'String',
|
|
107
|
+
:'current' => :'Boolean',
|
|
108
|
+
:'edited_by' => :'String',
|
|
109
|
+
:'hash_sha256' => :'String',
|
|
110
|
+
:'operation' => :'String',
|
|
111
|
+
:'owner_object_id' => :'String',
|
|
112
|
+
:'owner_type' => :'String',
|
|
113
|
+
:'size' => :'Integer'
|
|
114
|
+
}
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# List of attributes with nullable: true
|
|
118
|
+
def self.openapi_nullable
|
|
119
|
+
Set.new([
|
|
120
|
+
])
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Initializes the object
|
|
124
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
125
|
+
def initialize(attributes = {})
|
|
126
|
+
if (!attributes.is_a?(Hash))
|
|
127
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbContainerVersion` initialize method"
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
131
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
132
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
133
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbContainerVersion`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
134
|
+
end
|
|
135
|
+
h[k.to_sym] = v
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'cjson')
|
|
139
|
+
self.cjson = attributes[:'cjson']
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if attributes.key?(:'comment')
|
|
143
|
+
self.comment = attributes[:'comment']
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if attributes.key?(:'container_history_oid')
|
|
147
|
+
self.container_history_oid = attributes[:'container_history_oid']
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
if attributes.key?(:'container_name')
|
|
151
|
+
self.container_name = attributes[:'container_name']
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
if attributes.key?(:'created_dts')
|
|
155
|
+
self.created_dts = attributes[:'created_dts']
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
if attributes.key?(:'current')
|
|
159
|
+
self.current = attributes[:'current']
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if attributes.key?(:'edited_by')
|
|
163
|
+
self.edited_by = attributes[:'edited_by']
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
if attributes.key?(:'hash_sha256')
|
|
167
|
+
self.hash_sha256 = attributes[:'hash_sha256']
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
if attributes.key?(:'operation')
|
|
171
|
+
self.operation = attributes[:'operation']
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if attributes.key?(:'owner_object_id')
|
|
175
|
+
self.owner_object_id = attributes[:'owner_object_id']
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
if attributes.key?(:'owner_type')
|
|
179
|
+
self.owner_type = attributes[:'owner_type']
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
if attributes.key?(:'size')
|
|
183
|
+
self.size = attributes[:'size']
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
188
|
+
# @return Array for valid properties with the reasons
|
|
189
|
+
def list_invalid_properties
|
|
190
|
+
invalid_properties = Array.new
|
|
191
|
+
invalid_properties
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Check to see if the all the properties in the model are valid
|
|
195
|
+
# @return true if the model is valid
|
|
196
|
+
def valid?
|
|
197
|
+
operation_validator = EnumAttributeValidator.new('String', ["create", "update"])
|
|
198
|
+
return false unless operation_validator.valid?(@operation)
|
|
199
|
+
owner_type_validator = EnumAttributeValidator.new('String', ["item", "upsell", "email", "postcardfront", "postcardback"])
|
|
200
|
+
return false unless owner_type_validator.valid?(@owner_type)
|
|
201
|
+
true
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
205
|
+
# @param [Object] operation Object to be assigned
|
|
206
|
+
def operation=(operation)
|
|
207
|
+
validator = EnumAttributeValidator.new('String', ["create", "update"])
|
|
208
|
+
unless validator.valid?(operation)
|
|
209
|
+
fail ArgumentError, "invalid value for \"operation\", must be one of #{validator.allowable_values}."
|
|
210
|
+
end
|
|
211
|
+
@operation = operation
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
215
|
+
# @param [Object] owner_type Object to be assigned
|
|
216
|
+
def owner_type=(owner_type)
|
|
217
|
+
validator = EnumAttributeValidator.new('String', ["item", "upsell", "email", "postcardfront", "postcardback"])
|
|
218
|
+
unless validator.valid?(owner_type)
|
|
219
|
+
fail ArgumentError, "invalid value for \"owner_type\", must be one of #{validator.allowable_values}."
|
|
220
|
+
end
|
|
221
|
+
@owner_type = owner_type
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# Checks equality by comparing each attribute.
|
|
225
|
+
# @param [Object] Object to be compared
|
|
226
|
+
def ==(o)
|
|
227
|
+
return true if self.equal?(o)
|
|
228
|
+
self.class == o.class &&
|
|
229
|
+
cjson == o.cjson &&
|
|
230
|
+
comment == o.comment &&
|
|
231
|
+
container_history_oid == o.container_history_oid &&
|
|
232
|
+
container_name == o.container_name &&
|
|
233
|
+
created_dts == o.created_dts &&
|
|
234
|
+
current == o.current &&
|
|
235
|
+
edited_by == o.edited_by &&
|
|
236
|
+
hash_sha256 == o.hash_sha256 &&
|
|
237
|
+
operation == o.operation &&
|
|
238
|
+
owner_object_id == o.owner_object_id &&
|
|
239
|
+
owner_type == o.owner_type &&
|
|
240
|
+
size == o.size
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# @see the `==` method
|
|
244
|
+
# @param [Object] Object to be compared
|
|
245
|
+
def eql?(o)
|
|
246
|
+
self == o
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
# Calculates hash code according to all attributes.
|
|
250
|
+
# @return [Integer] Hash code
|
|
251
|
+
def hash
|
|
252
|
+
[cjson, comment, container_history_oid, container_name, created_dts, current, edited_by, hash_sha256, operation, owner_object_id, owner_type, size].hash
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# Builds the object from hash
|
|
256
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
257
|
+
# @return [Object] Returns the model itself
|
|
258
|
+
def self.build_from_hash(attributes)
|
|
259
|
+
new.build_from_hash(attributes)
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
# Builds the object from hash
|
|
263
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
264
|
+
# @return [Object] Returns the model itself
|
|
265
|
+
def build_from_hash(attributes)
|
|
266
|
+
return nil unless attributes.is_a?(Hash)
|
|
267
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
268
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
269
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
270
|
+
self.send("#{key}=", nil)
|
|
271
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
272
|
+
# check to ensure the input is an array given that the attribute
|
|
273
|
+
# is documented as an array but the input is not
|
|
274
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
275
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
276
|
+
end
|
|
277
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
278
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
279
|
+
end
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
self
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
# Deserializes the data based on type
|
|
286
|
+
# @param string type Data type
|
|
287
|
+
# @param string value Value to be deserialized
|
|
288
|
+
# @return [Object] Deserialized data
|
|
289
|
+
def _deserialize(type, value)
|
|
290
|
+
case type.to_sym
|
|
291
|
+
when :Time
|
|
292
|
+
Time.parse(value)
|
|
293
|
+
when :Date
|
|
294
|
+
Date.parse(value)
|
|
295
|
+
when :String
|
|
296
|
+
value.to_s
|
|
297
|
+
when :Integer
|
|
298
|
+
value.to_i
|
|
299
|
+
when :Float
|
|
300
|
+
value.to_f
|
|
301
|
+
when :Boolean
|
|
302
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
303
|
+
true
|
|
304
|
+
else
|
|
305
|
+
false
|
|
306
|
+
end
|
|
307
|
+
when :Object
|
|
308
|
+
# generic object (usually a Hash), return directly
|
|
309
|
+
value
|
|
310
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
311
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
312
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
313
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
314
|
+
k_type = Regexp.last_match[:k_type]
|
|
315
|
+
v_type = Regexp.last_match[:v_type]
|
|
316
|
+
{}.tap do |hash|
|
|
317
|
+
value.each do |k, v|
|
|
318
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
319
|
+
end
|
|
320
|
+
end
|
|
321
|
+
else # model
|
|
322
|
+
# models (e.g. Pet) or oneOf
|
|
323
|
+
klass = UltracartClient.const_get(type)
|
|
324
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
325
|
+
end
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
# Returns the string representation of the object
|
|
329
|
+
# @return [String] String presentation of the object
|
|
330
|
+
def to_s
|
|
331
|
+
to_hash.to_s
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
335
|
+
# @return [Hash] Returns the object in the form of hash
|
|
336
|
+
def to_body
|
|
337
|
+
to_hash
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
# Returns the object in the form of hash
|
|
341
|
+
# @return [Hash] Returns the object in the form of hash
|
|
342
|
+
def to_hash
|
|
343
|
+
hash = {}
|
|
344
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
345
|
+
value = self.send(attr)
|
|
346
|
+
if value.nil?
|
|
347
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
348
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
hash[param] = _to_hash(value)
|
|
352
|
+
end
|
|
353
|
+
hash
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
# Outputs non-array value in the form of hash
|
|
357
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
358
|
+
# @param [Object] value Any valid value
|
|
359
|
+
# @return [Hash] Returns the value in the form of hash
|
|
360
|
+
def _to_hash(value)
|
|
361
|
+
if value.is_a?(Array)
|
|
362
|
+
value.compact.map { |v| _to_hash(v) }
|
|
363
|
+
elsif value.is_a?(Hash)
|
|
364
|
+
{}.tap do |hash|
|
|
365
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
366
|
+
end
|
|
367
|
+
elsif value.respond_to? :to_hash
|
|
368
|
+
value.to_hash
|
|
369
|
+
else
|
|
370
|
+
value
|
|
371
|
+
end
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
end
|
|
375
|
+
|
|
376
|
+
end
|