ultracart_api 4.0.63.rc → 4.0.65.rc

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 ConversationMessagesResponse
18
+ attr_accessor :conversation_messages
19
+
20
+ attr_accessor :error
21
+
22
+ attr_accessor :metadata
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
+ :'conversation_messages' => :'conversation_messages',
33
+ :'error' => :'error',
34
+ :'metadata' => :'metadata',
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
+ :'conversation_messages' => :'Array<ConversationMessage>',
49
+ :'error' => :'Error',
50
+ :'metadata' => :'ResponseMetadata',
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::ConversationMessagesResponse` 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::ConversationMessagesResponse`. 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?(:'conversation_messages')
78
+ if (value = attributes[:'conversation_messages']).is_a?(Array)
79
+ self.conversation_messages = value
80
+ end
81
+ end
82
+
83
+ if attributes.key?(:'error')
84
+ self.error = attributes[:'error']
85
+ end
86
+
87
+ if attributes.key?(:'metadata')
88
+ self.metadata = attributes[:'metadata']
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
+ conversation_messages == o.conversation_messages &&
119
+ error == o.error &&
120
+ metadata == o.metadata &&
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
+ [conversation_messages, error, metadata, 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,29 +15,44 @@ require 'time'
15
15
 
16
16
  module UltracartClient
17
17
  class ItemDigitalItem
18
+ # Click wrap agreement is presented to the customer before they can purchase your product.
19
+ attr_accessor :click_wrap_agreement
20
+
18
21
  # File creation date
19
22
  attr_accessor :creation_dts
20
23
 
21
24
  # Description of the digital item
22
25
  attr_accessor :description
23
26
 
27
+ # The Digital item oid is a primary key used internally by UltraCart. You should not set or change this value. Doing so will have no effect.
28
+ attr_accessor :digital_item_oid
29
+
24
30
  # File size
25
31
  attr_accessor :file_size
26
32
 
33
+ # This url is sourced to create or update a digital file in your digital library. It is only considered during an insert or update operation.
34
+ attr_accessor :import_from_url
35
+
27
36
  # Mime type associated with the file
28
37
  attr_accessor :mime_type
29
38
 
30
39
  # Original filename
31
40
  attr_accessor :original_filename
32
41
 
42
+ attr_accessor :pdf_meta
43
+
33
44
  # Attribute mapping from ruby-style variable name to JSON key.
34
45
  def self.attribute_map
35
46
  {
47
+ :'click_wrap_agreement' => :'click_wrap_agreement',
36
48
  :'creation_dts' => :'creation_dts',
37
49
  :'description' => :'description',
50
+ :'digital_item_oid' => :'digital_item_oid',
38
51
  :'file_size' => :'file_size',
52
+ :'import_from_url' => :'import_from_url',
39
53
  :'mime_type' => :'mime_type',
40
- :'original_filename' => :'original_filename'
54
+ :'original_filename' => :'original_filename',
55
+ :'pdf_meta' => :'pdf_meta'
41
56
  }
42
57
  end
43
58
 
@@ -49,11 +64,15 @@ module UltracartClient
49
64
  # Attribute type mapping.
50
65
  def self.openapi_types
51
66
  {
67
+ :'click_wrap_agreement' => :'String',
52
68
  :'creation_dts' => :'String',
53
69
  :'description' => :'String',
70
+ :'digital_item_oid' => :'Integer',
54
71
  :'file_size' => :'Integer',
72
+ :'import_from_url' => :'String',
55
73
  :'mime_type' => :'String',
56
- :'original_filename' => :'String'
74
+ :'original_filename' => :'String',
75
+ :'pdf_meta' => :'ItemDigitalItemPdfMeta'
57
76
  }
58
77
  end
59
78
 
@@ -78,6 +97,10 @@ module UltracartClient
78
97
  h[k.to_sym] = v
79
98
  }
80
99
 
100
+ if attributes.key?(:'click_wrap_agreement')
101
+ self.click_wrap_agreement = attributes[:'click_wrap_agreement']
102
+ end
103
+
81
104
  if attributes.key?(:'creation_dts')
82
105
  self.creation_dts = attributes[:'creation_dts']
83
106
  end
@@ -86,10 +109,18 @@ module UltracartClient
86
109
  self.description = attributes[:'description']
87
110
  end
88
111
 
112
+ if attributes.key?(:'digital_item_oid')
113
+ self.digital_item_oid = attributes[:'digital_item_oid']
114
+ end
115
+
89
116
  if attributes.key?(:'file_size')
90
117
  self.file_size = attributes[:'file_size']
91
118
  end
92
119
 
120
+ if attributes.key?(:'import_from_url')
121
+ self.import_from_url = attributes[:'import_from_url']
122
+ end
123
+
93
124
  if attributes.key?(:'mime_type')
94
125
  self.mime_type = attributes[:'mime_type']
95
126
  end
@@ -97,6 +128,10 @@ module UltracartClient
97
128
  if attributes.key?(:'original_filename')
98
129
  self.original_filename = attributes[:'original_filename']
99
130
  end
131
+
132
+ if attributes.key?(:'pdf_meta')
133
+ self.pdf_meta = attributes[:'pdf_meta']
134
+ end
100
135
  end
101
136
 
102
137
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -162,11 +197,15 @@ module UltracartClient
162
197
  def ==(o)
163
198
  return true if self.equal?(o)
164
199
  self.class == o.class &&
200
+ click_wrap_agreement == o.click_wrap_agreement &&
165
201
  creation_dts == o.creation_dts &&
166
202
  description == o.description &&
203
+ digital_item_oid == o.digital_item_oid &&
167
204
  file_size == o.file_size &&
205
+ import_from_url == o.import_from_url &&
168
206
  mime_type == o.mime_type &&
169
- original_filename == o.original_filename
207
+ original_filename == o.original_filename &&
208
+ pdf_meta == o.pdf_meta
170
209
  end
171
210
 
172
211
  # @see the `==` method
@@ -178,7 +217,7 @@ module UltracartClient
178
217
  # Calculates hash code according to all attributes.
179
218
  # @return [Integer] Hash code
180
219
  def hash
181
- [creation_dts, description, file_size, mime_type, original_filename].hash
220
+ [click_wrap_agreement, creation_dts, description, digital_item_oid, file_size, import_from_url, mime_type, original_filename, pdf_meta].hash
182
221
  end
183
222
 
184
223
  # Builds the object from hash