Class: GongAPI::PermissionsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/gong_api/api/permissions_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PermissionsApi



16
17
18
# File 'lib/gong_api/api/permissions_api.rb', line 16

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



14
15
16
# File 'lib/gong_api/api/permissions_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#add_users_access_to_calls_using_put(body, opts = {}) ⇒ BaseResponse

Give individual users access to calls (/v2/calls/users-access) Give individual users access to calls. If a user already has access (perhaps the call was shared with them, or they have access through their permission profiles) the request will have no effect. When accessed through a Bearer token authorization method, this endpoint requires the scope ‘api:call-user-access:write’.



24
25
26
27
# File 'lib/gong_api/api/permissions_api.rb', line 24

def add_users_access_to_calls_using_put(body, opts = {})
  data, _status_code, _headers = add_users_access_to_calls_using_put_with_http_info(body, opts)
  data
end

#add_users_access_to_calls_using_put_with_http_info(body, opts = {}) ⇒ Array<(BaseResponse, Integer, Hash)>

Give individual users access to calls (/v2/calls/users-access) Give individual users access to calls. If a user already has access (perhaps the call was shared with them, or they have access through their permission profiles) the request will have no effect. When accessed through a Bearer token authorization method, this endpoint requires the scope &#x27;api:call-user-access:write&#x27;.



34
35
36
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
# File 'lib/gong_api/api/permissions_api.rb', line 34

def add_users_access_to_calls_using_put_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PermissionsApi.add_users_access_to_calls_using_put ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling PermissionsApi.add_users_access_to_calls_using_put"
  end
  # resource path
  local_var_path = '/v2/calls/users-access'

  # 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(body) 

  return_type = opts[:return_type] || 'BaseResponse' 

  auth_names = opts[:auth_names] || []
  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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PermissionsApi#add_users_access_to_calls_using_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_permission_profile_using_post(body, workspace_id, opts = {}) ⇒ PermissionProfileResponse

Create permission profile (/v2/permission-profile) Create a permission profile in a given workspace.



83
84
85
86
# File 'lib/gong_api/api/permissions_api.rb', line 83

def create_permission_profile_using_post(body, workspace_id, opts = {})
  data, _status_code, _headers = create_permission_profile_using_post_with_http_info(body, workspace_id, opts)
  data
end

#create_permission_profile_using_post_with_http_info(body, workspace_id, opts = {}) ⇒ Array<(PermissionProfileResponse, Integer, Hash)>

Create permission profile (/v2/permission-profile) Create a permission profile in a given workspace.



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/gong_api/api/permissions_api.rb', line 94

def create_permission_profile_using_post_with_http_info(body, workspace_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PermissionsApi.create_permission_profile_using_post ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling PermissionsApi.create_permission_profile_using_post"
  end
  # verify the required parameter 'workspace_id' is set
  if @api_client.config.client_side_validation && workspace_id.nil?
    fail ArgumentError, "Missing the required parameter 'workspace_id' when calling PermissionsApi.create_permission_profile_using_post"
  end
  # resource path
  local_var_path = '/v2/permission-profile'

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

  # 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(body) 

  return_type = opts[:return_type] || 'PermissionProfileResponse' 

  auth_names = opts[:auth_names] || []
  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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PermissionsApi#create_permission_profile_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_users_access_to_calls_using_delete(body, opts = {}) ⇒ BaseResponse

Remove specific individual users access from calls (/v2/calls/users-access) Remove individual user access from calls. The request can only remove access previously given by the /v2/calls/users-access API. If a given user does not have access to the call, they will be unaffected. If a given user does have access to the call, but not through the pubic API (for example if the call was shared with the user), the user’s access will remain unchanged. When accessed through a Bearer token authorization method, this endpoint requires the scope ‘api:call-user-access:write’.



147
148
149
150
# File 'lib/gong_api/api/permissions_api.rb', line 147

def delete_users_access_to_calls_using_delete(body, opts = {})
  data, _status_code, _headers = delete_users_access_to_calls_using_delete_with_http_info(body, opts)
  data
end

#delete_users_access_to_calls_using_delete_with_http_info(body, opts = {}) ⇒ Array<(BaseResponse, Integer, Hash)>

Remove specific individual users access from calls (/v2/calls/users-access) Remove individual user access from calls. The request can only remove access previously given by the /v2/calls/users-access API. If a given user does not have access to the call, they will be unaffected. If a given user does have access to the call, but not through the pubic API (for example if the call was shared with the user), the user&#x27;s access will remain unchanged. When accessed through a Bearer token authorization method, this endpoint requires the scope &#x27;api:call-user-access:write&#x27;.



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
198
199
# File 'lib/gong_api/api/permissions_api.rb', line 157

def delete_users_access_to_calls_using_delete_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PermissionsApi.delete_users_access_to_calls_using_delete ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling PermissionsApi.delete_users_access_to_calls_using_delete"
  end
  # resource path
  local_var_path = '/v2/calls/users-access'

  # 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(['*/*'])

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

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

  return_type = opts[:return_type] || 'BaseResponse' 

  auth_names = opts[:auth_names] || []
  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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PermissionsApi#delete_users_access_to_calls_using_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_permission_profile_using_get(profile_id, opts = {}) ⇒ PermissionProfileResponse

Permission profile for a given profile Id (/v2/permission-profile) Returns a permission profile.



205
206
207
208
# File 'lib/gong_api/api/permissions_api.rb', line 205

def get_permission_profile_using_get(profile_id, opts = {})
  data, _status_code, _headers = get_permission_profile_using_get_with_http_info(profile_id, opts)
  data
end

#get_permission_profile_using_get_with_http_info(profile_id, opts = {}) ⇒ Array<(PermissionProfileResponse, Integer, Hash)>

Permission profile for a given profile Id (/v2/permission-profile) Returns a permission profile.



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
252
253
254
255
256
# File 'lib/gong_api/api/permissions_api.rb', line 215

def get_permission_profile_using_get_with_http_info(profile_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PermissionsApi.get_permission_profile_using_get ...'
  end
  # verify the required parameter 'profile_id' is set
  if @api_client.config.client_side_validation && profile_id.nil?
    fail ArgumentError, "Missing the required parameter 'profile_id' when calling PermissionsApi.get_permission_profile_using_get"
  end
  # resource path
  local_var_path = '/v2/permission-profile'

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

  # 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 = opts[:return_type] || 'PermissionProfileResponse' 

  auth_names = opts[:auth_names] || []
  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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PermissionsApi#get_permission_profile_using_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_users_access_to_calls_using_get(body, opts = {}) ⇒ CallsAccessDetailsResponse

Retrieve users that have specific individual access to calls (/v2/calls/users-access) Returns a list of users who have received individual access to calls through the API. This endpoint doesn’t cover user that have access for other reasons (such as sharing recipients, or access through permission profiles). When accessed through a Bearer token authorization method, this endpoint requires the scope ‘api:call-user-access:read’.



262
263
264
265
# File 'lib/gong_api/api/permissions_api.rb', line 262

def get_users_access_to_calls_using_get(body, opts = {})
  data, _status_code, _headers = get_users_access_to_calls_using_get_with_http_info(body, opts)
  data
end

#get_users_access_to_calls_using_get_with_http_info(body, opts = {}) ⇒ Array<(CallsAccessDetailsResponse, Integer, Hash)>

Retrieve users that have specific individual access to calls (/v2/calls/users-access) Returns a list of users who have received individual access to calls through the API. This endpoint doesn&#x27;t cover user that have access for other reasons (such as sharing recipients, or access through permission profiles). When accessed through a Bearer token authorization method, this endpoint requires the scope &#x27;api:call-user-access:read&#x27;.



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
313
314
# File 'lib/gong_api/api/permissions_api.rb', line 272

def get_users_access_to_calls_using_get_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PermissionsApi.get_users_access_to_calls_using_get ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling PermissionsApi.get_users_access_to_calls_using_get"
  end
  # resource path
  local_var_path = '/v2/calls/users-access'

  # 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(['*/*'])

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

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

  return_type = opts[:return_type] || 'CallsAccessDetailsResponse' 

  auth_names = opts[:auth_names] || []
  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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PermissionsApi#get_users_access_to_calls_using_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_permission_profile_users_using_get(profile_id, opts = {}) ⇒ PermissionProfileUsersResponse

List all users attached to a given permission profile (/v2/permission-profile/users) Returns a list of all users whose access is controlled by the given permission profile. When accessed through a Bearer token authorization method, this endpoint requires the scope ‘api:users:read’.



320
321
322
323
# File 'lib/gong_api/api/permissions_api.rb', line 320

def list_permission_profile_users_using_get(profile_id, opts = {})
  data, _status_code, _headers = list_permission_profile_users_using_get_with_http_info(profile_id, opts)
  data
end

#list_permission_profile_users_using_get_with_http_info(profile_id, opts = {}) ⇒ Array<(PermissionProfileUsersResponse, Integer, Hash)>

List all users attached to a given permission profile (/v2/permission-profile/users) Returns a list of all users whose access is controlled by the given permission profile. When accessed through a Bearer token authorization method, this endpoint requires the scope &#x27;api:users:read&#x27;.



330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
# File 'lib/gong_api/api/permissions_api.rb', line 330

def list_permission_profile_users_using_get_with_http_info(profile_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PermissionsApi.list_permission_profile_users_using_get ...'
  end
  # verify the required parameter 'profile_id' is set
  if @api_client.config.client_side_validation && profile_id.nil?
    fail ArgumentError, "Missing the required parameter 'profile_id' when calling PermissionsApi.list_permission_profile_users_using_get"
  end
  # resource path
  local_var_path = '/v2/permission-profile/users'

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

  # 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 = opts[:return_type] || 'PermissionProfileUsersResponse' 

  auth_names = opts[:auth_names] || []
  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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PermissionsApi#list_permission_profile_users_using_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_permission_profile_using_get(workspace_id, opts = {}) ⇒ PermissionProfilesResponse

List all company permission profiles for a given workspace (/v2/all-permission-profiles) Returns a list of all permission profiles. The listing is in the alphabetical order of the profile names.



377
378
379
380
# File 'lib/gong_api/api/permissions_api.rb', line 377

def list_permission_profile_using_get(workspace_id, opts = {})
  data, _status_code, _headers = list_permission_profile_using_get_with_http_info(workspace_id, opts)
  data
end

#list_permission_profile_using_get_with_http_info(workspace_id, opts = {}) ⇒ Array<(PermissionProfilesResponse, Integer, Hash)>

List all company permission profiles for a given workspace (/v2/all-permission-profiles) Returns a list of all permission profiles. The listing is in the alphabetical order of the profile names.



387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
# File 'lib/gong_api/api/permissions_api.rb', line 387

def list_permission_profile_using_get_with_http_info(workspace_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PermissionsApi.list_permission_profile_using_get ...'
  end
  # verify the required parameter 'workspace_id' is set
  if @api_client.config.client_side_validation && workspace_id.nil?
    fail ArgumentError, "Missing the required parameter 'workspace_id' when calling PermissionsApi.list_permission_profile_using_get"
  end
  # resource path
  local_var_path = '/v2/all-permission-profiles'

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

  # 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 = opts[:return_type] || 'PermissionProfilesResponse' 

  auth_names = opts[:auth_names] || []
  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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PermissionsApi#list_permission_profile_using_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_permission_profile_using_put(body, profile_id, opts = {}) ⇒ PermissionProfileResponse

Update permission profile (/v2/permission-profile) Update a permission profile.



435
436
437
438
# File 'lib/gong_api/api/permissions_api.rb', line 435

def update_permission_profile_using_put(body, profile_id, opts = {})
  data, _status_code, _headers = update_permission_profile_using_put_with_http_info(body, profile_id, opts)
  data
end

#update_permission_profile_using_put_with_http_info(body, profile_id, opts = {}) ⇒ Array<(PermissionProfileResponse, Integer, Hash)>

Update permission profile (/v2/permission-profile) Update a permission profile.



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
484
485
486
487
488
489
490
491
492
493
# File 'lib/gong_api/api/permissions_api.rb', line 446

def update_permission_profile_using_put_with_http_info(body, profile_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PermissionsApi.update_permission_profile_using_put ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling PermissionsApi.update_permission_profile_using_put"
  end
  # verify the required parameter 'profile_id' is set
  if @api_client.config.client_side_validation && profile_id.nil?
    fail ArgumentError, "Missing the required parameter 'profile_id' when calling PermissionsApi.update_permission_profile_using_put"
  end
  # resource path
  local_var_path = '/v2/permission-profile'

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

  # 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(body) 

  return_type = opts[:return_type] || 'PermissionProfileResponse' 

  auth_names = opts[:auth_names] || []
  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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PermissionsApi#update_permission_profile_using_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end