ultracart_api 4.0.33.rc → 4.0.36.rc

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,292 @@
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 ConversationSummary
18
+ attr_accessor :conversation_arn
19
+
20
+ attr_accessor :conversation_uuid
21
+
22
+ attr_accessor :last_conversation_message_body
23
+
24
+ attr_accessor :last_conversation_participant_arn
25
+
26
+ attr_accessor :last_conversation_participant_name
27
+
28
+ # Last message date/time
29
+ attr_accessor :last_message_dts
30
+
31
+ attr_accessor :merchant_id
32
+
33
+ attr_accessor :message_count
34
+
35
+ attr_accessor :unread_messages
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'conversation_arn' => :'conversation_arn',
41
+ :'conversation_uuid' => :'conversation_uuid',
42
+ :'last_conversation_message_body' => :'last_conversation_message_body',
43
+ :'last_conversation_participant_arn' => :'last_conversation_participant_arn',
44
+ :'last_conversation_participant_name' => :'last_conversation_participant_name',
45
+ :'last_message_dts' => :'last_message_dts',
46
+ :'merchant_id' => :'merchant_id',
47
+ :'message_count' => :'message_count',
48
+ :'unread_messages' => :'unread_messages'
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
+ :'conversation_arn' => :'String',
61
+ :'conversation_uuid' => :'String',
62
+ :'last_conversation_message_body' => :'String',
63
+ :'last_conversation_participant_arn' => :'String',
64
+ :'last_conversation_participant_name' => :'String',
65
+ :'last_message_dts' => :'String',
66
+ :'merchant_id' => :'String',
67
+ :'message_count' => :'Integer',
68
+ :'unread_messages' => :'Boolean'
69
+ }
70
+ end
71
+
72
+ # List of attributes with nullable: true
73
+ def self.openapi_nullable
74
+ Set.new([
75
+ ])
76
+ end
77
+
78
+ # Initializes the object
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ def initialize(attributes = {})
81
+ if (!attributes.is_a?(Hash))
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationSummary` initialize method"
83
+ end
84
+
85
+ # check to see if the attribute exists and convert string to symbol for hash key
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!self.class.attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'conversation_arn')
94
+ self.conversation_arn = attributes[:'conversation_arn']
95
+ end
96
+
97
+ if attributes.key?(:'conversation_uuid')
98
+ self.conversation_uuid = attributes[:'conversation_uuid']
99
+ end
100
+
101
+ if attributes.key?(:'last_conversation_message_body')
102
+ self.last_conversation_message_body = attributes[:'last_conversation_message_body']
103
+ end
104
+
105
+ if attributes.key?(:'last_conversation_participant_arn')
106
+ self.last_conversation_participant_arn = attributes[:'last_conversation_participant_arn']
107
+ end
108
+
109
+ if attributes.key?(:'last_conversation_participant_name')
110
+ self.last_conversation_participant_name = attributes[:'last_conversation_participant_name']
111
+ end
112
+
113
+ if attributes.key?(:'last_message_dts')
114
+ self.last_message_dts = attributes[:'last_message_dts']
115
+ end
116
+
117
+ if attributes.key?(:'merchant_id')
118
+ self.merchant_id = attributes[:'merchant_id']
119
+ end
120
+
121
+ if attributes.key?(:'message_count')
122
+ self.message_count = attributes[:'message_count']
123
+ end
124
+
125
+ if attributes.key?(:'unread_messages')
126
+ self.unread_messages = attributes[:'unread_messages']
127
+ end
128
+ end
129
+
130
+ # Show invalid properties with the reasons. Usually used together with valid?
131
+ # @return Array for valid properties with the reasons
132
+ def list_invalid_properties
133
+ invalid_properties = Array.new
134
+ invalid_properties
135
+ end
136
+
137
+ # Check to see if the all the properties in the model are valid
138
+ # @return true if the model is valid
139
+ def valid?
140
+ true
141
+ end
142
+
143
+ # Checks equality by comparing each attribute.
144
+ # @param [Object] Object to be compared
145
+ def ==(o)
146
+ return true if self.equal?(o)
147
+ self.class == o.class &&
148
+ conversation_arn == o.conversation_arn &&
149
+ conversation_uuid == o.conversation_uuid &&
150
+ last_conversation_message_body == o.last_conversation_message_body &&
151
+ last_conversation_participant_arn == o.last_conversation_participant_arn &&
152
+ last_conversation_participant_name == o.last_conversation_participant_name &&
153
+ last_message_dts == o.last_message_dts &&
154
+ merchant_id == o.merchant_id &&
155
+ message_count == o.message_count &&
156
+ unread_messages == o.unread_messages
157
+ end
158
+
159
+ # @see the `==` method
160
+ # @param [Object] Object to be compared
161
+ def eql?(o)
162
+ self == o
163
+ end
164
+
165
+ # Calculates hash code according to all attributes.
166
+ # @return [Integer] Hash code
167
+ def hash
168
+ [conversation_arn, conversation_uuid, last_conversation_message_body, last_conversation_participant_arn, last_conversation_participant_name, last_message_dts, merchant_id, message_count, unread_messages].hash
169
+ end
170
+
171
+ # Builds the object from hash
172
+ # @param [Hash] attributes Model attributes in the form of hash
173
+ # @return [Object] Returns the model itself
174
+ def self.build_from_hash(attributes)
175
+ new.build_from_hash(attributes)
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ attributes = attributes.transform_keys(&:to_sym)
184
+ self.class.openapi_types.each_pair do |key, type|
185
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
186
+ self.send("#{key}=", nil)
187
+ elsif type =~ /\AArray<(.*)>/i
188
+ # check to ensure the input is an array given that the attribute
189
+ # is documented as an array but the input is not
190
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
191
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
192
+ end
193
+ elsif !attributes[self.class.attribute_map[key]].nil?
194
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
195
+ end
196
+ end
197
+
198
+ self
199
+ end
200
+
201
+ # Deserializes the data based on type
202
+ # @param string type Data type
203
+ # @param string value Value to be deserialized
204
+ # @return [Object] Deserialized data
205
+ def _deserialize(type, value)
206
+ case type.to_sym
207
+ when :Time
208
+ Time.parse(value)
209
+ when :Date
210
+ Date.parse(value)
211
+ when :String
212
+ value.to_s
213
+ when :Integer
214
+ value.to_i
215
+ when :Float
216
+ value.to_f
217
+ when :Boolean
218
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
219
+ true
220
+ else
221
+ false
222
+ end
223
+ when :Object
224
+ # generic object (usually a Hash), return directly
225
+ value
226
+ when /\AArray<(?<inner_type>.+)>\z/
227
+ inner_type = Regexp.last_match[:inner_type]
228
+ value.map { |v| _deserialize(inner_type, v) }
229
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
230
+ k_type = Regexp.last_match[:k_type]
231
+ v_type = Regexp.last_match[:v_type]
232
+ {}.tap do |hash|
233
+ value.each do |k, v|
234
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
235
+ end
236
+ end
237
+ else # model
238
+ # models (e.g. Pet) or oneOf
239
+ klass = UltracartClient.const_get(type)
240
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
241
+ end
242
+ end
243
+
244
+ # Returns the string representation of the object
245
+ # @return [String] String presentation of the object
246
+ def to_s
247
+ to_hash.to_s
248
+ end
249
+
250
+ # to_body is an alias to to_hash (backward compatibility)
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_body
253
+ to_hash
254
+ end
255
+
256
+ # Returns the object in the form of hash
257
+ # @return [Hash] Returns the object in the form of hash
258
+ def to_hash
259
+ hash = {}
260
+ self.class.attribute_map.each_pair do |attr, param|
261
+ value = self.send(attr)
262
+ if value.nil?
263
+ is_nullable = self.class.openapi_nullable.include?(attr)
264
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
265
+ end
266
+
267
+ hash[param] = _to_hash(value)
268
+ end
269
+ hash
270
+ end
271
+
272
+ # Outputs non-array value in the form of hash
273
+ # For object, use to_hash. Otherwise, just return the value
274
+ # @param [Object] value Any valid value
275
+ # @return [Hash] Returns the value in the form of hash
276
+ def _to_hash(value)
277
+ if value.is_a?(Array)
278
+ value.compact.map { |v| _to_hash(v) }
279
+ elsif value.is_a?(Hash)
280
+ {}.tap do |hash|
281
+ value.each { |k, v| hash[k] = _to_hash(v) }
282
+ end
283
+ elsif value.respond_to? :to_hash
284
+ value.to_hash
285
+ else
286
+ value
287
+ end
288
+ end
289
+
290
+ end
291
+
292
+ end
@@ -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 ConversationsResponse
18
+ attr_accessor :conversations
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
+ :'conversations' => :'conversations',
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
+ :'conversations' => :'Array<ConversationSummary>',
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::ConversationsResponse` 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::ConversationsResponse`. 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?(:'conversations')
78
+ if (value = attributes[:'conversations']).is_a?(Array)
79
+ self.conversations = 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
+ conversations == o.conversations &&
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
+ [conversations, 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
@@ -17,19 +17,31 @@ module UltracartClient
17
17
  class CustomerActivity
18
18
  attr_accessor :activities
19
19
 
20
+ attr_accessor :global_unsubscribed
21
+
22
+ attr_accessor :global_unsubscribed_dts
23
+
20
24
  attr_accessor :memberships
21
25
 
22
26
  attr_accessor :metrics
23
27
 
24
28
  attr_accessor :properties_list
25
29
 
30
+ attr_accessor :spam_complaint
31
+
32
+ attr_accessor :spam_complaint_dts
33
+
26
34
  # Attribute mapping from ruby-style variable name to JSON key.
27
35
  def self.attribute_map
28
36
  {
29
37
  :'activities' => :'activities',
38
+ :'global_unsubscribed' => :'global_unsubscribed',
39
+ :'global_unsubscribed_dts' => :'global_unsubscribed_dts',
30
40
  :'memberships' => :'memberships',
31
41
  :'metrics' => :'metrics',
32
- :'properties_list' => :'properties_list'
42
+ :'properties_list' => :'properties_list',
43
+ :'spam_complaint' => :'spam_complaint',
44
+ :'spam_complaint_dts' => :'spam_complaint_dts'
33
45
  }
34
46
  end
35
47
 
@@ -42,9 +54,13 @@ module UltracartClient
42
54
  def self.openapi_types
43
55
  {
44
56
  :'activities' => :'Array<Activity>',
57
+ :'global_unsubscribed' => :'Boolean',
58
+ :'global_unsubscribed_dts' => :'String',
45
59
  :'memberships' => :'Array<ListSegmentMembership>',
46
60
  :'metrics' => :'Array<Metric>',
47
- :'properties_list' => :'Array<Property>'
61
+ :'properties_list' => :'Array<Property>',
62
+ :'spam_complaint' => :'Boolean',
63
+ :'spam_complaint_dts' => :'String'
48
64
  }
49
65
  end
50
66
 
@@ -75,6 +91,14 @@ module UltracartClient
75
91
  end
76
92
  end
77
93
 
94
+ if attributes.key?(:'global_unsubscribed')
95
+ self.global_unsubscribed = attributes[:'global_unsubscribed']
96
+ end
97
+
98
+ if attributes.key?(:'global_unsubscribed_dts')
99
+ self.global_unsubscribed_dts = attributes[:'global_unsubscribed_dts']
100
+ end
101
+
78
102
  if attributes.key?(:'memberships')
79
103
  if (value = attributes[:'memberships']).is_a?(Array)
80
104
  self.memberships = value
@@ -92,6 +116,14 @@ module UltracartClient
92
116
  self.properties_list = value
93
117
  end
94
118
  end
119
+
120
+ if attributes.key?(:'spam_complaint')
121
+ self.spam_complaint = attributes[:'spam_complaint']
122
+ end
123
+
124
+ if attributes.key?(:'spam_complaint_dts')
125
+ self.spam_complaint_dts = attributes[:'spam_complaint_dts']
126
+ end
95
127
  end
96
128
 
97
129
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -113,9 +145,13 @@ module UltracartClient
113
145
  return true if self.equal?(o)
114
146
  self.class == o.class &&
115
147
  activities == o.activities &&
148
+ global_unsubscribed == o.global_unsubscribed &&
149
+ global_unsubscribed_dts == o.global_unsubscribed_dts &&
116
150
  memberships == o.memberships &&
117
151
  metrics == o.metrics &&
118
- properties_list == o.properties_list
152
+ properties_list == o.properties_list &&
153
+ spam_complaint == o.spam_complaint &&
154
+ spam_complaint_dts == o.spam_complaint_dts
119
155
  end
120
156
 
121
157
  # @see the `==` method
@@ -127,7 +163,7 @@ module UltracartClient
127
163
  # Calculates hash code according to all attributes.
128
164
  # @return [Integer] Hash code
129
165
  def hash
130
- [activities, memberships, metrics, properties_list].hash
166
+ [activities, global_unsubscribed, global_unsubscribed_dts, memberships, metrics, properties_list, spam_complaint, spam_complaint_dts].hash
131
167
  end
132
168
 
133
169
  # Builds the object from hash