Class: RBACApiClient::GroupApi

Inherits:
Object
  • Object
show all
Defined in:
lib/rbac-api-client/api/group_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ GroupApi

Returns a new instance of GroupApi.



19
20
21
# File 'lib/rbac-api-client/api/group_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/rbac-api-client/api/group_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_principal_to_group(uuid, group_principal_in, opts = {}) ⇒ GroupWithPrincipalsAndRoles

Add a principal to a group in the tenant

Parameters:

  • uuid (String)

    ID of group to update

  • group_principal_in (GroupPrincipalIn)

    Principal to add to a group

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

    the optional parameters

Returns:



27
28
29
30
# File 'lib/rbac-api-client/api/group_api.rb', line 27

def add_principal_to_group(uuid, group_principal_in, opts = {})
  data, _status_code, _headers = add_principal_to_group_with_http_info(uuid, group_principal_in, opts)
  data
end

#add_principal_to_group_with_http_info(uuid, group_principal_in, opts = {}) ⇒ Array<(GroupWithPrincipalsAndRoles, Integer, Hash)>

Add a principal to a group in the tenant

Parameters:

  • uuid (String)

    ID of group to update

  • group_principal_in (GroupPrincipalIn)

    Principal to add to a group

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

    the optional parameters

Returns:

  • (Array<(GroupWithPrincipalsAndRoles, Integer, Hash)>)

    GroupWithPrincipalsAndRoles data, response status code and response headers



37
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
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rbac-api-client/api/group_api.rb', line 37

def add_principal_to_group_with_http_info(uuid, group_principal_in, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GroupApi.add_principal_to_group ...'
  end
  # verify the required parameter 'uuid' is set
  if @api_client.config.client_side_validation && uuid.nil?
    fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.add_principal_to_group"
  end
  # verify the required parameter 'group_principal_in' is set
  if @api_client.config.client_side_validation && group_principal_in.nil?
    fail ArgumentError, "Missing the required parameter 'group_principal_in' when calling GroupApi.add_principal_to_group"
  end
  # resource path
  local_var_path = '/groups/{uuid}/principals/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[: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 = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(group_principal_in) 

  # return_type
  return_type = opts[:return_type] || 'GroupWithPrincipalsAndRoles' 

  # auth_names
  auth_names = opts[:auth_names] || ['basic_auth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupApi#add_principal_to_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_role_to_group(uuid, group_role_in, opts = {}) ⇒ InlineResponse200

Add a role to a group in the tenant

Parameters:

  • uuid (String)

    ID of group to update

  • group_role_in (GroupRoleIn)

    Role to add to a group

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

    the optional parameters

Returns:



95
96
97
98
# File 'lib/rbac-api-client/api/group_api.rb', line 95

def add_role_to_group(uuid, group_role_in, opts = {})
  data, _status_code, _headers = add_role_to_group_with_http_info(uuid, group_role_in, opts)
  data
end

#add_role_to_group_with_http_info(uuid, group_role_in, opts = {}) ⇒ Array<(InlineResponse200, Integer, Hash)>

Add a role to a group in the tenant

Parameters:

  • uuid (String)

    ID of group to update

  • group_role_in (GroupRoleIn)

    Role to add to a group

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

    the optional parameters

Returns:

  • (Array<(InlineResponse200, Integer, Hash)>)

    InlineResponse200 data, response status code and response headers



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
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/rbac-api-client/api/group_api.rb', line 105

def add_role_to_group_with_http_info(uuid, group_role_in, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GroupApi.add_role_to_group ...'
  end
  # verify the required parameter 'uuid' is set
  if @api_client.config.client_side_validation && uuid.nil?
    fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.add_role_to_group"
  end
  # verify the required parameter 'group_role_in' is set
  if @api_client.config.client_side_validation && group_role_in.nil?
    fail ArgumentError, "Missing the required parameter 'group_role_in' when calling GroupApi.add_role_to_group"
  end
  # resource path
  local_var_path = '/groups/{uuid}/roles/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[: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 = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(group_role_in) 

  # return_type
  return_type = opts[:return_type] || 'InlineResponse200' 

  # auth_names
  auth_names = opts[:auth_names] || ['basic_auth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupApi#add_role_to_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_group(group, opts = {}) ⇒ GroupOut

Create a group in a tenant

Parameters:

  • group (Group)

    Group to create in tenant

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

    the optional parameters

Returns:



162
163
164
165
# File 'lib/rbac-api-client/api/group_api.rb', line 162

def create_group(group, opts = {})
  data, _status_code, _headers = create_group_with_http_info(group, opts)
  data
end

#create_group_with_http_info(group, opts = {}) ⇒ Array<(GroupOut, Integer, Hash)>

Create a group in a tenant

Parameters:

  • group (Group)

    Group to create in tenant

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

    the optional parameters

Returns:

  • (Array<(GroupOut, Integer, Hash)>)

    GroupOut data, response status code and response headers



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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/rbac-api-client/api/group_api.rb', line 171

def create_group_with_http_info(group, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GroupApi.create_group ...'
  end
  # verify the required parameter 'group' is set
  if @api_client.config.client_side_validation && group.nil?
    fail ArgumentError, "Missing the required parameter 'group' when calling GroupApi.create_group"
  end
  # resource path
  local_var_path = '/groups/'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[: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 = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(group) 

  # return_type
  return_type = opts[:return_type] || 'GroupOut' 

  # auth_names
  auth_names = opts[:auth_names] || ['basic_auth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupApi#create_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_group(uuid, opts = {}) ⇒ nil

Delete a group in the tenant

Parameters:

  • uuid (String)

    ID of group to delete

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

    the optional parameters

Returns:

  • (nil)


224
225
226
227
# File 'lib/rbac-api-client/api/group_api.rb', line 224

def delete_group(uuid, opts = {})
  delete_group_with_http_info(uuid, opts)
  nil
end

#delete_group_with_http_info(uuid, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a group in the tenant

Parameters:

  • uuid (String)

    ID of group to delete

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
266
267
268
269
270
271
272
273
274
275
276
277
278
# File 'lib/rbac-api-client/api/group_api.rb', line 233

def delete_group_with_http_info(uuid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GroupApi.delete_group ...'
  end
  # verify the required parameter 'uuid' is set
  if @api_client.config.client_side_validation && uuid.nil?
    fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.delete_group"
  end
  # resource path
  local_var_path = '/groups/{uuid}/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['basic_auth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupApi#delete_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_principal_from_group(uuid, usernames, opts = {}) ⇒ nil

Remove a principal from a group in the tenant

Parameters:

  • uuid (String)

    ID of group to update

  • usernames (String)

    A comma separated list of usernames for principals to remove from the group

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

    the optional parameters

Returns:

  • (nil)


285
286
287
288
# File 'lib/rbac-api-client/api/group_api.rb', line 285

def delete_principal_from_group(uuid, usernames, opts = {})
  delete_principal_from_group_with_http_info(uuid, usernames, opts)
  nil
end

#delete_principal_from_group_with_http_info(uuid, usernames, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Remove a principal from a group in the tenant

Parameters:

  • uuid (String)

    ID of group to update

  • usernames (String)

    A comma separated list of usernames for principals to remove from the group

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# File 'lib/rbac-api-client/api/group_api.rb', line 295

def delete_principal_from_group_with_http_info(uuid, usernames, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GroupApi.delete_principal_from_group ...'
  end
  # verify the required parameter 'uuid' is set
  if @api_client.config.client_side_validation && uuid.nil?
    fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.delete_principal_from_group"
  end
  # verify the required parameter 'usernames' is set
  if @api_client.config.client_side_validation && usernames.nil?
    fail ArgumentError, "Missing the required parameter 'usernames' when calling GroupApi.delete_principal_from_group"
  end
  # resource path
  local_var_path = '/groups/{uuid}/principals/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'usernames'] = usernames

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['basic_auth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupApi#delete_principal_from_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_role_from_group(uuid, roles, opts = {}) ⇒ nil

Remove a role from a group in the tenant

Parameters:

  • uuid (String)

    ID of group to update

  • roles (String)

    A comma separated list of role UUIDs for roles to remove from the group

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

    the optional parameters

Returns:

  • (nil)


352
353
354
355
# File 'lib/rbac-api-client/api/group_api.rb', line 352

def delete_role_from_group(uuid, roles, opts = {})
  delete_role_from_group_with_http_info(uuid, roles, opts)
  nil
end

#delete_role_from_group_with_http_info(uuid, roles, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Remove a role from a group in the tenant

Parameters:

  • uuid (String)

    ID of group to update

  • roles (String)

    A comma separated list of role UUIDs for roles to remove from the group

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
399
400
401
402
403
404
405
406
407
408
409
410
411
412
# File 'lib/rbac-api-client/api/group_api.rb', line 362

def delete_role_from_group_with_http_info(uuid, roles, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GroupApi.delete_role_from_group ...'
  end
  # verify the required parameter 'uuid' is set
  if @api_client.config.client_side_validation && uuid.nil?
    fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.delete_role_from_group"
  end
  # verify the required parameter 'roles' is set
  if @api_client.config.client_side_validation && roles.nil?
    fail ArgumentError, "Missing the required parameter 'roles' when calling GroupApi.delete_role_from_group"
  end
  # resource path
  local_var_path = '/groups/{uuid}/roles/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'roles'] = roles

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['basic_auth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupApi#delete_role_from_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_group(uuid, opts = {}) ⇒ GroupWithPrincipalsAndRoles

Get a group in the tenant

Parameters:

  • uuid (String)

    ID of group to get

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

    the optional parameters

Returns:



418
419
420
421
# File 'lib/rbac-api-client/api/group_api.rb', line 418

def get_group(uuid, opts = {})
  data, _status_code, _headers = get_group_with_http_info(uuid, opts)
  data
end

#get_group_with_http_info(uuid, opts = {}) ⇒ Array<(GroupWithPrincipalsAndRoles, Integer, Hash)>

Get a group in the tenant

Parameters:

  • uuid (String)

    ID of group to get

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

    the optional parameters

Returns:

  • (Array<(GroupWithPrincipalsAndRoles, Integer, Hash)>)

    GroupWithPrincipalsAndRoles data, response status code and response headers



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
466
467
468
469
470
471
472
# File 'lib/rbac-api-client/api/group_api.rb', line 427

def get_group_with_http_info(uuid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GroupApi.get_group ...'
  end
  # verify the required parameter 'uuid' is set
  if @api_client.config.client_side_validation && uuid.nil?
    fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.get_group"
  end
  # resource path
  local_var_path = '/groups/{uuid}/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'GroupWithPrincipalsAndRoles' 

  # auth_names
  auth_names = opts[:auth_names] || ['basic_auth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupApi#get_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_principals_from_group(uuid, opts = {}) ⇒ PrincipalPagination

Get a list of principals from a group in the tenant

Parameters:

  • uuid (String)

    ID of group from which to get principals

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

    the optional parameters

Options Hash (opts):

  • :principal_username (String)

    Parameter for filtering group principals by principal &#x60;username&#x60; using string contains search.

Returns:



479
480
481
482
# File 'lib/rbac-api-client/api/group_api.rb', line 479

def get_principals_from_group(uuid, opts = {})
  data, _status_code, _headers = get_principals_from_group_with_http_info(uuid, opts)
  data
end

#get_principals_from_group_with_http_info(uuid, opts = {}) ⇒ Array<(PrincipalPagination, Integer, Hash)>

Get a list of principals from a group in the tenant

Parameters:

  • uuid (String)

    ID of group from which to get principals

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

    the optional parameters

Options Hash (opts):

  • :principal_username (String)

    Parameter for filtering group principals by principal &#x60;username&#x60; using string contains search.

Returns:

  • (Array<(PrincipalPagination, Integer, Hash)>)

    PrincipalPagination data, response status code and response headers



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
# File 'lib/rbac-api-client/api/group_api.rb', line 489

def get_principals_from_group_with_http_info(uuid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GroupApi.get_principals_from_group ...'
  end
  # verify the required parameter 'uuid' is set
  if @api_client.config.client_side_validation && uuid.nil?
    fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.get_principals_from_group"
  end
  # resource path
  local_var_path = '/groups/{uuid}/principals/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'principal_username'] = opts[:'principal_username'] if !opts[:'principal_username'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'PrincipalPagination' 

  # auth_names
  auth_names = opts[:auth_names] || ['basic_auth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupApi#get_principals_from_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_groups(opts = {}) ⇒ GroupPagination

List the groups for a tenant

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Parameter for selecting the amount of data returned. (default to 10)

  • :offset (Integer)

    Parameter for selecting the offset of data. (default to 0)

  • :name (String)

    Parameter for filtering resource by name using string contains search.

  • :scope (String)

    Parameter for filtering resource by scope. (default to ‘account’)

  • :username (String)

    A username for a principal to filter for groups

  • :uuid (Array<String>)

    A list of UUIDs to filter listed groups.

  • :role_names (Array<String>)

    List of role name to filter for groups. It is exact match but case-insensitive

  • :role_discriminator (String)

    Discriminator that works with role_names to indicate matching all/any of the role names

  • :order_by (String)

    Parameter for ordering resource by value. For inverse ordering, supply &#39;-&#39; before the param value, such as: ?order_by&#x3D;-name

Returns:



549
550
551
552
# File 'lib/rbac-api-client/api/group_api.rb', line 549

def list_groups(opts = {})
  data, _status_code, _headers = list_groups_with_http_info(opts)
  data
end

#list_groups_with_http_info(opts = {}) ⇒ Array<(GroupPagination, Integer, Hash)>

List the groups for a tenant

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Parameter for selecting the amount of data returned.

  • :offset (Integer)

    Parameter for selecting the offset of data.

  • :name (String)

    Parameter for filtering resource by name using string contains search.

  • :scope (String)

    Parameter for filtering resource by scope.

  • :username (String)

    A username for a principal to filter for groups

  • :uuid (Array<String>)

    A list of UUIDs to filter listed groups.

  • :role_names (Array<String>)

    List of role name to filter for groups. It is exact match but case-insensitive

  • :role_discriminator (String)

    Discriminator that works with role_names to indicate matching all/any of the role names

  • :order_by (String)

    Parameter for ordering resource by value. For inverse ordering, supply &#39;-&#39; before the param value, such as: ?order_by&#x3D;-name

Returns:

  • (Array<(GroupPagination, Integer, Hash)>)

    GroupPagination data, response status code and response headers



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
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
# File 'lib/rbac-api-client/api/group_api.rb', line 566

def list_groups_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GroupApi.list_groups ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling GroupApi.list_groups, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling GroupApi.list_groups, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling GroupApi.list_groups, must be greater than or equal to 0.'
  end

  allowable_values = ["account", "principal"]
  if @api_client.config.client_side_validation && opts[:'scope'] && !allowable_values.include?(opts[:'scope'])
    fail ArgumentError, "invalid value for \"scope\", must be one of #{allowable_values}"
  end
  allowable_values = ["all", "any"]
  if @api_client.config.client_side_validation && opts[:'role_discriminator'] && !allowable_values.include?(opts[:'role_discriminator'])
    fail ArgumentError, "invalid value for \"role_discriminator\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/groups/'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
  query_params[:'scope'] = opts[:'scope'] if !opts[:'scope'].nil?
  query_params[:'username'] = opts[:'username'] if !opts[:'username'].nil?
  query_params[:'uuid'] = @api_client.build_collection_param(opts[:'uuid'], :csv) if !opts[:'uuid'].nil?
  query_params[:'role_names'] = @api_client.build_collection_param(opts[:'role_names'], :csv) if !opts[:'role_names'].nil?
  query_params[:'role_discriminator'] = opts[:'role_discriminator'] if !opts[:'role_discriminator'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'GroupPagination' 

  # auth_names
  auth_names = opts[:auth_names] || ['basic_auth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupApi#list_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_roles_for_group(uuid, opts = {}) ⇒ GroupRolesPagination

List the roles for a group in the tenant

Parameters:

  • uuid (String)

    ID of group

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

    the optional parameters

Options Hash (opts):

  • :exclude (Boolean)

    If this is set to true, the result would be roles excluding the ones in the group (default to false)

  • :role_name (String)

    Parameter for filtering group roles by role &#x60;name&#x60; using string contains search.

  • :role_description (String)

    Parameter for filtering group roles by role &#x60;description&#x60; using string contains search.

  • :limit (Integer)

    Parameter for selecting the amount of data returned. (default to 10)

  • :offset (Integer)

    Parameter for selecting the offset of data. (default to 0)

  • :order_by (String)

    Parameter for ordering resource by value. For inverse ordering, supply &#39;-&#39; before the param value, such as: ?order_by&#x3D;-name

Returns:



648
649
650
651
# File 'lib/rbac-api-client/api/group_api.rb', line 648

def list_roles_for_group(uuid, opts = {})
  data, _status_code, _headers = list_roles_for_group_with_http_info(uuid, opts)
  data
end

#list_roles_for_group_with_http_info(uuid, opts = {}) ⇒ Array<(GroupRolesPagination, Integer, Hash)>

List the roles for a group in the tenant

Parameters:

  • uuid (String)

    ID of group

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

    the optional parameters

Options Hash (opts):

  • :exclude (Boolean)

    If this is set to true, the result would be roles excluding the ones in the group

  • :role_name (String)

    Parameter for filtering group roles by role &#x60;name&#x60; using string contains search.

  • :role_description (String)

    Parameter for filtering group roles by role &#x60;description&#x60; using string contains search.

  • :limit (Integer)

    Parameter for selecting the amount of data returned.

  • :offset (Integer)

    Parameter for selecting the offset of data.

  • :order_by (String)

    Parameter for ordering resource by value. For inverse ordering, supply &#39;-&#39; before the param value, such as: ?order_by&#x3D;-name

Returns:

  • (Array<(GroupRolesPagination, Integer, Hash)>)

    GroupRolesPagination data, response status code and response headers



663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
# File 'lib/rbac-api-client/api/group_api.rb', line 663

def list_roles_for_group_with_http_info(uuid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GroupApi.list_roles_for_group ...'
  end
  # verify the required parameter 'uuid' is set
  if @api_client.config.client_side_validation && uuid.nil?
    fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.list_roles_for_group"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling GroupApi.list_roles_for_group, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling GroupApi.list_roles_for_group, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling GroupApi.list_roles_for_group, must be greater than or equal to 0.'
  end

  allowable_values = ["name", "modified", "policyCount"]
  if @api_client.config.client_side_validation && opts[:'order_by'] && !allowable_values.include?(opts[:'order_by'])
    fail ArgumentError, "invalid value for \"order_by\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/groups/{uuid}/roles/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'exclude'] = opts[:'exclude'] if !opts[:'exclude'].nil?
  query_params[:'role_name'] = opts[:'role_name'] if !opts[:'role_name'].nil?
  query_params[:'role_description'] = opts[:'role_description'] if !opts[:'role_description'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'GroupRolesPagination' 

  # auth_names
  auth_names = opts[:auth_names] || ['basic_auth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupApi#list_roles_for_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_group(uuid, group, opts = {}) ⇒ GroupOut

Udate a group in the tenant

Parameters:

  • uuid (String)

    ID of group to update

  • group (Group)

    Group to update in tenant

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

    the optional parameters

Returns:



737
738
739
740
# File 'lib/rbac-api-client/api/group_api.rb', line 737

def update_group(uuid, group, opts = {})
  data, _status_code, _headers = update_group_with_http_info(uuid, group, opts)
  data
end

#update_group_with_http_info(uuid, group, opts = {}) ⇒ Array<(GroupOut, Integer, Hash)>

Udate a group in the tenant

Parameters:

  • uuid (String)

    ID of group to update

  • group (Group)

    Group to update in tenant

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

    the optional parameters

Returns:

  • (Array<(GroupOut, Integer, Hash)>)

    GroupOut data, response status code and response headers



747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
# File 'lib/rbac-api-client/api/group_api.rb', line 747

def update_group_with_http_info(uuid, group, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GroupApi.update_group ...'
  end
  # verify the required parameter 'uuid' is set
  if @api_client.config.client_side_validation && uuid.nil?
    fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.update_group"
  end
  # verify the required parameter 'group' is set
  if @api_client.config.client_side_validation && group.nil?
    fail ArgumentError, "Missing the required parameter 'group' when calling GroupApi.update_group"
  end
  # resource path
  local_var_path = '/groups/{uuid}/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[: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 = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(group) 

  # return_type
  return_type = opts[:return_type] || 'GroupOut' 

  # auth_names
  auth_names = opts[:auth_names] || ['basic_auth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupApi#update_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end