ultracart_api 4.0.34.rc → 4.0.35.rc

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,34 @@
1
+ # UltracartClient::ConversationSummary
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **conversation_arn** | **String** | | [optional] |
8
+ | **conversation_uuid** | **String** | | [optional] |
9
+ | **last_conversation_message_body** | **String** | | [optional] |
10
+ | **last_conversation_participant_arn** | **String** | | [optional] |
11
+ | **last_conversation_participant_name** | **String** | | [optional] |
12
+ | **last_message_dts** | **String** | Last message date/time | [optional] |
13
+ | **merchant_id** | **String** | | [optional] |
14
+ | **message_count** | **Integer** | | [optional] |
15
+ | **unread_messages** | **Boolean** | | [optional] |
16
+
17
+ ## Example
18
+
19
+ ```ruby
20
+ require 'ultracart_api'
21
+
22
+ instance = UltracartClient::ConversationSummary.new(
23
+ conversation_arn: null,
24
+ conversation_uuid: null,
25
+ last_conversation_message_body: null,
26
+ last_conversation_participant_arn: null,
27
+ last_conversation_participant_name: null,
28
+ last_message_dts: null,
29
+ merchant_id: null,
30
+ message_count: null,
31
+ unread_messages: null
32
+ )
33
+ ```
34
+
@@ -0,0 +1,26 @@
1
+ # UltracartClient::ConversationsResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **conversations** | [**Array<ConversationSummary>**](ConversationSummary.md) | | [optional] |
8
+ | **error** | [**Error**](Error.md) | | [optional] |
9
+ | **metadata** | [**ResponseMetadata**](ResponseMetadata.md) | | [optional] |
10
+ | **success** | **Boolean** | Indicates if API call was successful | [optional] |
11
+ | **warning** | [**Warning**](Warning.md) | | [optional] |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'ultracart_api'
17
+
18
+ instance = UltracartClient::ConversationsResponse.new(
19
+ conversations: null,
20
+ error: null,
21
+ metadata: null,
22
+ success: null,
23
+ warning: null
24
+ )
25
+ ```
26
+
@@ -0,0 +1,418 @@
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 'cgi'
14
+
15
+ module UltracartClient
16
+ class ConversationApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ def self.new_using_api_key(simple_key, verify_ssl = true, debugging = false)
24
+ api_config = Configuration.new
25
+ api_config.api_key_prefix['x-ultracart-simple-key'] = simple_key
26
+ api_config.api_version = '2017-03-01'
27
+ api_config.verify_ssl = verify_ssl
28
+
29
+ api_client = ApiClient.new(api_config)
30
+ api_client.config.debugging = debugging
31
+
32
+ UltracartClient::ConversationApi.new(api_client)
33
+ end
34
+
35
+ # Get agent websocket authorization
36
+ # Retrieve a JWT to authorize an agent to make a websocket connection.
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [ConversationAgentAuthResponse]
39
+ def get_agent_websocket_authorization(opts = {})
40
+ data, _status_code, _headers = get_agent_websocket_authorization_with_http_info(opts)
41
+ data
42
+ end
43
+
44
+ # Get agent websocket authorization
45
+ # Retrieve a JWT to authorize an agent to make a websocket connection.
46
+ # @param [Hash] opts the optional parameters
47
+ # @return [Array<(ConversationAgentAuthResponse, Integer, Hash)>] ConversationAgentAuthResponse data, response status code and response headers
48
+ def get_agent_websocket_authorization_with_http_info(opts = {})
49
+ if @api_client.config.debugging
50
+ @api_client.config.logger.debug 'Calling API: ConversationApi.get_agent_websocket_authorization ...'
51
+ end
52
+ # resource path
53
+ local_var_path = '/conversation/agent/auth'
54
+
55
+ # query parameters
56
+ query_params = opts[:query_params] || {}
57
+
58
+ # header parameters
59
+ header_params = opts[:header_params] || {}
60
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
61
+ # HTTP header 'Accept' (if needed)
62
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
63
+
64
+ # form parameters
65
+ form_params = opts[:form_params] || {}
66
+
67
+ # http body (model)
68
+ post_body = opts[:debug_body]
69
+
70
+ # return_type
71
+ return_type = opts[:debug_return_type] || 'ConversationAgentAuthResponse'
72
+
73
+ # auth_names
74
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
75
+
76
+ new_options = opts.merge(
77
+ :operation => :"ConversationApi.get_agent_websocket_authorization",
78
+ :header_params => header_params,
79
+ :query_params => query_params,
80
+ :form_params => form_params,
81
+ :body => post_body,
82
+ :auth_names => auth_names,
83
+ :return_type => return_type
84
+ )
85
+
86
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
87
+ if @api_client.config.debugging
88
+ @api_client.config.logger.debug "API called: ConversationApi#get_agent_websocket_authorization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
89
+ end
90
+ return data, status_code, headers
91
+ end
92
+
93
+ # Retrieve a conversation
94
+ # Retrieve a conversation including the participants and messages
95
+ # @param conversation_uuid [String]
96
+ # @param [Hash] opts the optional parameters
97
+ # @return [Conversation]
98
+ def get_conversation(conversation_uuid, opts = {})
99
+ data, _status_code, _headers = get_conversation_with_http_info(conversation_uuid, opts)
100
+ data
101
+ end
102
+
103
+ # Retrieve a conversation
104
+ # Retrieve a conversation including the participants and messages
105
+ # @param conversation_uuid [String]
106
+ # @param [Hash] opts the optional parameters
107
+ # @return [Array<(Conversation, Integer, Hash)>] Conversation data, response status code and response headers
108
+ def get_conversation_with_http_info(conversation_uuid, opts = {})
109
+ if @api_client.config.debugging
110
+ @api_client.config.logger.debug 'Calling API: ConversationApi.get_conversation ...'
111
+ end
112
+ # verify the required parameter 'conversation_uuid' is set
113
+ if @api_client.config.client_side_validation && conversation_uuid.nil?
114
+ fail ArgumentError, "Missing the required parameter 'conversation_uuid' when calling ConversationApi.get_conversation"
115
+ end
116
+ # resource path
117
+ local_var_path = '/conversation/conversations/{conversation_uuid}'.sub('{' + 'conversation_uuid' + '}', CGI.escape(conversation_uuid.to_s))
118
+
119
+ # query parameters
120
+ query_params = opts[:query_params] || {}
121
+
122
+ # header parameters
123
+ header_params = opts[:header_params] || {}
124
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
125
+ # HTTP header 'Accept' (if needed)
126
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
127
+
128
+ # form parameters
129
+ form_params = opts[:form_params] || {}
130
+
131
+ # http body (model)
132
+ post_body = opts[:debug_body]
133
+
134
+ # return_type
135
+ return_type = opts[:debug_return_type] || 'Conversation'
136
+
137
+ # auth_names
138
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
139
+
140
+ new_options = opts.merge(
141
+ :operation => :"ConversationApi.get_conversation",
142
+ :header_params => header_params,
143
+ :query_params => query_params,
144
+ :form_params => form_params,
145
+ :body => post_body,
146
+ :auth_names => auth_names,
147
+ :return_type => return_type
148
+ )
149
+
150
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
151
+ if @api_client.config.debugging
152
+ @api_client.config.logger.debug "API called: ConversationApi#get_conversation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
153
+ end
154
+ return data, status_code, headers
155
+ end
156
+
157
+ # Retrieve a list of conversation summaries newest to oldest
158
+ # Retrieve a list of conversation summaries that are ordered newest to oldest, include the most recent message and whether its been read.
159
+ # @param [Hash] opts the optional parameters
160
+ # @option opts [Integer] :_limit The maximum number of records to return on this one API call. (Max 200) (default to 100)
161
+ # @option opts [Integer] :_offset Pagination of the record set. Offset is a zero based index. (default to 0)
162
+ # @return [ConversationsResponse]
163
+ def get_conversations(opts = {})
164
+ data, _status_code, _headers = get_conversations_with_http_info(opts)
165
+ data
166
+ end
167
+
168
+ # Retrieve a list of conversation summaries newest to oldest
169
+ # Retrieve a list of conversation summaries that are ordered newest to oldest, include the most recent message and whether its been read.
170
+ # @param [Hash] opts the optional parameters
171
+ # @option opts [Integer] :_limit The maximum number of records to return on this one API call. (Max 200) (default to 100)
172
+ # @option opts [Integer] :_offset Pagination of the record set. Offset is a zero based index. (default to 0)
173
+ # @return [Array<(ConversationsResponse, Integer, Hash)>] ConversationsResponse data, response status code and response headers
174
+ def get_conversations_with_http_info(opts = {})
175
+ if @api_client.config.debugging
176
+ @api_client.config.logger.debug 'Calling API: ConversationApi.get_conversations ...'
177
+ end
178
+ # resource path
179
+ local_var_path = '/conversation/conversations'
180
+
181
+ # query parameters
182
+ query_params = opts[:query_params] || {}
183
+ query_params[:'_limit'] = opts[:'_limit'] if !opts[:'_limit'].nil?
184
+ query_params[:'_offset'] = opts[:'_offset'] if !opts[:'_offset'].nil?
185
+
186
+ # header parameters
187
+ header_params = opts[:header_params] || {}
188
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
189
+ # HTTP header 'Accept' (if needed)
190
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
191
+
192
+ # form parameters
193
+ form_params = opts[:form_params] || {}
194
+
195
+ # http body (model)
196
+ post_body = opts[:debug_body]
197
+
198
+ # return_type
199
+ return_type = opts[:debug_return_type] || 'ConversationsResponse'
200
+
201
+ # auth_names
202
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
203
+
204
+ new_options = opts.merge(
205
+ :operation => :"ConversationApi.get_conversations",
206
+ :header_params => header_params,
207
+ :query_params => query_params,
208
+ :form_params => form_params,
209
+ :body => post_body,
210
+ :auth_names => auth_names,
211
+ :return_type => return_type
212
+ )
213
+
214
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
215
+ if @api_client.config.debugging
216
+ @api_client.config.logger.debug "API called: ConversationApi#get_conversations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
217
+ end
218
+ return data, status_code, headers
219
+ end
220
+
221
+ # Join a conversation
222
+ # Join a conversation
223
+ # @param conversation_uuid [String]
224
+ # @param [Hash] opts the optional parameters
225
+ # @return [nil]
226
+ def join_conversation(conversation_uuid, opts = {})
227
+ join_conversation_with_http_info(conversation_uuid, opts)
228
+ nil
229
+ end
230
+
231
+ # Join a conversation
232
+ # Join a conversation
233
+ # @param conversation_uuid [String]
234
+ # @param [Hash] opts the optional parameters
235
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
236
+ def join_conversation_with_http_info(conversation_uuid, opts = {})
237
+ if @api_client.config.debugging
238
+ @api_client.config.logger.debug 'Calling API: ConversationApi.join_conversation ...'
239
+ end
240
+ # verify the required parameter 'conversation_uuid' is set
241
+ if @api_client.config.client_side_validation && conversation_uuid.nil?
242
+ fail ArgumentError, "Missing the required parameter 'conversation_uuid' when calling ConversationApi.join_conversation"
243
+ end
244
+ # resource path
245
+ local_var_path = '/conversation/conversations/{conversation_uuid}/join'.sub('{' + 'conversation_uuid' + '}', CGI.escape(conversation_uuid.to_s))
246
+
247
+ # query parameters
248
+ query_params = opts[:query_params] || {}
249
+
250
+ # header parameters
251
+ header_params = opts[:header_params] || {}
252
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
253
+ # HTTP header 'Accept' (if needed)
254
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
255
+
256
+ # form parameters
257
+ form_params = opts[:form_params] || {}
258
+
259
+ # http body (model)
260
+ post_body = opts[:debug_body]
261
+
262
+ # return_type
263
+ return_type = opts[:debug_return_type]
264
+
265
+ # auth_names
266
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
267
+
268
+ new_options = opts.merge(
269
+ :operation => :"ConversationApi.join_conversation",
270
+ :header_params => header_params,
271
+ :query_params => query_params,
272
+ :form_params => form_params,
273
+ :body => post_body,
274
+ :auth_names => auth_names,
275
+ :return_type => return_type
276
+ )
277
+
278
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
279
+ if @api_client.config.debugging
280
+ @api_client.config.logger.debug "API called: ConversationApi#join_conversation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
281
+ end
282
+ return data, status_code, headers
283
+ end
284
+
285
+ # Leave a conversation
286
+ # Leave a conversation
287
+ # @param conversation_uuid [String]
288
+ # @param [Hash] opts the optional parameters
289
+ # @return [nil]
290
+ def leave_conversation(conversation_uuid, opts = {})
291
+ leave_conversation_with_http_info(conversation_uuid, opts)
292
+ nil
293
+ end
294
+
295
+ # Leave a conversation
296
+ # Leave a conversation
297
+ # @param conversation_uuid [String]
298
+ # @param [Hash] opts the optional parameters
299
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
300
+ def leave_conversation_with_http_info(conversation_uuid, opts = {})
301
+ if @api_client.config.debugging
302
+ @api_client.config.logger.debug 'Calling API: ConversationApi.leave_conversation ...'
303
+ end
304
+ # verify the required parameter 'conversation_uuid' is set
305
+ if @api_client.config.client_side_validation && conversation_uuid.nil?
306
+ fail ArgumentError, "Missing the required parameter 'conversation_uuid' when calling ConversationApi.leave_conversation"
307
+ end
308
+ # resource path
309
+ local_var_path = '/conversation/conversations/{conversation_uuid}/leave'.sub('{' + 'conversation_uuid' + '}', CGI.escape(conversation_uuid.to_s))
310
+
311
+ # query parameters
312
+ query_params = opts[:query_params] || {}
313
+
314
+ # header parameters
315
+ header_params = opts[:header_params] || {}
316
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
317
+ # HTTP header 'Accept' (if needed)
318
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
319
+
320
+ # form parameters
321
+ form_params = opts[:form_params] || {}
322
+
323
+ # http body (model)
324
+ post_body = opts[:debug_body]
325
+
326
+ # return_type
327
+ return_type = opts[:debug_return_type]
328
+
329
+ # auth_names
330
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
331
+
332
+ new_options = opts.merge(
333
+ :operation => :"ConversationApi.leave_conversation",
334
+ :header_params => header_params,
335
+ :query_params => query_params,
336
+ :form_params => form_params,
337
+ :body => post_body,
338
+ :auth_names => auth_names,
339
+ :return_type => return_type
340
+ )
341
+
342
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
343
+ if @api_client.config.debugging
344
+ @api_client.config.logger.debug "API called: ConversationApi#leave_conversation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
345
+ end
346
+ return data, status_code, headers
347
+ end
348
+
349
+ # Start a conversation
350
+ # Start a new conversation
351
+ # @param start_request [ConversationStartRequest] Start request
352
+ # @param [Hash] opts the optional parameters
353
+ # @return [ConversationStartResponse]
354
+ def start_conversation(start_request, opts = {})
355
+ data, _status_code, _headers = start_conversation_with_http_info(start_request, opts)
356
+ data
357
+ end
358
+
359
+ # Start a conversation
360
+ # Start a new conversation
361
+ # @param start_request [ConversationStartRequest] Start request
362
+ # @param [Hash] opts the optional parameters
363
+ # @return [Array<(ConversationStartResponse, Integer, Hash)>] ConversationStartResponse data, response status code and response headers
364
+ def start_conversation_with_http_info(start_request, opts = {})
365
+ if @api_client.config.debugging
366
+ @api_client.config.logger.debug 'Calling API: ConversationApi.start_conversation ...'
367
+ end
368
+ # verify the required parameter 'start_request' is set
369
+ if @api_client.config.client_side_validation && start_request.nil?
370
+ fail ArgumentError, "Missing the required parameter 'start_request' when calling ConversationApi.start_conversation"
371
+ end
372
+ # resource path
373
+ local_var_path = '/conversation/conversations'
374
+
375
+ # query parameters
376
+ query_params = opts[:query_params] || {}
377
+
378
+ # header parameters
379
+ header_params = opts[:header_params] || {}
380
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
381
+ # HTTP header 'Accept' (if needed)
382
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
383
+ # HTTP header 'Content-Type'
384
+ content_type = @api_client.select_header_content_type(['application/json'])
385
+ if !content_type.nil?
386
+ header_params['Content-Type'] = content_type
387
+ end
388
+
389
+ # form parameters
390
+ form_params = opts[:form_params] || {}
391
+
392
+ # http body (model)
393
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(start_request)
394
+
395
+ # return_type
396
+ return_type = opts[:debug_return_type] || 'ConversationStartResponse'
397
+
398
+ # auth_names
399
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
400
+
401
+ new_options = opts.merge(
402
+ :operation => :"ConversationApi.start_conversation",
403
+ :header_params => header_params,
404
+ :query_params => query_params,
405
+ :form_params => form_params,
406
+ :body => post_body,
407
+ :auth_names => auth_names,
408
+ :return_type => return_type
409
+ )
410
+
411
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
412
+ if @api_client.config.debugging
413
+ @api_client.config.logger.debug "API called: ConversationApi#start_conversation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
414
+ end
415
+ return data, status_code, headers
416
+ end
417
+ end
418
+ end
@@ -17,8 +17,12 @@ module UltracartClient
17
17
  class Activity
18
18
  attr_accessor :action
19
19
 
20
+ attr_accessor :channel
21
+
20
22
  attr_accessor :metric
21
23
 
24
+ attr_accessor :storefront_oid
25
+
22
26
  attr_accessor :subject
23
27
 
24
28
  attr_accessor :ts
@@ -31,7 +35,9 @@ module UltracartClient
31
35
  def self.attribute_map
32
36
  {
33
37
  :'action' => :'action',
38
+ :'channel' => :'channel',
34
39
  :'metric' => :'metric',
40
+ :'storefront_oid' => :'storefront_oid',
35
41
  :'subject' => :'subject',
36
42
  :'ts' => :'ts',
37
43
  :'type' => :'type',
@@ -48,7 +54,9 @@ module UltracartClient
48
54
  def self.openapi_types
49
55
  {
50
56
  :'action' => :'String',
57
+ :'channel' => :'String',
51
58
  :'metric' => :'String',
59
+ :'storefront_oid' => :'Integer',
52
60
  :'subject' => :'String',
53
61
  :'ts' => :'Integer',
54
62
  :'type' => :'String',
@@ -81,10 +89,18 @@ module UltracartClient
81
89
  self.action = attributes[:'action']
82
90
  end
83
91
 
92
+ if attributes.key?(:'channel')
93
+ self.channel = attributes[:'channel']
94
+ end
95
+
84
96
  if attributes.key?(:'metric')
85
97
  self.metric = attributes[:'metric']
86
98
  end
87
99
 
100
+ if attributes.key?(:'storefront_oid')
101
+ self.storefront_oid = attributes[:'storefront_oid']
102
+ end
103
+
88
104
  if attributes.key?(:'subject')
89
105
  self.subject = attributes[:'subject']
90
106
  end
@@ -121,7 +137,9 @@ module UltracartClient
121
137
  return true if self.equal?(o)
122
138
  self.class == o.class &&
123
139
  action == o.action &&
140
+ channel == o.channel &&
124
141
  metric == o.metric &&
142
+ storefront_oid == o.storefront_oid &&
125
143
  subject == o.subject &&
126
144
  ts == o.ts &&
127
145
  type == o.type &&
@@ -137,7 +155,7 @@ module UltracartClient
137
155
  # Calculates hash code according to all attributes.
138
156
  # @return [Integer] Hash code
139
157
  def hash
140
- [action, metric, subject, ts, type, uuid].hash
158
+ [action, channel, metric, storefront_oid, subject, ts, type, uuid].hash
141
159
  end
142
160
 
143
161
  # Builds the object from hash