ultracart_api 3.10.17 → 3.10.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +25 -4
  3. data/docs/Activity.md +2 -0
  4. data/docs/ChargebackApi.md +1 -1
  5. data/docs/Conversation.md +12 -0
  6. data/docs/ConversationAgentAuthResponse.md +10 -0
  7. data/docs/ConversationApi.md +310 -0
  8. data/docs/ConversationMessage.md +12 -0
  9. data/docs/ConversationParticipant.md +14 -0
  10. data/docs/ConversationStartRequest.md +9 -0
  11. data/docs/ConversationStartResponse.md +9 -0
  12. data/docs/ConversationSummary.md +16 -0
  13. data/docs/ConversationsResponse.md +12 -0
  14. data/docs/CustomerActivity.md +4 -0
  15. data/docs/CustomerApi.md +58 -1
  16. data/docs/CustomerMergeRequest.md +9 -0
  17. data/docs/OrderApi.md +1 -1
  18. data/docs/SsoApi.md +2 -2
  19. data/docs/UserApi.md +2 -2
  20. data/docs/WebhookApi.md +1 -1
  21. data/lib/ultracart_api/api/chargeback_api.rb +1 -1
  22. data/lib/ultracart_api/api/conversation_api.rb +358 -0
  23. data/lib/ultracart_api/api/customer_api.rb +64 -1
  24. data/lib/ultracart_api/api/order_api.rb +1 -1
  25. data/lib/ultracart_api/api/sso_api.rb +2 -2
  26. data/lib/ultracart_api/api/user_api.rb +2 -2
  27. data/lib/ultracart_api/api/webhook_api.rb +1 -1
  28. data/lib/ultracart_api/models/activity.rb +19 -1
  29. data/lib/ultracart_api/models/conversation.rb +224 -0
  30. data/lib/ultracart_api/models/conversation_agent_auth_response.rb +202 -0
  31. data/lib/ultracart_api/models/conversation_message.rb +223 -0
  32. data/lib/ultracart_api/models/conversation_participant.rb +241 -0
  33. data/lib/ultracart_api/models/conversation_start_request.rb +195 -0
  34. data/lib/ultracart_api/models/conversation_start_response.rb +193 -0
  35. data/lib/ultracart_api/models/conversation_summary.rb +257 -0
  36. data/lib/ultracart_api/models/conversations_response.rb +223 -0
  37. data/lib/ultracart_api/models/customer_activity.rb +40 -4
  38. data/lib/ultracart_api/models/customer_merge_request.rb +195 -0
  39. data/lib/ultracart_api/version.rb +1 -1
  40. data/lib/ultracart_api.rb +10 -0
  41. metadata +22 -2
@@ -0,0 +1,257 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class ConversationSummary
17
+ attr_accessor :conversation_arn
18
+
19
+ attr_accessor :conversation_uuid
20
+
21
+ attr_accessor :last_conversation_message_body
22
+
23
+ attr_accessor :last_conversation_participant_arn
24
+
25
+ attr_accessor :last_conversation_participant_name
26
+
27
+ # Last message date/time
28
+ attr_accessor :last_message_dts
29
+
30
+ attr_accessor :merchant_id
31
+
32
+ attr_accessor :message_count
33
+
34
+ attr_accessor :unread_messages
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'conversation_arn' => :'conversation_arn',
40
+ :'conversation_uuid' => :'conversation_uuid',
41
+ :'last_conversation_message_body' => :'last_conversation_message_body',
42
+ :'last_conversation_participant_arn' => :'last_conversation_participant_arn',
43
+ :'last_conversation_participant_name' => :'last_conversation_participant_name',
44
+ :'last_message_dts' => :'last_message_dts',
45
+ :'merchant_id' => :'merchant_id',
46
+ :'message_count' => :'message_count',
47
+ :'unread_messages' => :'unread_messages'
48
+ }
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.swagger_types
53
+ {
54
+ :'conversation_arn' => :'String',
55
+ :'conversation_uuid' => :'String',
56
+ :'last_conversation_message_body' => :'String',
57
+ :'last_conversation_participant_arn' => :'String',
58
+ :'last_conversation_participant_name' => :'String',
59
+ :'last_message_dts' => :'String',
60
+ :'merchant_id' => :'String',
61
+ :'message_count' => :'Integer',
62
+ :'unread_messages' => :'BOOLEAN'
63
+ }
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ return unless attributes.is_a?(Hash)
70
+
71
+ # convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
73
+
74
+ if attributes.has_key?(:'conversation_arn')
75
+ self.conversation_arn = attributes[:'conversation_arn']
76
+ end
77
+
78
+ if attributes.has_key?(:'conversation_uuid')
79
+ self.conversation_uuid = attributes[:'conversation_uuid']
80
+ end
81
+
82
+ if attributes.has_key?(:'last_conversation_message_body')
83
+ self.last_conversation_message_body = attributes[:'last_conversation_message_body']
84
+ end
85
+
86
+ if attributes.has_key?(:'last_conversation_participant_arn')
87
+ self.last_conversation_participant_arn = attributes[:'last_conversation_participant_arn']
88
+ end
89
+
90
+ if attributes.has_key?(:'last_conversation_participant_name')
91
+ self.last_conversation_participant_name = attributes[:'last_conversation_participant_name']
92
+ end
93
+
94
+ if attributes.has_key?(:'last_message_dts')
95
+ self.last_message_dts = attributes[:'last_message_dts']
96
+ end
97
+
98
+ if attributes.has_key?(:'merchant_id')
99
+ self.merchant_id = attributes[:'merchant_id']
100
+ end
101
+
102
+ if attributes.has_key?(:'message_count')
103
+ self.message_count = attributes[:'message_count']
104
+ end
105
+
106
+ if attributes.has_key?(:'unread_messages')
107
+ self.unread_messages = attributes[:'unread_messages']
108
+ end
109
+ end
110
+
111
+ # Show invalid properties with the reasons. Usually used together with valid?
112
+ # @return Array for valid properties with the reasons
113
+ def list_invalid_properties
114
+ invalid_properties = Array.new
115
+ invalid_properties
116
+ end
117
+
118
+ # Check to see if the all the properties in the model are valid
119
+ # @return true if the model is valid
120
+ def valid?
121
+ true
122
+ end
123
+
124
+ # Checks equality by comparing each attribute.
125
+ # @param [Object] Object to be compared
126
+ def ==(o)
127
+ return true if self.equal?(o)
128
+ self.class == o.class &&
129
+ conversation_arn == o.conversation_arn &&
130
+ conversation_uuid == o.conversation_uuid &&
131
+ last_conversation_message_body == o.last_conversation_message_body &&
132
+ last_conversation_participant_arn == o.last_conversation_participant_arn &&
133
+ last_conversation_participant_name == o.last_conversation_participant_name &&
134
+ last_message_dts == o.last_message_dts &&
135
+ merchant_id == o.merchant_id &&
136
+ message_count == o.message_count &&
137
+ unread_messages == o.unread_messages
138
+ end
139
+
140
+ # @see the `==` method
141
+ # @param [Object] Object to be compared
142
+ def eql?(o)
143
+ self == o
144
+ end
145
+
146
+ # Calculates hash code according to all attributes.
147
+ # @return [Fixnum] Hash code
148
+ def hash
149
+ [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
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def build_from_hash(attributes)
156
+ return nil unless attributes.is_a?(Hash)
157
+ self.class.swagger_types.each_pair do |key, type|
158
+ if type =~ /\AArray<(.*)>/i
159
+ # check to ensure the input is an array given that the attribute
160
+ # is documented as an array but the input is not
161
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
162
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
163
+ end
164
+ elsif !attributes[self.class.attribute_map[key]].nil?
165
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
166
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
167
+ end
168
+
169
+ self
170
+ end
171
+
172
+ # Deserializes the data based on type
173
+ # @param string type Data type
174
+ # @param string value Value to be deserialized
175
+ # @return [Object] Deserialized data
176
+ def _deserialize(type, value)
177
+ case type.to_sym
178
+ when :DateTime
179
+ DateTime.parse(value)
180
+ when :Date
181
+ Date.parse(value)
182
+ when :String
183
+ value.to_s
184
+ when :Integer
185
+ value.to_i
186
+ when :Float
187
+ value.to_f
188
+ when :BOOLEAN
189
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
190
+ true
191
+ else
192
+ false
193
+ end
194
+ when :Object
195
+ # generic object (usually a Hash), return directly
196
+ value
197
+ when /\AArray<(?<inner_type>.+)>\z/
198
+ inner_type = Regexp.last_match[:inner_type]
199
+ value.map { |v| _deserialize(inner_type, v) }
200
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
201
+ k_type = Regexp.last_match[:k_type]
202
+ v_type = Regexp.last_match[:v_type]
203
+ {}.tap do |hash|
204
+ value.each do |k, v|
205
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
206
+ end
207
+ end
208
+ else # model
209
+ temp_model = UltracartClient.const_get(type).new
210
+ temp_model.build_from_hash(value)
211
+ end
212
+ end
213
+
214
+ # Returns the string representation of the object
215
+ # @return [String] String presentation of the object
216
+ def to_s
217
+ to_hash.to_s
218
+ end
219
+
220
+ # to_body is an alias to to_hash (backward compatibility)
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_body
223
+ to_hash
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = self.send(attr)
232
+ next if value.nil?
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
+ end
@@ -0,0 +1,223 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class ConversationsResponse
17
+ attr_accessor :conversations
18
+
19
+ attr_accessor :error
20
+
21
+ attr_accessor :metadata
22
+
23
+ # Indicates if API call was successful
24
+ attr_accessor :success
25
+
26
+ attr_accessor :warning
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'conversations' => :'conversations',
32
+ :'error' => :'error',
33
+ :'metadata' => :'metadata',
34
+ :'success' => :'success',
35
+ :'warning' => :'warning'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'conversations' => :'Array<ConversationSummary>',
43
+ :'error' => :'Error',
44
+ :'metadata' => :'ResponseMetadata',
45
+ :'success' => :'BOOLEAN',
46
+ :'warning' => :'Warning'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
+
58
+ if attributes.has_key?(:'conversations')
59
+ if (value = attributes[:'conversations']).is_a?(Array)
60
+ self.conversations = value
61
+ end
62
+ end
63
+
64
+ if attributes.has_key?(:'error')
65
+ self.error = attributes[:'error']
66
+ end
67
+
68
+ if attributes.has_key?(:'metadata')
69
+ self.metadata = attributes[:'metadata']
70
+ end
71
+
72
+ if attributes.has_key?(:'success')
73
+ self.success = attributes[:'success']
74
+ end
75
+
76
+ if attributes.has_key?(:'warning')
77
+ self.warning = attributes[:'warning']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ invalid_properties = Array.new
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ conversations == o.conversations &&
100
+ error == o.error &&
101
+ metadata == o.metadata &&
102
+ success == o.success &&
103
+ warning == o.warning
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Fixnum] Hash code
114
+ def hash
115
+ [conversations, error, metadata, success, warning].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.swagger_types.each_pair do |key, type|
124
+ if type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
133
+ end
134
+
135
+ self
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def _deserialize(type, value)
143
+ case type.to_sym
144
+ when :DateTime
145
+ DateTime.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :BOOLEAN
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ temp_model = UltracartClient.const_get(type).new
176
+ temp_model.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ next if value.nil?
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ # Outputs non-array value in the form of hash
205
+ # For object, use to_hash. Otherwise, just return the value
206
+ # @param [Object] value Any valid value
207
+ # @return [Hash] Returns the value in the form of hash
208
+ def _to_hash(value)
209
+ if value.is_a?(Array)
210
+ value.compact.map { |v| _to_hash(v) }
211
+ elsif value.is_a?(Hash)
212
+ {}.tap do |hash|
213
+ value.each { |k, v| hash[k] = _to_hash(v) }
214
+ end
215
+ elsif value.respond_to? :to_hash
216
+ value.to_hash
217
+ else
218
+ value
219
+ end
220
+ end
221
+
222
+ end
223
+ end
@@ -16,19 +16,31 @@ module UltracartClient
16
16
  class CustomerActivity
17
17
  attr_accessor :activities
18
18
 
19
+ attr_accessor :global_unsubscribed
20
+
21
+ attr_accessor :global_unsubscribed_dts
22
+
19
23
  attr_accessor :memberships
20
24
 
21
25
  attr_accessor :metrics
22
26
 
23
27
  attr_accessor :properties_list
24
28
 
29
+ attr_accessor :spam_complaint
30
+
31
+ attr_accessor :spam_complaint_dts
32
+
25
33
  # Attribute mapping from ruby-style variable name to JSON key.
26
34
  def self.attribute_map
27
35
  {
28
36
  :'activities' => :'activities',
37
+ :'global_unsubscribed' => :'global_unsubscribed',
38
+ :'global_unsubscribed_dts' => :'global_unsubscribed_dts',
29
39
  :'memberships' => :'memberships',
30
40
  :'metrics' => :'metrics',
31
- :'properties_list' => :'properties_list'
41
+ :'properties_list' => :'properties_list',
42
+ :'spam_complaint' => :'spam_complaint',
43
+ :'spam_complaint_dts' => :'spam_complaint_dts'
32
44
  }
33
45
  end
34
46
 
@@ -36,9 +48,13 @@ module UltracartClient
36
48
  def self.swagger_types
37
49
  {
38
50
  :'activities' => :'Array<Activity>',
51
+ :'global_unsubscribed' => :'BOOLEAN',
52
+ :'global_unsubscribed_dts' => :'String',
39
53
  :'memberships' => :'Array<ListSegmentMembership>',
40
54
  :'metrics' => :'Array<Metric>',
41
- :'properties_list' => :'Array<Property>'
55
+ :'properties_list' => :'Array<Property>',
56
+ :'spam_complaint' => :'BOOLEAN',
57
+ :'spam_complaint_dts' => :'String'
42
58
  }
43
59
  end
44
60
 
@@ -56,6 +72,14 @@ module UltracartClient
56
72
  end
57
73
  end
58
74
 
75
+ if attributes.has_key?(:'global_unsubscribed')
76
+ self.global_unsubscribed = attributes[:'global_unsubscribed']
77
+ end
78
+
79
+ if attributes.has_key?(:'global_unsubscribed_dts')
80
+ self.global_unsubscribed_dts = attributes[:'global_unsubscribed_dts']
81
+ end
82
+
59
83
  if attributes.has_key?(:'memberships')
60
84
  if (value = attributes[:'memberships']).is_a?(Array)
61
85
  self.memberships = value
@@ -73,6 +97,14 @@ module UltracartClient
73
97
  self.properties_list = value
74
98
  end
75
99
  end
100
+
101
+ if attributes.has_key?(:'spam_complaint')
102
+ self.spam_complaint = attributes[:'spam_complaint']
103
+ end
104
+
105
+ if attributes.has_key?(:'spam_complaint_dts')
106
+ self.spam_complaint_dts = attributes[:'spam_complaint_dts']
107
+ end
76
108
  end
77
109
 
78
110
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -94,9 +126,13 @@ module UltracartClient
94
126
  return true if self.equal?(o)
95
127
  self.class == o.class &&
96
128
  activities == o.activities &&
129
+ global_unsubscribed == o.global_unsubscribed &&
130
+ global_unsubscribed_dts == o.global_unsubscribed_dts &&
97
131
  memberships == o.memberships &&
98
132
  metrics == o.metrics &&
99
- properties_list == o.properties_list
133
+ properties_list == o.properties_list &&
134
+ spam_complaint == o.spam_complaint &&
135
+ spam_complaint_dts == o.spam_complaint_dts
100
136
  end
101
137
 
102
138
  # @see the `==` method
@@ -108,7 +144,7 @@ module UltracartClient
108
144
  # Calculates hash code according to all attributes.
109
145
  # @return [Fixnum] Hash code
110
146
  def hash
111
- [activities, memberships, metrics, properties_list].hash
147
+ [activities, global_unsubscribed, global_unsubscribed_dts, memberships, metrics, properties_list, spam_complaint, spam_complaint_dts].hash
112
148
  end
113
149
 
114
150
  # Builds the object from hash