Class: PureCloud::GroupsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/purecloud/api/groups_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ GroupsApi

Returns a new instance of GroupsApi.



23
24
25
# File 'lib/purecloud/api/groups_api.rb', line 23

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



21
22
23
# File 'lib/purecloud/api/groups_api.rb', line 21

def api_client
  @api_client
end

Instance Method Details

#delete_group_id(group_id, opts = {}) ⇒ nil

Delete group

Parameters:

  • group_id

    Group ID

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

    the optional parameters

Returns:

  • (nil)


32
33
34
35
# File 'lib/purecloud/api/groups_api.rb', line 32

def delete_group_id(group_id, opts = {})
  delete_group_id_with_http_info(group_id, opts)
  return nil
end

#delete_group_id_members(group_id, ids, opts = {}) ⇒ Empty

Remove members

Parameters:

  • group_id

    Group ID

  • ids

    Comma separated list of userIds to remove

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

    the optional parameters

Returns:



92
93
94
95
# File 'lib/purecloud/api/groups_api.rb', line 92

def delete_group_id_members(group_id, ids, opts = {})
  data, status_code, headers = delete_group_id_members_with_http_info(group_id, ids, opts)
  return data
end

#delete_group_id_members_with_http_info(group_id, ids, opts = {}) ⇒ Array<(Empty, Fixnum, Hash)>

Remove members

Parameters:

  • group_id

    Group ID

  • ids

    Comma separated list of userIds to remove

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

    the optional parameters

Returns:

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

    Empty data, response status code and response headers



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/purecloud/api/groups_api.rb', line 103

def delete_group_id_members_with_http_info(group_id, ids, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi#delete_group_id_members ..."
  end
  
  # verify the required parameter 'group_id' is set
  fail "Missing the required parameter 'group_id' when calling delete_group_id_members" if group_id.nil?
  
  # verify the required parameter 'ids' is set
  fail "Missing the required parameter 'ids' when calling delete_group_id_members" if ids.nil?
  
  # resource path
  local_var_path = "/api/v2/groups/{groupId}/members".sub('{format}','json').sub('{' + 'groupId' + '}', group_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'ids'] = ids

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

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

#delete_group_id_with_http_info(group_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete group

Parameters:

  • group_id

    Group ID

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
# File 'lib/purecloud/api/groups_api.rb', line 42

def delete_group_id_with_http_info(group_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi#delete_group_id ..."
  end
  
  # verify the required parameter 'group_id' is set
  fail "Missing the required parameter 'group_id' when calling delete_group_id" if group_id.nil?
  
  # resource path
  local_var_path = "/api/v2/groups/{groupId}".sub('{format}','json').sub('{' + 'groupId' + '}', group_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud Auth']
  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: GroupsApi#delete_group_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_fieldconfig(type, opts = {}) ⇒ FieldConfig

Fetch field config for an entity type

Parameters:

  • type

    Field type

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

    the optional parameters

Returns:



157
158
159
160
# File 'lib/purecloud/api/groups_api.rb', line 157

def get_fieldconfig(type, opts = {})
  data, status_code, headers = get_fieldconfig_with_http_info(type, opts)
  return data
end

#get_fieldconfig_with_http_info(type, opts = {}) ⇒ Array<(FieldConfig, Fixnum, Hash)>

Fetch field config for an entity type

Parameters:

  • type

    Field type

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

    the optional parameters

Returns:

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

    FieldConfig data, response status code and response headers



167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/purecloud/api/groups_api.rb', line 167

def get_fieldconfig_with_http_info(type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi#get_fieldconfig ..."
  end
  
  # verify the required parameter 'type' is set
  fail "Missing the required parameter 'type' when calling get_fieldconfig" if type.nil?
  unless ['person', 'group', 'org', 'externalContact'].include?(type)
    fail "invalid value for 'type', must be one of person, group, org, externalContact"
  end
  
  # resource path
  local_var_path = "/api/v2/fieldconfig".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'type'] = type

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud Auth']
  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 => 'FieldConfig')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupsApi#get_fieldconfig\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_group_id(group_id, opts = {}) ⇒ Group

Get group

Parameters:

  • group_id

    Group ID

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

    the optional parameters

Returns:



221
222
223
224
# File 'lib/purecloud/api/groups_api.rb', line 221

def get_group_id(group_id, opts = {})
  data, status_code, headers = get_group_id_with_http_info(group_id, opts)
  return data
end

#get_group_id_members(group_id, opts = {}) ⇒ UserEntityListing

Get group members

Parameters:

  • group_id

    Group ID

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

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    Page size (default to 25)

  • :page_number (Integer)

    Page number (default to 1)

  • :sort_order (String)

    Ascending or descending sort order (default to ASC)

  • :expand (Array<String>)

    Which fields, if any, to expand

Returns:



285
286
287
288
# File 'lib/purecloud/api/groups_api.rb', line 285

def get_group_id_members(group_id, opts = {})
  data, status_code, headers = get_group_id_members_with_http_info(group_id, opts)
  return data
end

#get_group_id_members_with_http_info(group_id, opts = {}) ⇒ Array<(UserEntityListing, Fixnum, Hash)>

Get group members

Parameters:

  • group_id

    Group ID

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

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    Page size

  • :page_number (Integer)

    Page number

  • :sort_order (String)

    Ascending or descending sort order

  • :expand (Array<String>)

    Which fields, if any, to expand

Returns:

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

    UserEntityListing data, response status code and response headers



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
346
347
348
349
350
# File 'lib/purecloud/api/groups_api.rb', line 299

def get_group_id_members_with_http_info(group_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi#get_group_id_members ..."
  end
  
  # verify the required parameter 'group_id' is set
  fail "Missing the required parameter 'group_id' when calling get_group_id_members" if group_id.nil?
  
  if opts[:'sort_order'] && !['ascending', 'descending'].include?(opts[:'sort_order'])
    fail 'invalid value for "sort_order", must be one of ascending, descending'
  end
  
  # resource path
  local_var_path = "/api/v2/groups/{groupId}/members".sub('{format}','json').sub('{' + 'groupId' + '}', group_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']
  query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']
  query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order']
  query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud Auth']
  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 => 'UserEntityListing')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupsApi#get_group_id_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_group_id_with_http_info(group_id, opts = {}) ⇒ Array<(Group, Fixnum, Hash)>

Get group

Parameters:

  • group_id

    Group ID

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

    the optional parameters

Returns:

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

    Group data, response status code and response headers



231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/purecloud/api/groups_api.rb', line 231

def get_group_id_with_http_info(group_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi#get_group_id ..."
  end
  
  # verify the required parameter 'group_id' is set
  fail "Missing the required parameter 'group_id' when calling get_group_id" if group_id.nil?
  
  # resource path
  local_var_path = "/api/v2/groups/{groupId}".sub('{format}','json').sub('{' + 'groupId' + '}', group_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud Auth']
  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 => 'Group')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupsApi#get_group_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_groups(opts = {}) ⇒ GroupEntityListing

Get a group list

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    Page size (default to 25)

  • :page_number (Integer)

    Page number (default to 1)

  • :sort_order (String)

    Ascending or descending sort order (default to ASC)

Returns:



359
360
361
362
# File 'lib/purecloud/api/groups_api.rb', line 359

def get_groups(opts = {})
  data, status_code, headers = get_groups_with_http_info(opts)
  return data
end

#get_groups_with_http_info(opts = {}) ⇒ Array<(GroupEntityListing, Fixnum, Hash)>

Get a group list

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    Page size

  • :page_number (Integer)

    Page number

  • :sort_order (String)

    Ascending or descending sort order

Returns:

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

    GroupEntityListing data, response status code and response headers



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
413
414
415
416
417
418
# File 'lib/purecloud/api/groups_api.rb', line 371

def get_groups_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi#get_groups ..."
  end
  
  if opts[:'sort_order'] && !['ascending', 'descending'].include?(opts[:'sort_order'])
    fail 'invalid value for "sort_order", must be one of ascending, descending'
  end
  
  # resource path
  local_var_path = "/api/v2/groups".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']
  query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']
  query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud Auth']
  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 => 'GroupEntityListing')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupsApi#get_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_search(q64, opts = {}) ⇒ GroupsSearchResponse

Search groups using the q64 value returned from a previous search

Parameters:

  • q64

    q64

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

    expand

Returns:



426
427
428
429
# File 'lib/purecloud/api/groups_api.rb', line 426

def get_search(q64, opts = {})
  data, status_code, headers = get_search_with_http_info(q64, opts)
  return data
end

#get_search_with_http_info(q64, opts = {}) ⇒ Array<(GroupsSearchResponse, Fixnum, Hash)>

Search groups using the q64 value returned from a previous search

Parameters:

  • q64

    q64

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

    expand

Returns:

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

    GroupsSearchResponse data, response status code and response headers



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
473
474
475
476
477
478
479
480
481
482
# File 'lib/purecloud/api/groups_api.rb', line 437

def get_search_with_http_info(q64, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi#get_search ..."
  end
  
  # verify the required parameter 'q64' is set
  fail "Missing the required parameter 'q64' when calling get_search" if q64.nil?
  
  # resource path
  local_var_path = "/api/v2/groups/search".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'q64'] = q64
  query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud Auth']
  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 => 'GroupsSearchResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupsApi#get_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_group_id_members(group_id, body, opts = {}) ⇒ Empty

Add members

Parameters:

  • group_id

    Group ID

  • body

    Add members

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

    the optional parameters

Returns:



490
491
492
493
# File 'lib/purecloud/api/groups_api.rb', line 490

def post_group_id_members(group_id, body, opts = {})
  data, status_code, headers = post_group_id_members_with_http_info(group_id, body, opts)
  return data
end

#post_group_id_members_with_http_info(group_id, body, opts = {}) ⇒ Array<(Empty, Fixnum, Hash)>

Add members

Parameters:

  • group_id

    Group ID

  • body

    Add members

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

    the optional parameters

Returns:

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

    Empty data, response status code and response headers



501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
# File 'lib/purecloud/api/groups_api.rb', line 501

def post_group_id_members_with_http_info(group_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi#post_group_id_members ..."
  end
  
  # verify the required parameter 'group_id' is set
  fail "Missing the required parameter 'group_id' when calling post_group_id_members" if group_id.nil?
  
  # verify the required parameter 'body' is set
  fail "Missing the required parameter 'body' when calling post_group_id_members" if body.nil?
  
  # resource path
  local_var_path = "/api/v2/groups/{groupId}/members".sub('{format}','json').sub('{' + 'groupId' + '}', group_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  
  auth_names = ['PureCloud Auth']
  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 => 'Empty')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupsApi#post_group_id_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_groups(body, opts = {}) ⇒ Group

Create a group

Parameters:

  • body

    Group

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

    the optional parameters

Returns:



554
555
556
557
# File 'lib/purecloud/api/groups_api.rb', line 554

def post_groups(body, opts = {})
  data, status_code, headers = post_groups_with_http_info(body, opts)
  return data
end

#post_groups_with_http_info(body, opts = {}) ⇒ Array<(Group, Fixnum, Hash)>

Create a group

Parameters:

  • body

    Group

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

    the optional parameters

Returns:

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

    Group data, response status code and response headers



564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
# File 'lib/purecloud/api/groups_api.rb', line 564

def post_groups_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi#post_groups ..."
  end
  
  # verify the required parameter 'body' is set
  fail "Missing the required parameter 'body' when calling post_groups" if body.nil?
  
  # resource path
  local_var_path = "/api/v2/groups".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  
  auth_names = ['PureCloud Auth']
  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 => 'Group')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupsApi#post_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_search(body, opts = {}) ⇒ GroupsSearchResponse

Search groups

Parameters:

  • body

    Search request options

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

    the optional parameters

Returns:



614
615
616
617
# File 'lib/purecloud/api/groups_api.rb', line 614

def post_search(body, opts = {})
  data, status_code, headers = post_search_with_http_info(body, opts)
  return data
end

#post_search_with_http_info(body, opts = {}) ⇒ Array<(GroupsSearchResponse, Fixnum, Hash)>

Search groups

Parameters:

  • body

    Search request options

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

    the optional parameters

Returns:

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

    GroupsSearchResponse data, response status code and response headers



624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
# File 'lib/purecloud/api/groups_api.rb', line 624

def post_search_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi#post_search ..."
  end
  
  # verify the required parameter 'body' is set
  fail "Missing the required parameter 'body' when calling post_search" if body.nil?
  
  # resource path
  local_var_path = "/api/v2/groups/search".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  
  auth_names = ['PureCloud Auth']
  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 => 'GroupsSearchResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupsApi#post_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_group_id(group_id, opts = {}) ⇒ Group

Update group

Parameters:

  • group_id

    Group ID

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

    the optional parameters

Options Hash (opts):

Returns:



675
676
677
678
# File 'lib/purecloud/api/groups_api.rb', line 675

def put_group_id(group_id, opts = {})
  data, status_code, headers = put_group_id_with_http_info(group_id, opts)
  return data
end

#put_group_id_with_http_info(group_id, opts = {}) ⇒ Array<(Group, Fixnum, Hash)>

Update group

Parameters:

  • group_id

    Group ID

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

    the optional parameters

Options Hash (opts):

Returns:

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

    Group data, response status code and response headers



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
# File 'lib/purecloud/api/groups_api.rb', line 686

def put_group_id_with_http_info(group_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi#put_group_id ..."
  end
  
  # verify the required parameter 'group_id' is set
  fail "Missing the required parameter 'group_id' when calling put_group_id" if group_id.nil?
  
  # resource path
  local_var_path = "/api/v2/groups/{groupId}".sub('{format}','json').sub('{' + 'groupId' + '}', group_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  
  auth_names = ['PureCloud Auth']
  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 => 'Group')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupsApi#put_group_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end