Class: SmoochApi::ServiceAccountApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ServiceAccountApi

Returns a new instance of ServiceAccountApi.



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

def api_client
  @api_client
end

Instance Method Details

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

Create a secret key for the specified service account.

Parameters:

  • serviceAccountId

    Identifies the service account.

  • secretKeyCreateBody

    Body for a createSecretKey request.

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

    the optional parameters

Returns:



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

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

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

Create a secret key for the specified service account.

Parameters:

  • serviceAccountId

    Identifies the service account.

  • 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



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/service_account_api.rb', line 40

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

#create_service_account(serviceAccountCreateBody, opts = {}) ⇒ ServiceAccountResponse

Create a new service account.

Parameters:

  • serviceAccountCreateBody

    Body for a createServiceAccount request.

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

    the optional parameters

Returns:



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

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

#create_service_account_with_http_info(serviceAccountCreateBody, opts = {}) ⇒ Array<(ServiceAccountResponse, Fixnum, Hash)>

Create a new service account.

Parameters:

  • serviceAccountCreateBody

    Body for a createServiceAccount request.

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

    the optional parameters

Returns:

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

    ServiceAccountResponse data, response status code and response headers



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/service_account_api.rb', line 99

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

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

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

Delete the specified service account secret key.

Parameters:

  • serviceAccountId

    Identifies the service account.

  • keyId

    Identifies the secret key.

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

    the optional parameters

Returns:

  • (nil)


145
146
147
148
# File 'lib/smooch-api/api/service_account_api.rb', line 145

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

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

Delete the specified service account secret key.

Parameters:

  • serviceAccountId

    Identifies the service account.

  • keyId

    Identifies the secret key.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
192
193
194
195
196
197
# File 'lib/smooch-api/api/service_account_api.rb', line 156

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

#delete_service_account(serviceAccountId, opts = {}) ⇒ nil

Delete the specified service account.

Parameters:

  • serviceAccountId

    Identifies the service account.

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

    the optional parameters

Returns:

  • (nil)


204
205
206
207
# File 'lib/smooch-api/api/service_account_api.rb', line 204

def (serviceAccountId, opts = {})
  (serviceAccountId, opts)
  return nil
end

#delete_service_account_with_http_info(serviceAccountId, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete the specified service account.

Parameters:

  • serviceAccountId

    Identifies the service account.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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/service_account_api.rb', line 214

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

#get_jwt(serviceAccountId, keyId, opts = {}) ⇒ JwtResponse

Get an account-scoped JWT for the specified service account secret key.

Parameters:

  • serviceAccountId

    Identifies the service account.

  • keyId

    Identifies the secret key.

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

    the optional parameters

Returns:



259
260
261
262
# File 'lib/smooch-api/api/service_account_api.rb', line 259

def get_jwt(serviceAccountId, keyId, opts = {})
  data, _status_code, _headers = get_jwt_with_http_info(serviceAccountId, keyId, opts)
  return data
end

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

Get an account-scoped JWT for the specified service account secret key.

Parameters:

  • serviceAccountId

    Identifies the service account.

  • 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



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
307
308
309
310
311
312
# File 'lib/smooch-api/api/service_account_api.rb', line 270

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

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

Get the specified service account secret key.

Parameters:

  • serviceAccountId

    Identifies the service account.

  • keyId

    Identifies the secret key.

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

    the optional parameters

Returns:



320
321
322
323
# File 'lib/smooch-api/api/service_account_api.rb', line 320

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

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

Get the specified service account secret key.

Parameters:

  • serviceAccountId

    Identifies the service account.

  • 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



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
368
369
370
371
372
373
# File 'lib/smooch-api/api/service_account_api.rb', line 331

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

#get_service_account(serviceAccountId, opts = {}) ⇒ ServiceAccountResponse

Get the specified service account.

Parameters:

  • serviceAccountId

    Identifies the service account.

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

    the optional parameters

Returns:



380
381
382
383
# File 'lib/smooch-api/api/service_account_api.rb', line 380

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

#get_service_account_with_http_info(serviceAccountId, opts = {}) ⇒ Array<(ServiceAccountResponse, Fixnum, Hash)>

Get the specified service account.

Parameters:

  • serviceAccountId

    Identifies the service account.

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

    the optional parameters

Returns:

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

    ServiceAccountResponse data, response status code and response headers



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
423
424
425
426
427
428
# File 'lib/smooch-api/api/service_account_api.rb', line 390

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

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

List the secret keys for the specified service account.

Parameters:

  • serviceAccountId

    Identifies the service account.

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

    the optional parameters

Returns:



435
436
437
438
# File 'lib/smooch-api/api/service_account_api.rb', line 435

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

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

List the secret keys for the specified service account.

Parameters:

  • serviceAccountId

    Identifies the service account.

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

    the optional parameters

Returns:

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

    ListSecretKeysResponse data, response status code and response headers



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/service_account_api.rb', line 445

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

#list_service_accounts(opts = {}) ⇒ ListServiceAccountsResponse

List all service accounts 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)

Returns:



491
492
493
494
# File 'lib/smooch-api/api/service_account_api.rb', line 491

def list_service_accounts(opts = {})
  data, _status_code, _headers = list_service_accounts_with_http_info(opts)
  return data
end

#list_service_accounts_with_http_info(opts = {}) ⇒ Array<(ListServiceAccountsResponse, Fixnum, Hash)>

List all service accounts 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.

Returns:



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

def list_service_accounts_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ServiceAccountApi.list_service_accounts ..."
  end
  # resource path
  local_var_path = "/v1.1/serviceaccounts"

  # query parameters
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].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 => 'ListServiceAccountsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ServiceAccountApi#list_service_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_service_account(serviceAccountId, serviceAccountUpdateBody, opts = {}) ⇒ ServiceAccountResponse

Update the specified service account.

Parameters:

  • serviceAccountId

    Identifies the service account.

  • serviceAccountUpdateBody

    Body for an updateServiceAccount request.

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

    the optional parameters

Returns:



546
547
548
549
# File 'lib/smooch-api/api/service_account_api.rb', line 546

def (serviceAccountId, serviceAccountUpdateBody, opts = {})
  data, _status_code, _headers = (serviceAccountId, serviceAccountUpdateBody, opts)
  return data
end

#update_service_account_with_http_info(serviceAccountId, serviceAccountUpdateBody, opts = {}) ⇒ Array<(ServiceAccountResponse, Fixnum, Hash)>

Update the specified service account.

Parameters:

  • serviceAccountId

    Identifies the service account.

  • serviceAccountUpdateBody

    Body for an updateServiceAccount request.

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

    the optional parameters

Returns:

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

    ServiceAccountResponse data, response status code and response headers



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

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