Class: SmoochApi::AppApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AppApi

Returns a new instance of AppApi.



19
20
21
# File 'lib/smooch-api/api/app_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_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_app(appCreateBody, opts = {}) ⇒ AppResponse

Create a new app.

Parameters:

  • appCreateBody

    Body for a createApp request.

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/smooch-api/api/app_api.rb', line 28

def create_app(appCreateBody, opts = {})
  data, _status_code, _headers = create_app_with_http_info(appCreateBody, opts)
  return data
end

#create_app_with_http_info(appCreateBody, opts = {}) ⇒ Array<(AppResponse, Fixnum, Hash)>

Create a new app.

Parameters:

  • appCreateBody

    Body for a createApp request.

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

    the optional parameters

Returns:

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

    AppResponse data, response status code and response headers



38
39
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
# File 'lib/smooch-api/api/app_api.rb', line 38

def create_app_with_http_info(appCreateBody, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppApi.create_app ..."
  end
  # verify the required parameter 'appCreateBody' is set
  if @api_client.config.client_side_validation && appCreateBody.nil?
    fail ArgumentError, "Missing the required parameter 'appCreateBody' when calling AppApi.create_app"
  end
  # resource path
  local_var_path = "/v1.1/apps"

  # 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(appCreateBody)
  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 => 'AppResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AppApi#create_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_secret_key(appId, secretKeyCreateBody, opts = {}) ⇒ SecretKeyResponse

Create a secret key for the specified app.

Parameters:

  • appId

    Identifies the app.

  • secretKeyCreateBody

    Body for a createSecretKey request.

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

    the optional parameters

Returns:



84
85
86
87
# File 'lib/smooch-api/api/app_api.rb', line 84

def create_secret_key(appId, secretKeyCreateBody, opts = {})
  data, _status_code, _headers = create_secret_key_with_http_info(appId, secretKeyCreateBody, opts)
  return data
end

#create_secret_key_with_http_info(appId, secretKeyCreateBody, opts = {}) ⇒ Array<(SecretKeyResponse, Fixnum, Hash)>

Create a secret key for the specified app.

Parameters:

  • appId

    Identifies the app.

  • secretKeyCreateBody

    Body for a createSecretKey request.

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

    the optional parameters

Returns:

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

    SecretKeyResponse data, response status code and response headers



95
96
97
98
99
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
# File 'lib/smooch-api/api/app_api.rb', line 95

def create_secret_key_with_http_info(appId, secretKeyCreateBody, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppApi.create_secret_key ..."
  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 AppApi.create_secret_key"
  end
  # verify the required parameter 'secretKeyCreateBody' is set
  if @api_client.config.client_side_validation && secretKeyCreateBody.nil?
    fail ArgumentError, "Missing the required parameter 'secretKeyCreateBody' when calling AppApi.create_secret_key"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}/keys".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(secretKeyCreateBody)
  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 => 'SecretKeyResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AppApi#create_secret_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_app(appId, opts = {}) ⇒ nil

Delete the specified app.

Parameters:

  • appId

    Identifies the app.

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

    the optional parameters

Returns:

  • (nil)


144
145
146
147
# File 'lib/smooch-api/api/app_api.rb', line 144

def delete_app(appId, opts = {})
  delete_app_with_http_info(appId, opts)
  return nil
end

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

Delete the specified app.

Parameters:

  • appId

    Identifies the app.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



154
155
156
157
158
159
160
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
# File 'lib/smooch-api/api/app_api.rb', line 154

def delete_app_with_http_info(appId, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppApi.delete_app ..."
  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 AppApi.delete_app"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}".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 = 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: AppApi#delete_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_secret_key(appId, keyId, opts = {}) ⇒ nil

Delete the specified secret key.

Parameters:

  • appId

    Identifies the app.

  • keyId

    Identifies the secret key.

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

    the optional parameters

Returns:

  • (nil)


199
200
201
202
# File 'lib/smooch-api/api/app_api.rb', line 199

def delete_secret_key(appId, keyId, opts = {})
  delete_secret_key_with_http_info(appId, keyId, opts)
  return nil
end

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

Delete the specified secret key.

Parameters:

  • appId

    Identifies the app.

  • keyId

    Identifies the secret key.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



210
211
212
213
214
215
216
217
218
219
220
221
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
# File 'lib/smooch-api/api/app_api.rb', line 210

def delete_secret_key_with_http_info(appId, keyId, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppApi.delete_secret_key ..."
  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 AppApi.delete_secret_key"
  end
  # verify the required parameter 'keyId' is set
  if @api_client.config.client_side_validation && keyId.nil?
    fail ArgumentError, "Missing the required parameter 'keyId' when calling AppApi.delete_secret_key"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}/keys/{keyId}".sub('{' + 'appId' + '}', appId.to_s).sub('{' + 'keyId' + '}', keyId.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: AppApi#delete_secret_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_app(appId, opts = {}) ⇒ AppResponse

Get the specified app.

Parameters:

  • appId

    Identifies the app.

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

    the optional parameters

Returns:



258
259
260
261
# File 'lib/smooch-api/api/app_api.rb', line 258

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

#get_app_jwt(appId, keyId, opts = {}) ⇒ JwtResponse

Get an app-scoped JWT for the specified secret key.

Parameters:

  • appId

    Identifies the app.

  • keyId

    Identifies the secret key.

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

    the optional parameters

Returns:



314
315
316
317
# File 'lib/smooch-api/api/app_api.rb', line 314

def get_app_jwt(appId, keyId, opts = {})
  data, _status_code, _headers = get_app_jwt_with_http_info(appId, keyId, opts)
  return data
end

#get_app_jwt_with_http_info(appId, keyId, opts = {}) ⇒ Array<(JwtResponse, Fixnum, Hash)>

Get an app-scoped JWT for the specified secret key.

Parameters:

  • appId

    Identifies the app.

  • keyId

    Identifies the secret key.

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

    the optional parameters

Returns:

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

    JwtResponse data, response status code and response headers



325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
# File 'lib/smooch-api/api/app_api.rb', line 325

def get_app_jwt_with_http_info(appId, keyId, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppApi.get_app_jwt ..."
  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 AppApi.get_app_jwt"
  end
  # verify the required parameter 'keyId' is set
  if @api_client.config.client_side_validation && keyId.nil?
    fail ArgumentError, "Missing the required parameter 'keyId' when calling AppApi.get_app_jwt"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}/keys/{keyId}/jwt".sub('{' + 'appId' + '}', appId.to_s).sub('{' + 'keyId' + '}', keyId.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 => 'JwtResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AppApi#get_app_jwt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_app_with_http_info(appId, opts = {}) ⇒ Array<(AppResponse, Fixnum, Hash)>

Get the specified app.

Parameters:

  • appId

    Identifies the app.

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

    the optional parameters

Returns:

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

    AppResponse data, response status code and response headers



268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
# File 'lib/smooch-api/api/app_api.rb', line 268

def get_app_with_http_info(appId, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppApi.get_app ..."
  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 AppApi.get_app"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}".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 = 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 => 'AppResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AppApi#get_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_sdk_ids(appId, opts = {}) ⇒ GetSdkIdsResponse

Retrieve the IDs of the three SDK integrations (‘android`, `ios`, and `web`) for the specified app, to be used when initializing the SDKs.

Parameters:

  • appId

    Identifies the app.

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

    the optional parameters

Returns:



374
375
376
377
# File 'lib/smooch-api/api/app_api.rb', line 374

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

#get_sdk_ids_with_http_info(appId, opts = {}) ⇒ Array<(GetSdkIdsResponse, Fixnum, Hash)>

Retrieve the IDs of the three SDK integrations (&#x60;android&#x60;, &#x60;ios&#x60;, and &#x60;web&#x60;) for the specified app, to be used when initializing the SDKs.

Parameters:

  • appId

    Identifies the app.

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

    the optional parameters

Returns:

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

    GetSdkIdsResponse data, response status code and response headers



384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/smooch-api/api/app_api.rb', line 384

def get_sdk_ids_with_http_info(appId, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppApi.get_sdk_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 AppApi.get_sdk_ids"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}/sdks".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 = 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 => 'GetSdkIdsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AppApi#get_sdk_ids\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_secret_key(appId, keyId, opts = {}) ⇒ SecretKeyResponse

Get the specified secret key.

Parameters:

  • appId

    Identifies the app.

  • keyId

    Identifies the secret key.

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

    the optional parameters

Returns:



430
431
432
433
# File 'lib/smooch-api/api/app_api.rb', line 430

def get_secret_key(appId, keyId, opts = {})
  data, _status_code, _headers = get_secret_key_with_http_info(appId, keyId, opts)
  return data
end

#get_secret_key_with_http_info(appId, keyId, opts = {}) ⇒ Array<(SecretKeyResponse, Fixnum, Hash)>

Get the specified secret key.

Parameters:

  • appId

    Identifies the app.

  • keyId

    Identifies the secret key.

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

    the optional parameters

Returns:

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

    SecretKeyResponse data, response status code and response headers



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
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
# File 'lib/smooch-api/api/app_api.rb', line 441

def get_secret_key_with_http_info(appId, keyId, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppApi.get_secret_key ..."
  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 AppApi.get_secret_key"
  end
  # verify the required parameter 'keyId' is set
  if @api_client.config.client_side_validation && keyId.nil?
    fail ArgumentError, "Missing the required parameter 'keyId' when calling AppApi.get_secret_key"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}/keys/{keyId}".sub('{' + 'appId' + '}', appId.to_s).sub('{' + 'keyId' + '}', keyId.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 => 'SecretKeyResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AppApi#get_secret_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_apps(opts = {}) ⇒ ListAppsResponse

List all apps configured.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of records to return. (default to 25)

  • :offset (Integer)

    The number of initial records to skip before picking records to return. (default to 0)

  • :serviceAccountId (String)

    The service account ID for which to list apps. (default to )

Returns:



492
493
494
495
# File 'lib/smooch-api/api/app_api.rb', line 492

def list_apps(opts = {})
  data, _status_code, _headers = list_apps_with_http_info(opts)
  return data
end

#list_apps_with_http_info(opts = {}) ⇒ Array<(ListAppsResponse, Fixnum, Hash)>

List all apps configured.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of records to return.

  • :offset (Integer)

    The number of initial records to skip before picking records to return.

  • :serviceAccountId (String)

    The service account ID for which to list apps.

Returns:

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

    ListAppsResponse data, response status code and response headers



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
541
# File 'lib/smooch-api/api/app_api.rb', line 504

def list_apps_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppApi.list_apps ..."
  end
  # resource path
  local_var_path = "/v1.1/apps"

  # query parameters
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'serviceAccountId'] = opts[:'serviceAccountId'] if !opts[:'serviceAccountId'].nil?

  # 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 => 'ListAppsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AppApi#list_apps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_secret_keys(appId, opts = {}) ⇒ ListSecretKeysResponse

List the secret keys for the specified app.

Parameters:

  • appId

    Identifies the app.

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

    the optional parameters

Returns:



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

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

#list_secret_keys_with_http_info(appId, opts = {}) ⇒ Array<(ListSecretKeysResponse, Fixnum, Hash)>

List the secret keys for the specified app.

Parameters:

  • appId

    Identifies the app.

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

    the optional parameters

Returns:

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

    ListSecretKeysResponse data, response status code and response headers



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
586
587
588
589
590
591
592
593
594
595
596
# File 'lib/smooch-api/api/app_api.rb', line 558

def list_secret_keys_with_http_info(appId, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppApi.list_secret_keys ..."
  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 AppApi.list_secret_keys"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}/keys".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 = 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 => 'ListSecretKeysResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AppApi#list_secret_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_app(appId, appUpdateBody, opts = {}) ⇒ AppResponse

Update the specified app.

Parameters:

  • appId

    Identifies the app.

  • appUpdateBody

    Body for an updateApp request.

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

    the optional parameters

Returns:



604
605
606
607
# File 'lib/smooch-api/api/app_api.rb', line 604

def update_app(appId, appUpdateBody, opts = {})
  data, _status_code, _headers = update_app_with_http_info(appId, appUpdateBody, opts)
  return data
end

#update_app_with_http_info(appId, appUpdateBody, opts = {}) ⇒ Array<(AppResponse, Fixnum, Hash)>

Update the specified app.

Parameters:

  • appId

    Identifies the app.

  • appUpdateBody

    Body for an updateApp request.

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

    the optional parameters

Returns:

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

    AppResponse data, response status code and response headers



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
# File 'lib/smooch-api/api/app_api.rb', line 615

def update_app_with_http_info(appId, appUpdateBody, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AppApi.update_app ..."
  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 AppApi.update_app"
  end
  # verify the required parameter 'appUpdateBody' is set
  if @api_client.config.client_side_validation && appUpdateBody.nil?
    fail ArgumentError, "Missing the required parameter 'appUpdateBody' when calling AppApi.update_app"
  end
  # resource path
  local_var_path = "/v1.1/apps/{appId}".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(appUpdateBody)
  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 => 'AppResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AppApi#update_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end