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_profile(app_id, user_id, opts = {}) ⇒ AppUserResponse

Delete specified app user’s profile.

Parameters:

  • app_id

    Identifies the app.

  • user_id

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

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

    the optional parameters

Returns:



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

def (app_id, user_id, opts = {})
  data, _status_code, _headers = (app_id, user_id, opts)
  return data
end

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

Delete specified app user&#39;s profile.

Parameters:

  • app_id

    Identifies the app.

  • user_id

    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



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
82
# File 'lib/smooch-api/api/app_user_api.rb', line 40

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

#get_app_user(app_id, user_id, opts = {}) ⇒ AppUserResponse

Get the specified app user.

Parameters:

  • app_id

    Identifies the app.

  • user_id

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

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

    the optional parameters

Returns:



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

def get_app_user(app_id, user_id, opts = {})
  data, _status_code, _headers = get_app_user_with_http_info(app_id, user_id, opts)
  return data
end

#get_app_user_auth_code(app_id, user_id, opts = {}) ⇒ AuthCodeResponse

Get an auth code for facilitating a channel transfer

Parameters:

  • app_id

    Identifies the app.

  • user_id

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

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

    the optional parameters

Returns:



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

def get_app_user_auth_code(app_id, user_id, opts = {})
  data, _status_code, _headers = get_app_user_auth_code_with_http_info(app_id, user_id, opts)
  return data
end

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

Get an auth code for facilitating a channel transfer

Parameters:

  • app_id

    Identifies the app.

  • user_id

    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



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
204
# File 'lib/smooch-api/api/app_user_api.rb', line 162

def get_app_user_auth_code_with_http_info(app_id, user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppUserApi.get_app_user_auth_code ..."
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling AppUserApi.get_app_user_auth_code"
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling AppUserApi.get_app_user_auth_code"
  end
  # resource path
  local_var_path = "/v1/apps/{appId}/appusers/{userId}/authcode".sub('{' + 'appId' + '}', app_id.to_s).sub('{' + 'userId' + '}', user_id.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 = ['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(app_id, user_id, opts = {}) ⇒ AppUserBusinessSystemsResponse

Get specified app user’s business system IDs.

Parameters:

  • app_id

    Identifies the app.

  • user_id

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

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

    the optional parameters

Returns:



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

def get_app_user_business_system_ids(app_id, user_id, opts = {})
  data, _status_code, _headers = get_app_user_business_system_ids_with_http_info(app_id, user_id, opts)
  return data
end

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

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

Parameters:

  • app_id

    Identifies the app.

  • user_id

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

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

    the optional parameters

Returns:



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
265
# File 'lib/smooch-api/api/app_user_api.rb', line 223

def get_app_user_business_system_ids_with_http_info(app_id, user_id, 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 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling AppUserApi.get_app_user_business_system_ids"
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling AppUserApi.get_app_user_business_system_ids"
  end
  # resource path
  local_var_path = "/v1/apps/{appId}/appusers/{userId}/businesssystems".sub('{' + 'appId' + '}', app_id.to_s).sub('{' + 'userId' + '}', user_id.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 = ['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(app_id, user_id, opts = {}) ⇒ AppUserChannelsResponse

Get specified app user’s channel entity IDs.

Parameters:

  • app_id

    Identifies the app.

  • user_id

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

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

    the optional parameters

Returns:



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

def get_app_user_entity_ids(app_id, user_id, opts = {})
  data, _status_code, _headers = get_app_user_entity_ids_with_http_info(app_id, user_id, opts)
  return data
end

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

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

Parameters:

  • app_id

    Identifies the app.

  • user_id

    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



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
326
# File 'lib/smooch-api/api/app_user_api.rb', line 284

def get_app_user_entity_ids_with_http_info(app_id, user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppUserApi.get_app_user_entity_ids ..."
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling AppUserApi.get_app_user_entity_ids"
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling AppUserApi.get_app_user_entity_ids"
  end
  # resource path
  local_var_path = "/v1/apps/{appId}/appusers/{userId}/channels".sub('{' + 'appId' + '}', app_id.to_s).sub('{' + 'userId' + '}', user_id.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 = ['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(app_id, user_id, opts = {}) ⇒ Array<(AppUserResponse, Fixnum, Hash)>

Get the specified app user.

Parameters:

  • app_id

    Identifies the app.

  • user_id

    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



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
143
# File 'lib/smooch-api/api/app_user_api.rb', line 101

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

  • app_id

    Identifies the app.

  • user_id

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

  • integration_ids

    List of integration IDs

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

    the optional parameters

Returns:



335
336
337
338
# File 'lib/smooch-api/api/app_user_api.rb', line 335

def get_link_requests(app_id, user_id, integration_ids, opts = {})
  data, _status_code, _headers = get_link_requests_with_http_info(app_id, user_id, integration_ids, opts)
  return data
end

Fetch link requests for the specified app user.

Parameters:

  • app_id

    Identifies the app.

  • user_id

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

  • integration_ids

    List of integration IDs

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

    the optional parameters

Returns:

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

    LinkRequestResponse data, response status code and response headers



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
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/smooch-api/api/app_user_api.rb', line 347

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

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

  # query parameters
  query_params = {}
  query_params[:'integrationIds'] = @api_client.build_collection_param(integration_ids, :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 = ['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:

  • app_id

    Identifies the app.

  • user_id

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

  • app_user_link_body

    Body for a linkAppUser request.

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

    the optional parameters

Returns:



407
408
409
410
# File 'lib/smooch-api/api/app_user_api.rb', line 407

def link_app_user(app_id, user_id, app_user_link_body, opts = {})
  data, _status_code, _headers = link_app_user_with_http_info(app_id, user_id, app_user_link_body, opts)
  return data
end

Link specified app user to given channel.

Parameters:

  • app_id

    Identifies the app.

  • user_id

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

  • app_user_link_body

    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



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
459
460
461
462
463
464
465
# File 'lib/smooch-api/api/app_user_api.rb', line 419

def link_app_user_with_http_info(app_id, user_id, app_user_link_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppUserApi.link_app_user ..."
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling AppUserApi.link_app_user"
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling AppUserApi.link_app_user"
  end
  # verify the required parameter 'app_user_link_body' is set
  if @api_client.config.client_side_validation && app_user_link_body.nil?
    fail ArgumentError, "Missing the required parameter 'app_user_link_body' when calling AppUserApi.link_app_user"
  end
  # resource path
  local_var_path = "/v1/apps/{appId}/appusers/{userId}/channels".sub('{' + 'appId' + '}', app_id.to_s).sub('{' + 'userId' + '}', user_id.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(app_user_link_body)
  auth_names = ['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

#post_image_message(app_id, user_id, source, role, opts = {}) ⇒ MessageResponse

Send an image message to the conversation.

Parameters:

  • app_id

    Identifies the app.

  • user_id

    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:



475
476
477
478
# File 'lib/smooch-api/api/app_user_api.rb', line 475

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

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

Send an image message to the conversation.

Parameters:

  • app_id

    Identifies the app.

  • user_id

    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



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
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
# File 'lib/smooch-api/api/app_user_api.rb', line 488

def post_image_message_with_http_info(app_id, user_id, source, role, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppUserApi.post_image_message ..."
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling AppUserApi.post_image_message"
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' 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/apps/{appId}/appusers/{userId}/images".sub('{' + 'appId' + '}', app_id.to_s).sub('{' + 'userId' + '}', user_id.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 = ['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(app_id, app_user_pre_create_body, opts = {}) ⇒ AppUserResponse

Pre-create an app user.

Parameters:

  • app_id

    Identifies the app.

  • app_user_pre_create_body

    Body for a preCreateAppUser request.

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

    the optional parameters

Returns:



548
549
550
551
# File 'lib/smooch-api/api/app_user_api.rb', line 548

def pre_create_app_user(app_id, app_user_pre_create_body, opts = {})
  data, _status_code, _headers = pre_create_app_user_with_http_info(app_id, app_user_pre_create_body, opts)
  return data
end

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

Pre-create an app user.

Parameters:

  • app_id

    Identifies the app.

  • app_user_pre_create_body

    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



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
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
# File 'lib/smooch-api/api/app_user_api.rb', line 559

def pre_create_app_user_with_http_info(app_id, app_user_pre_create_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppUserApi.pre_create_app_user ..."
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling AppUserApi.pre_create_app_user"
  end
  # verify the required parameter 'app_user_pre_create_body' is set
  if @api_client.config.client_side_validation && app_user_pre_create_body.nil?
    fail ArgumentError, "Missing the required parameter 'app_user_pre_create_body' when calling AppUserApi.pre_create_app_user"
  end
  # resource path
  local_var_path = "/v1/apps/{appId}/appusers".sub('{' + 'appId' + '}', app_id.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(app_user_pre_create_body)
  auth_names = ['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:

  • app_id

    Identifies the app.

  • user_id

    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)


610
611
612
613
# File 'lib/smooch-api/api/app_user_api.rb', line 610

def unlink_app_user(app_id, user_id, channel, opts = {})
  unlink_app_user_with_http_info(app_id, user_id, channel, opts)
  return nil
end

Unlink specified app user from given channel.

Parameters:

  • app_id

    Identifies the app.

  • user_id

    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



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
661
662
663
664
665
666
667
# File 'lib/smooch-api/api/app_user_api.rb', line 622

def unlink_app_user_with_http_info(app_id, user_id, channel, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppUserApi.unlink_app_user ..."
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling AppUserApi.unlink_app_user"
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' 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/apps/{appId}/appusers/{userId}/channels/{channel}".sub('{' + 'appId' + '}', app_id.to_s).sub('{' + 'userId' + '}', user_id.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 = ['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(app_id, user_id, app_user_update_body, opts = {}) ⇒ AppUserResponse

Update the specified app user.

Parameters:

  • app_id

    Identifies the app.

  • user_id

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

  • app_user_update_body

    Body for an updateAppUser request.

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

    the optional parameters

Returns:



676
677
678
679
# File 'lib/smooch-api/api/app_user_api.rb', line 676

def update_app_user(app_id, user_id, app_user_update_body, opts = {})
  data, _status_code, _headers = update_app_user_with_http_info(app_id, user_id, app_user_update_body, opts)
  return data
end

#update_app_user_with_http_info(app_id, user_id, app_user_update_body, opts = {}) ⇒ Array<(AppUserResponse, Fixnum, Hash)>

Update the specified app user.

Parameters:

  • app_id

    Identifies the app.

  • user_id

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

  • app_user_update_body

    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



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
722
723
724
725
726
727
728
729
730
731
732
733
734
# File 'lib/smooch-api/api/app_user_api.rb', line 688

def update_app_user_with_http_info(app_id, user_id, app_user_update_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppUserApi.update_app_user ..."
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling AppUserApi.update_app_user"
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling AppUserApi.update_app_user"
  end
  # verify the required parameter 'app_user_update_body' is set
  if @api_client.config.client_side_validation && app_user_update_body.nil?
    fail ArgumentError, "Missing the required parameter 'app_user_update_body' when calling AppUserApi.update_app_user"
  end
  # resource path
  local_var_path = "/v1/apps/{appId}/appusers/{userId}".sub('{' + 'appId' + '}', app_id.to_s).sub('{' + 'userId' + '}', user_id.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(app_user_update_body)
  auth_names = ['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