Class: SmoochApi::AppUserApi

Inherits:
Object
  • Object
show all
Defined in:
lib/smooch-api/api/app_user_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AppUserApi

Returns a new instance of AppUserApi.



19
20
21
# File 'lib/smooch-api/api/app_user_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/smooch-api/api/app_user_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_app_user(appId, userId, opts = {}) ⇒ nil

Delete specified app user.

Parameters:

  • appId

    Identifies the app.

  • userId

    Identifies the user. Can be either the smoochId or the userId.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


29
30
31
32
# File 'lib/smooch-api/api/app_user_api.rb', line 29

def delete_app_user(appId, userId, opts = {})
  delete_app_user_with_http_info(appId, userId, opts)
  return nil
end

#delete_app_user_profile(appId, userId, opts = {}) ⇒ AppUserResponse

Delete specified app user’s profile.

Parameters:

  • appId

    Identifies the app.

  • userId

    Identifies the user. Can be either the smoochId or the userId.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



89
90
91
92
# File 'lib/smooch-api/api/app_user_api.rb', line 89

def (appId, userId, opts = {})
  data, _status_code, _headers = (appId, userId, opts)
  return data
end

#delete_app_user_profile_with_http_info(appId, userId, opts = {}) ⇒ Array<(AppUserResponse, Fixnum, Hash)>

Delete specified app user&#39;s profile.

Parameters:

  • appId

    Identifies the app.

  • userId

    Identifies the user. Can be either the smoochId or the userId.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AppUserResponse, Fixnum, Hash)>)

    AppUserResponse data, response status code and response headers



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/smooch-api/api/app_user_api.rb', line 100

def (appId, userId, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppUserApi.delete_app_user_profile ..."
  end
  # verify the required parameter 'appId' is set
  if @api_client.config.client_side_validation && appId.nil?
    fail ArgumentError, "Missing the required parameter 'appId' when calling AppUserApi.delete_app_user_profile"
  end
  # verify the required parameter 'userId' is set
  if @api_client.config.client_side_validation && userId.nil?
    fail ArgumentError, "Missing the required parameter 'userId' when calling AppUserApi.delete_app_user_profile"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}/appusers/{userId}/profile".sub('{' + 'appId' + '}', appId.to_s).sub('{' + 'userId' + '}', userId.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth', 'jwt']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AppUserResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AppUserApi#delete_app_user_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_app_user_with_http_info(appId, userId, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete specified app user.

Parameters:

  • appId

    Identifies the app.

  • userId

    Identifies the user. Can be either the smoochId or the userId.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/smooch-api/api/app_user_api.rb', line 40

def delete_app_user_with_http_info(appId, userId, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppUserApi.delete_app_user ..."
  end
  # verify the required parameter 'appId' is set
  if @api_client.config.client_side_validation && appId.nil?
    fail ArgumentError, "Missing the required parameter 'appId' when calling AppUserApi.delete_app_user"
  end
  # verify the required parameter 'userId' is set
  if @api_client.config.client_side_validation && userId.nil?
    fail ArgumentError, "Missing the required parameter 'userId' when calling AppUserApi.delete_app_user"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}/appusers/{userId}".sub('{' + 'appId' + '}', appId.to_s).sub('{' + 'userId' + '}', userId.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth', 'jwt']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AppUserApi#delete_app_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_app_user(appId, userId, opts = {}) ⇒ AppUserResponse

Get the specified app user.

Parameters:

  • appId

    Identifies the app.

  • userId

    Identifies the user. Can be either the smoochId or the userId.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



150
151
152
153
# File 'lib/smooch-api/api/app_user_api.rb', line 150

def get_app_user(appId, userId, opts = {})
  data, _status_code, _headers = get_app_user_with_http_info(appId, userId, opts)
  return data
end

#get_app_user_auth_code(appId, userId, opts = {}) ⇒ AuthCodeResponse

Get an auth code for facilitating a channel transfer

Parameters:

  • appId

    Identifies the app.

  • userId

    Identifies the user. Can be either the smoochId or the userId.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



211
212
213
214
# File 'lib/smooch-api/api/app_user_api.rb', line 211

def get_app_user_auth_code(appId, userId, opts = {})
  data, _status_code, _headers = get_app_user_auth_code_with_http_info(appId, userId, opts)
  return data
end

#get_app_user_auth_code_with_http_info(appId, userId, opts = {}) ⇒ Array<(AuthCodeResponse, Fixnum, Hash)>

Get an auth code for facilitating a channel transfer

Parameters:

  • appId

    Identifies the app.

  • userId

    Identifies the user. Can be either the smoochId or the userId.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AuthCodeResponse, Fixnum, Hash)>)

    AuthCodeResponse data, response status code and response headers



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/smooch-api/api/app_user_api.rb', line 222

def get_app_user_auth_code_with_http_info(appId, userId, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppUserApi.get_app_user_auth_code ..."
  end
  # verify the required parameter 'appId' is set
  if @api_client.config.client_side_validation && appId.nil?
    fail ArgumentError, "Missing the required parameter 'appId' when calling AppUserApi.get_app_user_auth_code"
  end
  # verify the required parameter 'userId' is set
  if @api_client.config.client_side_validation && userId.nil?
    fail ArgumentError, "Missing the required parameter 'userId' when calling AppUserApi.get_app_user_auth_code"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}/appusers/{userId}/authcode".sub('{' + 'appId' + '}', appId.to_s).sub('{' + 'userId' + '}', userId.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth', 'jwt']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AuthCodeResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AppUserApi#get_app_user_auth_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_app_user_business_system_ids(appId, userId, opts = {}) ⇒ AppUserBusinessSystemsResponse

Get specified app user’s business system IDs.

Parameters:

  • appId

    Identifies the app.

  • userId

    Identifies the user. Can be either the smoochId or the userId.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



272
273
274
275
# File 'lib/smooch-api/api/app_user_api.rb', line 272

def get_app_user_business_system_ids(appId, userId, opts = {})
  data, _status_code, _headers = get_app_user_business_system_ids_with_http_info(appId, userId, opts)
  return data
end

#get_app_user_business_system_ids_with_http_info(appId, userId, opts = {}) ⇒ Array<(AppUserBusinessSystemsResponse, Fixnum, Hash)>

Get specified app user&#39;s business system IDs.

Parameters:

  • appId

    Identifies the app.

  • userId

    Identifies the user. Can be either the smoochId or the userId.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# File 'lib/smooch-api/api/app_user_api.rb', line 283

def get_app_user_business_system_ids_with_http_info(appId, userId, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppUserApi.get_app_user_business_system_ids ..."
  end
  # verify the required parameter 'appId' is set
  if @api_client.config.client_side_validation && appId.nil?
    fail ArgumentError, "Missing the required parameter 'appId' when calling AppUserApi.get_app_user_business_system_ids"
  end
  # verify the required parameter 'userId' is set
  if @api_client.config.client_side_validation && userId.nil?
    fail ArgumentError, "Missing the required parameter 'userId' when calling AppUserApi.get_app_user_business_system_ids"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}/appusers/{userId}/businesssystems".sub('{' + 'appId' + '}', appId.to_s).sub('{' + 'userId' + '}', userId.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth', 'jwt']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AppUserBusinessSystemsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AppUserApi#get_app_user_business_system_ids\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_app_user_entity_ids(appId, userId, opts = {}) ⇒ AppUserChannelsResponse

Get specified app user’s channel entity IDs.

Parameters:

  • appId

    Identifies the app.

  • userId

    Identifies the user. Can be either the smoochId or the userId.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



333
334
335
336
# File 'lib/smooch-api/api/app_user_api.rb', line 333

def get_app_user_entity_ids(appId, userId, opts = {})
  data, _status_code, _headers = get_app_user_entity_ids_with_http_info(appId, userId, opts)
  return data
end

#get_app_user_entity_ids_with_http_info(appId, userId, opts = {}) ⇒ Array<(AppUserChannelsResponse, Fixnum, Hash)>

Get specified app user&#39;s channel entity IDs.

Parameters:

  • appId

    Identifies the app.

  • userId

    Identifies the user. Can be either the smoochId or the userId.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AppUserChannelsResponse, Fixnum, Hash)>)

    AppUserChannelsResponse data, response status code and response headers



344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
# File 'lib/smooch-api/api/app_user_api.rb', line 344

def get_app_user_entity_ids_with_http_info(appId, userId, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppUserApi.get_app_user_entity_ids ..."
  end
  # verify the required parameter 'appId' is set
  if @api_client.config.client_side_validation && appId.nil?
    fail ArgumentError, "Missing the required parameter 'appId' when calling AppUserApi.get_app_user_entity_ids"
  end
  # verify the required parameter 'userId' is set
  if @api_client.config.client_side_validation && userId.nil?
    fail ArgumentError, "Missing the required parameter 'userId' when calling AppUserApi.get_app_user_entity_ids"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}/appusers/{userId}/channels".sub('{' + 'appId' + '}', appId.to_s).sub('{' + 'userId' + '}', userId.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth', 'jwt']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AppUserChannelsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AppUserApi#get_app_user_entity_ids\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_app_user_with_http_info(appId, userId, opts = {}) ⇒ Array<(AppUserResponse, Fixnum, Hash)>

Get the specified app user.

Parameters:

  • appId

    Identifies the app.

  • userId

    Identifies the user. Can be either the smoochId or the userId.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AppUserResponse, Fixnum, Hash)>)

    AppUserResponse data, response status code and response headers



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/smooch-api/api/app_user_api.rb', line 161

def get_app_user_with_http_info(appId, userId, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppUserApi.get_app_user ..."
  end
  # verify the required parameter 'appId' is set
  if @api_client.config.client_side_validation && appId.nil?
    fail ArgumentError, "Missing the required parameter 'appId' when calling AppUserApi.get_app_user"
  end
  # verify the required parameter 'userId' is set
  if @api_client.config.client_side_validation && userId.nil?
    fail ArgumentError, "Missing the required parameter 'userId' when calling AppUserApi.get_app_user"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}/appusers/{userId}".sub('{' + 'appId' + '}', appId.to_s).sub('{' + 'userId' + '}', userId.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth', 'jwt']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AppUserResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AppUserApi#get_app_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Fetch link requests for the specified app user.

Parameters:

  • appId

    Identifies the app.

  • userId

    Identifies the user. Can be either the smoochId or the userId.

  • integrationIds

    List of integration IDs

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



395
396
397
398
# File 'lib/smooch-api/api/app_user_api.rb', line 395

def get_link_requests(appId, userId, integrationIds, opts = {})
  data, _status_code, _headers = get_link_requests_with_http_info(appId, userId, integrationIds, opts)
  return data
end

Fetch link requests for the specified app user.

Parameters:

  • appId

    Identifies the app.

  • userId

    Identifies the user. Can be either the smoochId or the userId.

  • integrationIds

    List of integration IDs

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(LinkRequestResponse, Fixnum, Hash)>)

    LinkRequestResponse data, response status code and response headers



407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
# File 'lib/smooch-api/api/app_user_api.rb', line 407

def get_link_requests_with_http_info(appId, userId, integrationIds, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppUserApi.get_link_requests ..."
  end
  # verify the required parameter 'appId' is set
  if @api_client.config.client_side_validation && appId.nil?
    fail ArgumentError, "Missing the required parameter 'appId' when calling AppUserApi.get_link_requests"
  end
  # verify the required parameter 'userId' is set
  if @api_client.config.client_side_validation && userId.nil?
    fail ArgumentError, "Missing the required parameter 'userId' when calling AppUserApi.get_link_requests"
  end
  # verify the required parameter 'integrationIds' is set
  if @api_client.config.client_side_validation && integrationIds.nil?
    fail ArgumentError, "Missing the required parameter 'integrationIds' when calling AppUserApi.get_link_requests"
  end
  if @api_client.config.client_side_validation && integrationIds.length < 1
    fail ArgumentError, 'invalid value for "integrationIds" when calling AppUserApi.get_link_requests, number of items must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/v1.1/apps/{appId}/appusers/{userId}/linkrequest".sub('{' + 'appId' + '}', appId.to_s).sub('{' + 'userId' + '}', userId.to_s)

  # query parameters
  query_params = {}
  query_params[:'integrationIds'] = @api_client.build_collection_param(integrationIds, :csv)

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth', 'jwt']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'LinkRequestResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AppUserApi#get_link_requests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Link specified app user to given channel.

Parameters:

  • appId

    Identifies the app.

  • userId

    Identifies the user. Can be either the smoochId or the userId.

  • appUserLinkBody

    Body for a linkAppUser request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



467
468
469
470
# File 'lib/smooch-api/api/app_user_api.rb', line 467

def link_app_user(appId, userId, appUserLinkBody, opts = {})
  data, _status_code, _headers = link_app_user_with_http_info(appId, userId, appUserLinkBody, opts)
  return data
end

Link specified app user to given channel.

Parameters:

  • appId

    Identifies the app.

  • userId

    Identifies the user. Can be either the smoochId or the userId.

  • appUserLinkBody

    Body for a linkAppUser request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AppUserResponse, Fixnum, Hash)>)

    AppUserResponse data, response status code and response headers



479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
# File 'lib/smooch-api/api/app_user_api.rb', line 479

def link_app_user_with_http_info(appId, userId, appUserLinkBody, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppUserApi.link_app_user ..."
  end
  # verify the required parameter 'appId' is set
  if @api_client.config.client_side_validation && appId.nil?
    fail ArgumentError, "Missing the required parameter 'appId' when calling AppUserApi.link_app_user"
  end
  # verify the required parameter 'userId' is set
  if @api_client.config.client_side_validation && userId.nil?
    fail ArgumentError, "Missing the required parameter 'userId' when calling AppUserApi.link_app_user"
  end
  # verify the required parameter 'appUserLinkBody' is set
  if @api_client.config.client_side_validation && appUserLinkBody.nil?
    fail ArgumentError, "Missing the required parameter 'appUserLinkBody' when calling AppUserApi.link_app_user"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}/appusers/{userId}/channels".sub('{' + 'appId' + '}', appId.to_s).sub('{' + 'userId' + '}', userId.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(appUserLinkBody)
  auth_names = ['basicAuth', 'jwt']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AppUserResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AppUserApi#link_app_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#merge_users(appId, appUserMergeBody, opts = {}) ⇒ nil

Force the merge of two specific users, when the business has determined that they represent the same person.

Parameters:

  • appId

    Identifies the app.

  • appUserMergeBody

    Body for a mergeUsers request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


533
534
535
536
# File 'lib/smooch-api/api/app_user_api.rb', line 533

def merge_users(appId, appUserMergeBody, opts = {})
  merge_users_with_http_info(appId, appUserMergeBody, opts)
  return nil
end

#merge_users_with_http_info(appId, appUserMergeBody, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Force the merge of two specific users, when the business has determined that they represent the same person.

Parameters:

  • appId

    Identifies the app.

  • appUserMergeBody

    Body for a mergeUsers request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
# File 'lib/smooch-api/api/app_user_api.rb', line 544

def merge_users_with_http_info(appId, appUserMergeBody, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppUserApi.merge_users ..."
  end
  # verify the required parameter 'appId' is set
  if @api_client.config.client_side_validation && appId.nil?
    fail ArgumentError, "Missing the required parameter 'appId' when calling AppUserApi.merge_users"
  end
  # verify the required parameter 'appUserMergeBody' is set
  if @api_client.config.client_side_validation && appUserMergeBody.nil?
    fail ArgumentError, "Missing the required parameter 'appUserMergeBody' when calling AppUserApi.merge_users"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}/appusers/merge".sub('{' + 'appId' + '}', appId.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(appUserMergeBody)
  auth_names = ['basicAuth', 'jwt']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AppUserApi#merge_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_image_message(appId, userId, source, role, opts = {}) ⇒ MessageResponse

Send an image message to the conversation.

Parameters:

  • appId

    Identifies the app.

  • userId

    Identifies the user. Can be either the smoochId or the userId.

  • source

    Image to be uploaded

  • role

    Role of the sender

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



595
596
597
598
# File 'lib/smooch-api/api/app_user_api.rb', line 595

def post_image_message(appId, userId, source, role, opts = {})
  data, _status_code, _headers = post_image_message_with_http_info(appId, userId, source, role, opts)
  return data
end

#post_image_message_with_http_info(appId, userId, source, role, opts = {}) ⇒ Array<(MessageResponse, Fixnum, Hash)>

Send an image message to the conversation.

Parameters:

  • appId

    Identifies the app.

  • userId

    Identifies the user. Can be either the smoochId or the userId.

  • source

    Image to be uploaded

  • role

    Role of the sender

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(MessageResponse, Fixnum, Hash)>)

    MessageResponse data, response status code and response headers



608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
# File 'lib/smooch-api/api/app_user_api.rb', line 608

def post_image_message_with_http_info(appId, userId, source, role, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppUserApi.post_image_message ..."
  end
  # verify the required parameter 'appId' is set
  if @api_client.config.client_side_validation && appId.nil?
    fail ArgumentError, "Missing the required parameter 'appId' when calling AppUserApi.post_image_message"
  end
  # verify the required parameter 'userId' is set
  if @api_client.config.client_side_validation && userId.nil?
    fail ArgumentError, "Missing the required parameter 'userId' when calling AppUserApi.post_image_message"
  end
  # verify the required parameter 'source' is set
  if @api_client.config.client_side_validation && source.nil?
    fail ArgumentError, "Missing the required parameter 'source' when calling AppUserApi.post_image_message"
  end
  # verify the required parameter 'role' is set
  if @api_client.config.client_side_validation && role.nil?
    fail ArgumentError, "Missing the required parameter 'role' when calling AppUserApi.post_image_message"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}/appusers/{userId}/images".sub('{' + 'appId' + '}', appId.to_s).sub('{' + 'userId' + '}', userId.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params["source"] = source
  form_params["role"] = role

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth', 'jwt']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'MessageResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AppUserApi#post_image_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#pre_create_app_user(appId, appUserPreCreateBody, opts = {}) ⇒ AppUserResponse

Pre-create an app user.

Parameters:

  • appId

    Identifies the app.

  • appUserPreCreateBody

    Body for a preCreateAppUser request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



668
669
670
671
# File 'lib/smooch-api/api/app_user_api.rb', line 668

def pre_create_app_user(appId, appUserPreCreateBody, opts = {})
  data, _status_code, _headers = pre_create_app_user_with_http_info(appId, appUserPreCreateBody, opts)
  return data
end

#pre_create_app_user_with_http_info(appId, appUserPreCreateBody, opts = {}) ⇒ Array<(AppUserResponse, Fixnum, Hash)>

Pre-create an app user.

Parameters:

  • appId

    Identifies the app.

  • appUserPreCreateBody

    Body for a preCreateAppUser request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AppUserResponse, Fixnum, Hash)>)

    AppUserResponse data, response status code and response headers



679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
# File 'lib/smooch-api/api/app_user_api.rb', line 679

def pre_create_app_user_with_http_info(appId, appUserPreCreateBody, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppUserApi.pre_create_app_user ..."
  end
  # verify the required parameter 'appId' is set
  if @api_client.config.client_side_validation && appId.nil?
    fail ArgumentError, "Missing the required parameter 'appId' when calling AppUserApi.pre_create_app_user"
  end
  # verify the required parameter 'appUserPreCreateBody' is set
  if @api_client.config.client_side_validation && appUserPreCreateBody.nil?
    fail ArgumentError, "Missing the required parameter 'appUserPreCreateBody' when calling AppUserApi.pre_create_app_user"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}/appusers".sub('{' + 'appId' + '}', appId.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(appUserPreCreateBody)
  auth_names = ['basicAuth', 'jwt']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AppUserResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AppUserApi#pre_create_app_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Unlink specified app user from given channel.

Parameters:

  • appId

    Identifies the app.

  • userId

    Identifies the user. Can be either the smoochId or the userId.

  • channel

    Name of the channel.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


730
731
732
733
# File 'lib/smooch-api/api/app_user_api.rb', line 730

def unlink_app_user(appId, userId, channel, opts = {})
  unlink_app_user_with_http_info(appId, userId, channel, opts)
  return nil
end

Unlink specified app user from given channel.

Parameters:

  • appId

    Identifies the app.

  • userId

    Identifies the user. Can be either the smoochId or the userId.

  • channel

    Name of the channel.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
# File 'lib/smooch-api/api/app_user_api.rb', line 742

def unlink_app_user_with_http_info(appId, userId, channel, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppUserApi.unlink_app_user ..."
  end
  # verify the required parameter 'appId' is set
  if @api_client.config.client_side_validation && appId.nil?
    fail ArgumentError, "Missing the required parameter 'appId' when calling AppUserApi.unlink_app_user"
  end
  # verify the required parameter 'userId' is set
  if @api_client.config.client_side_validation && userId.nil?
    fail ArgumentError, "Missing the required parameter 'userId' when calling AppUserApi.unlink_app_user"
  end
  # verify the required parameter 'channel' is set
  if @api_client.config.client_side_validation && channel.nil?
    fail ArgumentError, "Missing the required parameter 'channel' when calling AppUserApi.unlink_app_user"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}/appusers/{userId}/channels/{channel}".sub('{' + 'appId' + '}', appId.to_s).sub('{' + 'userId' + '}', userId.to_s).sub('{' + 'channel' + '}', channel.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth', 'jwt']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AppUserApi#unlink_app_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_app_user(appId, userId, appUserUpdateBody, opts = {}) ⇒ AppUserResponse

Update the specified app user.

Parameters:

  • appId

    Identifies the app.

  • userId

    Identifies the user. Can be either the smoochId or the userId.

  • appUserUpdateBody

    Body for an updateAppUser request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



796
797
798
799
# File 'lib/smooch-api/api/app_user_api.rb', line 796

def update_app_user(appId, userId, appUserUpdateBody, opts = {})
  data, _status_code, _headers = update_app_user_with_http_info(appId, userId, appUserUpdateBody, opts)
  return data
end

#update_app_user_with_http_info(appId, userId, appUserUpdateBody, opts = {}) ⇒ Array<(AppUserResponse, Fixnum, Hash)>

Update the specified app user.

Parameters:

  • appId

    Identifies the app.

  • userId

    Identifies the user. Can be either the smoochId or the userId.

  • appUserUpdateBody

    Body for an updateAppUser request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AppUserResponse, Fixnum, Hash)>)

    AppUserResponse data, response status code and response headers



808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
# File 'lib/smooch-api/api/app_user_api.rb', line 808

def update_app_user_with_http_info(appId, userId, appUserUpdateBody, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppUserApi.update_app_user ..."
  end
  # verify the required parameter 'appId' is set
  if @api_client.config.client_side_validation && appId.nil?
    fail ArgumentError, "Missing the required parameter 'appId' when calling AppUserApi.update_app_user"
  end
  # verify the required parameter 'userId' is set
  if @api_client.config.client_side_validation && userId.nil?
    fail ArgumentError, "Missing the required parameter 'userId' when calling AppUserApi.update_app_user"
  end
  # verify the required parameter 'appUserUpdateBody' is set
  if @api_client.config.client_side_validation && appUserUpdateBody.nil?
    fail ArgumentError, "Missing the required parameter 'appUserUpdateBody' when calling AppUserApi.update_app_user"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}/appusers/{userId}".sub('{' + 'appId' + '}', appId.to_s).sub('{' + 'userId' + '}', userId.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(appUserUpdateBody)
  auth_names = ['basicAuth', 'jwt']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AppUserResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AppUserApi#update_app_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end