Class: DocuSign_Rooms::RolesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/docusign_rooms/api/roles_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = RolesApi.default) ⇒ RolesApi

Returns a new instance of RolesApi.



50
51
52
# File 'lib/docusign_rooms/api/roles_api.rb', line 50

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



48
49
50
# File 'lib/docusign_rooms/api/roles_api.rb', line 48

def api_client
  @api_client
end

Instance Method Details

#create_role(account_id, body) ⇒ Role

Creates a role. Creates a new company role in Rooms

Parameters:

  • account_id (Required)

    The globally unique identifier (GUID) for the account.

  • body

    Name and permission details of the role to be created (optional parameter)

Returns:



59
60
61
62
# File 'lib/docusign_rooms/api/roles_api.rb', line 59

def create_role(, body)
  data, _status_code, _headers = create_role_with_http_info(,  body)
  return data
end

#create_role_with_http_info(account_id, body) ⇒ Array<(Role, Fixnum, Hash)>

Creates a role. Creates a new company role in Rooms

Parameters:

  • account_id (Required)

    The globally unique identifier (GUID) for the account.

  • body

    Name and permission details of the role to be created (optional parameter)

Returns:

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

    Role data, response status code and response headers



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/docusign_rooms/api/roles_api.rb', line 69

def create_role_with_http_info(, body)
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: RolesApi.create_role ..."
  end
  # verify the required parameter 'account_id' is set
  fail ArgumentError, "Missing the required parameter 'account_id' when calling RolesApi.create_role" if .nil?
  # resource path
  local_var_path = "/v2/accounts/{accountId}/roles".sub('{format}','json').sub('{' + 'accountId' + '}', .to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json', 'application/xml', 'text/xml', 'application/*+xml'])

  # form parameters
  form_params = {}

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

#delete_role(role_id, account_id) ⇒ nil

Deletes the role with the given roleId. Deletes a role from a company account in Rooms

Parameters:

  • role_id

    The id of the role.

  • account_id (Required)

    The globally unique identifier (GUID) for the account.

Returns:

  • (nil)


112
113
114
115
# File 'lib/docusign_rooms/api/roles_api.rb', line 112

def delete_role(role_id, )
  delete_role_with_http_info(role_id, )
  return nil
end

#delete_role_with_http_info(role_id, account_id) ⇒ Array<(nil, Fixnum, Hash)>

Deletes the role with the given roleId. Deletes a role from a company account in Rooms

Parameters:

  • role_id

    The id of the role.

  • account_id (Required)

    The globally unique identifier (GUID) for the account.

Returns:

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

    nil, response status code and response headers



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
157
158
159
# File 'lib/docusign_rooms/api/roles_api.rb', line 122

def delete_role_with_http_info(role_id, )
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: RolesApi.delete_role ..."
  end
  # verify the required parameter 'role_id' is set
  fail ArgumentError, "Missing the required parameter 'role_id' when calling RolesApi.delete_role" if role_id.nil?
  # verify the required parameter 'account_id' is set
  fail ArgumentError, "Missing the required parameter 'account_id' when calling RolesApi.delete_role" if .nil?
  # resource path
  local_var_path = "/v2/accounts/{accountId}/roles/{roleId}".sub('{format}','json').sub('{' + 'roleId' + '}', role_id.to_s).sub('{' + 'accountId' + '}', .to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RolesApi#delete_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_role(role_id, account_id, options = DocuSign_Rooms::GetRoleOptions.default) ⇒ Role

Get information about the role with the given roleId. Get information about the role with the given roleId.

Parameters:

  • role_id

    The id of the role.

  • account_id (Required)

    The globally unique identifier (GUID) for the account.

  • DocuSign_Rooms::GetRoleOptions

    Options for modifying the behavior of the function.

Returns:



167
168
169
170
# File 'lib/docusign_rooms/api/roles_api.rb', line 167

def get_role(role_id, , options = DocuSign_Rooms::GetRoleOptions.default)
  data, _status_code, _headers = get_role_with_http_info(role_id, , options)
  return data
end

#get_role_with_http_info(role_id, account_id, options = DocuSign_Rooms::GetRoleOptions.default) ⇒ Array<(Role, Fixnum, Hash)>

Get information about the role with the given roleId. Get information about the role with the given roleId.

Parameters:

  • role_id

    The id of the role.

  • account_id (Required)

    The globally unique identifier (GUID) for the account.

  • DocuSign_Rooms::GetRoleOptions

    Options for modifying the behavior of the function.

Returns:

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

    Role data, response status code and response headers



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
# File 'lib/docusign_rooms/api/roles_api.rb', line 178

def get_role_with_http_info(role_id, , options = DocuSign_Rooms::GetRoleOptions.default)
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: RolesApi.get_role ..."
  end
  # verify the required parameter 'role_id' is set
  fail ArgumentError, "Missing the required parameter 'role_id' when calling RolesApi.get_role" if role_id.nil?
  # verify the required parameter 'account_id' is set
  fail ArgumentError, "Missing the required parameter 'account_id' when calling RolesApi.get_role" if .nil?
  # resource path
  local_var_path = "/v2/accounts/{accountId}/roles/{roleId}".sub('{format}','json').sub('{' + 'roleId' + '}', role_id.to_s).sub('{' + 'accountId' + '}', .to_s)

  # query parameters
  query_params = {}
  query_params[:'includeIsAssigned'] = options.include_is_assigned if !options.include_is_assigned.nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json'])

  # form parameters
  form_params = {}

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

#get_roles(account_id, options = DocuSign_Rooms::GetRolesOptions.default) ⇒ RoleSummaryList

Gets a paged-list of roles in your company Returns a list of roles associated with a company account

Parameters:

  • account_id (Required)

    The globally unique identifier (GUID) for the account.

  • DocuSign_Rooms::GetRolesOptions

    Options for modifying the behavior of the function.

Returns:



224
225
226
227
# File 'lib/docusign_rooms/api/roles_api.rb', line 224

def get_roles(, options = DocuSign_Rooms::GetRolesOptions.default)
  data, _status_code, _headers = get_roles_with_http_info(, options)
  return data
end

#get_roles_with_http_info(account_id, options = DocuSign_Rooms::GetRolesOptions.default) ⇒ Array<(RoleSummaryList, Fixnum, Hash)>

Gets a paged-list of roles in your company Returns a list of roles associated with a company account

Parameters:

  • account_id (Required)

    The globally unique identifier (GUID) for the account.

  • DocuSign_Rooms::GetRolesOptions

    Options for modifying the behavior of the function.

Returns:

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

    RoleSummaryList data, response status code and response headers



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
# File 'lib/docusign_rooms/api/roles_api.rb', line 234

def get_roles_with_http_info(, options = DocuSign_Rooms::GetRolesOptions.default)
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: RolesApi.get_roles ..."
  end
  # verify the required parameter 'account_id' is set
  fail ArgumentError, "Missing the required parameter 'account_id' when calling RolesApi.get_roles" if .nil?
  # resource path
  local_var_path = "/v2/accounts/{accountId}/roles".sub('{format}','json').sub('{' + 'accountId' + '}', .to_s)

  # query parameters
  query_params = {}
  query_params[:'onlyAssignable'] = options.only_assignable if !options.only_assignable.nil?
  query_params[:'filterContext'] = options.filter_context if !options.filter_context.nil?
  query_params[:'filter'] = options.filter if !options.filter.nil?
  query_params[:'startPosition'] = options.start_position if !options.start_position.nil?
  query_params[:'count'] = options.count if !options.count.nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json'])

  # form parameters
  form_params = {}

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

#update_role(role_id, account_id, body) ⇒ Role

Updates the role with the given roleId. Updates the role with the given roleId.

Parameters:

  • role_id

    The id of the role.

  • account_id (Required)

    The globally unique identifier (GUID) for the account.

  • body

    Name and permission details of the role to be updated (optional parameter)

Returns:



283
284
285
286
# File 'lib/docusign_rooms/api/roles_api.rb', line 283

def update_role(role_id, , body)
  data, _status_code, _headers = update_role_with_http_info(role_id, ,  body)
  return data
end

#update_role_with_http_info(role_id, account_id, body) ⇒ Array<(Role, Fixnum, Hash)>

Updates the role with the given roleId. Updates the role with the given roleId.

Parameters:

  • role_id

    The id of the role.

  • account_id (Required)

    The globally unique identifier (GUID) for the account.

  • body

    Name and permission details of the role to be updated (optional parameter)

Returns:

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

    Role data, response status code and response headers



294
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
# File 'lib/docusign_rooms/api/roles_api.rb', line 294

def update_role_with_http_info(role_id, , body)
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: RolesApi.update_role ..."
  end
  # verify the required parameter 'role_id' is set
  fail ArgumentError, "Missing the required parameter 'role_id' when calling RolesApi.update_role" if role_id.nil?
  # verify the required parameter 'account_id' is set
  fail ArgumentError, "Missing the required parameter 'account_id' when calling RolesApi.update_role" if .nil?
  # resource path
  local_var_path = "/v2/accounts/{accountId}/roles/{roleId}".sub('{format}','json').sub('{' + 'roleId' + '}', role_id.to_s).sub('{' + 'accountId' + '}', .to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json', 'application/xml', 'text/xml', 'application/*+xml'])

  # form parameters
  form_params = {}

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