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.



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

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



45
46
47
# File 'lib/docusign_rooms/api/roles_api.rb', line 45

def api_client
  @api_client
end

Instance Method Details

#create_role(account_id, body) ⇒ Role

Creates a role.

Parameters:

  • account_id
  • body (optional parameter)

Returns:



56
57
58
59
# File 'lib/docusign_rooms/api/roles_api.rb', line 56

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.

Parameters:

  • account_id
  • body (optional parameter)

Returns:

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

    Role data, response status code and response headers



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

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'])
  # 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 = @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.

Parameters:

  • role_id
  • account_id

Returns:

  • (nil)


109
110
111
112
# File 'lib/docusign_rooms/api/roles_api.rb', line 109

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.

Parameters:

  • role_id
  • account_id

Returns:

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

    nil, response status code and response headers



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

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'])

  # 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.

Parameters:

  • role_id
  • account_id
  • DocuSign_Rooms::GetRoleOptions

    Options for modifying the behavior of the function.

Returns:



162
163
164
165
# File 'lib/docusign_rooms/api/roles_api.rb', line 162

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.

Parameters:

  • role_id
  • account_id
  • DocuSign_Rooms::GetRoleOptions

    Options for modifying the behavior of the function.

Returns:

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

    Role data, response status code and response headers



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

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'])

  # 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

Parameters:

  • account_id
  • DocuSign_Rooms::GetRolesOptions

    Options for modifying the behavior of the function.

Returns:



217
218
219
220
# File 'lib/docusign_rooms/api/roles_api.rb', line 217

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

Parameters:

  • account_id
  • DocuSign_Rooms::GetRolesOptions

    Options for modifying the behavior of the function.

Returns:

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

    RoleSummaryList data, response status code and response headers



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
257
258
259
260
261
262
263
264
265
# File 'lib/docusign_rooms/api/roles_api.rb', line 227

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[:'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'])

  # 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.

Parameters:

  • role_id
  • account_id
  • body (optional parameter)

Returns:



273
274
275
276
# File 'lib/docusign_rooms/api/roles_api.rb', line 273

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.

Parameters:

  • role_id
  • account_id
  • body (optional parameter)

Returns:

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

    Role data, response status code and response headers



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
315
316
317
318
319
320
321
322
# File 'lib/docusign_rooms/api/roles_api.rb', line 284

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'])
  # 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 = @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