Class: VeriCiteClient::DefaultApi

Inherits:
Object
  • Object
show all
Defined in:
lib/vericite_client/api/default_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ DefaultApi

Returns a new instance of DefaultApi.



11
12
13
# File 'lib/vericite_client/api/default_api.rb', line 11

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



9
10
11
# File 'lib/vericite_client/api/default_api.rb', line 9

def api_client
  @api_client
end

Instance Method Details

#assignments_context_id_assignment_id_post(context_id, assignment_id, consumer, consumer_secret, assignment_data, opts = {}) ⇒ Array<ExternalContentUploadInfo>

Create/update assignment

Parameters:

  • context_id

    Context ID

  • assignment_id

    ID of assignment

  • consumer

    the consumer

  • consumer_secret

    the consumer secret

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

    the optional parameters

Options Hash (opts):

  • :encrypted (BOOLEAN)

    Flag to indicate encryption

Returns:



25
26
27
28
# File 'lib/vericite_client/api/default_api.rb', line 25

def assignments_context_id_assignment_id_post(context_id, assignment_id, consumer, consumer_secret, assignment_data, opts = {})
  data, status_code, headers = assignments_context_id_assignment_id_post_with_http_info(context_id, assignment_id, consumer, consumer_secret, assignment_data, opts)
  return data, status_code, headers
end

#assignments_context_id_assignment_id_post_with_http_info(context_id, assignment_id, consumer, consumer_secret, assignment_data, opts = {}) ⇒ Array<(Array<ExternalContentUploadInfo>, Fixnum, Hash)>

Create/update assignment

Parameters:

  • context_id

    Context ID

  • assignment_id

    ID of assignment

  • consumer

    the consumer

  • consumer_secret

    the consumer secret

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

    the optional parameters

Options Hash (opts):

  • :encrypted (BOOLEAN)

    Flag to indicate encryption

Returns:

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

    Array<ExternalContentUploadInfo> data, response status code and response headers



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
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/vericite_client/api/default_api.rb', line 40

def assignments_context_id_assignment_id_post_with_http_info(context_id, assignment_id, consumer, consumer_secret, assignment_data, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DefaultApi#assignments_context_id_assignment_id_post ..."
  end

  # verify the required parameter 'context_id' is set
  fail "Missing the required parameter 'context_id' when calling assignments_context_id_assignment_id_post" if context_id.nil?

  # verify the required parameter 'assignment_id' is set
  fail "Missing the required parameter 'assignment_id' when calling assignments_context_id_assignment_id_post" if assignment_id.nil?

  # verify the required parameter 'consumer' is set
  fail "Missing the required parameter 'consumer' when calling assignments_context_id_assignment_id_post" if consumer.nil?

  # verify the required parameter 'consumer_secret' is set
  fail "Missing the required parameter 'consumer_secret' when calling assignments_context_id_assignment_id_post" if consumer_secret.nil?

  # verify the required parameter 'assignment_data' is set
  fail "Missing the required parameter 'assignment_data' when calling assignments_context_id_assignment_id_post" if assignment_data.nil?

  # resource path
  local_var_path = "/assignments/{contextID}/{assignmentID}".sub('{format}','json').sub('{' + 'contextID' + '}', context_id.to_s).sub('{' + 'assignmentID' + '}', assignment_id.to_s)

  # query parameters
  query_params = {}
  # always set encrypted to true (eventually this will not be required)
  query_params[:'encrypted'] = true

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'consumer'] = consumer
  header_params[:'consumerSecret'] = consumer_secret

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(assignment_data)

  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 => 'Array<ExternalContentUploadInfo>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#assignments_context_id_assignment_id_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reports_scores_context_id_get(context_id, consumer, consumer_secret, opts = {}) ⇒ Array<ReportScoreReponse>

Retrieves scores for the reports

Parameters:

  • context_id

    Context ID

  • consumer

    the consumer

  • consumer_secret

    the consumer secret

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

    the optional parameters

Options Hash (opts):

  • :assignment_id (String)

    ID of assignment

  • :user_id (String)

    ID of user

  • :external_content_id (String)

    external content id

Returns:



111
112
113
114
# File 'lib/vericite_client/api/default_api.rb', line 111

def reports_scores_context_id_get(context_id, consumer, consumer_secret, opts = {})
  data, status_code, headers = reports_scores_context_id_get_with_http_info(context_id, consumer, consumer_secret, opts)
  return data, status_code, headers
end

#reports_scores_context_id_get_with_http_info(context_id, consumer, consumer_secret, opts = {}) ⇒ Array<(Array<ReportScoreReponse>, Fixnum, Hash)>

Retrieves scores for the reports

Parameters:

  • context_id

    Context ID

  • consumer

    the consumer

  • consumer_secret

    the consumer secret

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

    the optional parameters

Options Hash (opts):

  • :assignment_id (String)

    ID of assignment

  • :user_id (String)

    ID of user

  • :external_content_id (String)

    external content id

Returns:

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

    Array<ReportScoreReponse> data, response status code and response headers



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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/vericite_client/api/default_api.rb', line 126

def reports_scores_context_id_get_with_http_info(context_id, consumer, consumer_secret, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DefaultApi#reports_scores_context_id_get ..."
  end

  # verify the required parameter 'context_id' is set
  fail "Missing the required parameter 'context_id' when calling reports_scores_context_id_get" if context_id.nil?

  # verify the required parameter 'consumer' is set
  fail "Missing the required parameter 'consumer' when calling reports_scores_context_id_get" if consumer.nil?

  # verify the required parameter 'consumer_secret' is set
  fail "Missing the required parameter 'consumer_secret' when calling reports_scores_context_id_get" if consumer_secret.nil?

  # resource path
  local_var_path = "/reports/scores/{contextID}".sub('{format}','json').sub('{' + 'contextID' + '}', context_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'assignmentID'] = opts[:'assignment_id'] if opts[:'assignment_id']
  query_params[:'userID'] = opts[:'user_id'] if opts[:'user_id']
  query_params[:'externalContentID'] = opts[:'external_content_id'] if opts[:'external_content_id']

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'consumer'] = consumer
  header_params[:'consumerSecret'] = consumer_secret

  # 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 => 'Array<ReportScoreReponse>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#reports_scores_context_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reports_submit_request_context_id_assignment_id_user_id_post(context_id, assignment_id, user_id, consumer, consumer_secret, report_meta_data, opts = {}) ⇒ Array<ExternalContentUploadInfo>

Request a file submission

Parameters:

  • context_id

    Context ID

  • assignment_id

    ID of assignment

  • user_id

    ID of user

  • consumer

    the consumer

  • consumer_secret

    the consumer secret

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

    the optional parameters

Options Hash (opts):

  • :encrypted (BOOLEAN)

    Flag to indicate encryption

Returns:



193
194
195
196
# File 'lib/vericite_client/api/default_api.rb', line 193

def reports_submit_request_context_id_assignment_id_user_id_post(context_id, assignment_id, user_id, consumer, consumer_secret, , opts = {})
  data, status_code, headers = reports_submit_request_context_id_assignment_id_user_id_post_with_http_info(context_id, assignment_id, user_id, consumer, consumer_secret, , opts)
  return data, status_code, headers
end

#reports_submit_request_context_id_assignment_id_user_id_post_with_http_info(context_id, assignment_id, user_id, consumer, consumer_secret, report_meta_data, opts = {}) ⇒ Array<(Array<ExternalContentUploadInfo>, Fixnum, Hash)>

Request a file submission

Parameters:

  • context_id

    Context ID

  • assignment_id

    ID of assignment

  • user_id

    ID of user

  • consumer

    the consumer

  • consumer_secret

    the consumer secret

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

    the optional parameters

Options Hash (opts):

  • :encrypted (BOOLEAN)

    Flag to indicate encryption

Returns:

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

    Array<ExternalContentUploadInfo> data, response status code and response headers



209
210
211
212
213
214
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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
# File 'lib/vericite_client/api/default_api.rb', line 209

def reports_submit_request_context_id_assignment_id_user_id_post_with_http_info(context_id, assignment_id, user_id, consumer, consumer_secret, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DefaultApi#reports_submit_request_context_id_assignment_id_user_id_post ..."
  end

  # verify the required parameter 'context_id' is set
  fail "Missing the required parameter 'context_id' when calling reports_submit_request_context_id_assignment_id_user_id_post" if context_id.nil?

  # verify the required parameter 'assignment_id' is set
  fail "Missing the required parameter 'assignment_id' when calling reports_submit_request_context_id_assignment_id_user_id_post" if assignment_id.nil?

  # verify the required parameter 'user_id' is set
  fail "Missing the required parameter 'user_id' when calling reports_submit_request_context_id_assignment_id_user_id_post" if user_id.nil?

  # verify the required parameter 'consumer' is set
  fail "Missing the required parameter 'consumer' when calling reports_submit_request_context_id_assignment_id_user_id_post" if consumer.nil?

  # verify the required parameter 'consumer_secret' is set
  fail "Missing the required parameter 'consumer_secret' when calling reports_submit_request_context_id_assignment_id_user_id_post" if consumer_secret.nil?

  # verify the required parameter 'report_meta_data' is set
  fail "Missing the required parameter 'report_meta_data' when calling reports_submit_request_context_id_assignment_id_user_id_post" if .nil?

  # resource path
  local_var_path = "/reports/submit/request/{contextID}/{assignmentID}/{userID}".sub('{format}','json').sub('{' + 'contextID' + '}', context_id.to_s).sub('{' + 'assignmentID' + '}', assignment_id.to_s).sub('{' + 'userID' + '}', user_id.to_s)

  # query parameters
  query_params = {}
  # always set encrypted to true (eventually this will not be required)
  query_params[:'encrypted'] = true

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'consumer'] = consumer
  header_params[:'consumerSecret'] = consumer_secret

  # form parameters
  form_params = {}

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

#reports_urls_context_id_get(context_id, assignment_id_filter, consumer, consumer_secret, token_user, token_user_role, opts = {}) ⇒ Array<ReportURLLinkReponse>

Retrieves URLS for the reports

Parameters:

  • context_id

    Context ID

  • assignment_id_filter

    ID of assignment to filter results on

  • consumer

    the consumer

  • consumer_secret

    the consumer secret

  • token_user

    ID of user who will view the report

  • token_user_role

    role of user who will view the report

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

    the optional parameters

Options Hash (opts):

  • :user_id_filter (String)

    ID of user to filter results on

  • :external_content_id_filter (String)

    external content id to filter results on

Returns:



285
286
287
288
# File 'lib/vericite_client/api/default_api.rb', line 285

def reports_urls_context_id_get(context_id, assignment_id_filter, consumer, consumer_secret, token_user, token_user_role, opts = {})
  data, status_code, headers = reports_urls_context_id_get_with_http_info(context_id, assignment_id_filter, consumer, consumer_secret, token_user, token_user_role, opts)
  return data, status_code, headers
end

#reports_urls_context_id_get_with_http_info(context_id, assignment_id_filter, consumer, consumer_secret, token_user, token_user_role, opts = {}) ⇒ Array<(Array<ReportURLLinkReponse>, Fixnum, Hash)>

Retrieves URLS for the reports

Parameters:

  • context_id

    Context ID

  • assignment_id_filter

    ID of assignment to filter results on

  • consumer

    the consumer

  • consumer_secret

    the consumer secret

  • token_user

    ID of user who will view the report

  • token_user_role

    role of user who will view the report

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

    the optional parameters

Options Hash (opts):

  • :user_id_filter (String)

    ID of user to filter results on

  • :external_content_id_filter (String)

    external content id to filter results on

Returns:

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

    Array<ReportURLLinkReponse> data, response status code and response headers



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
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
# File 'lib/vericite_client/api/default_api.rb', line 302

def reports_urls_context_id_get_with_http_info(context_id, assignment_id_filter, consumer, consumer_secret, token_user, token_user_role, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DefaultApi#reports_urls_context_id_get ..."
  end

  # verify the required parameter 'context_id' is set
  fail "Missing the required parameter 'context_id' when calling reports_urls_context_id_get" if context_id.nil?

  # verify the required parameter 'assignment_id_filter' is set
  fail "Missing the required parameter 'assignment_id_filter' when calling reports_urls_context_id_get" if assignment_id_filter.nil?

  # verify the required parameter 'consumer' is set
  fail "Missing the required parameter 'consumer' when calling reports_urls_context_id_get" if consumer.nil?

  # verify the required parameter 'consumer_secret' is set
  fail "Missing the required parameter 'consumer_secret' when calling reports_urls_context_id_get" if consumer_secret.nil?

  # verify the required parameter 'token_user' is set
  fail "Missing the required parameter 'token_user' when calling reports_urls_context_id_get" if token_user.nil?

  # verify the required parameter 'token_user_role' is set
  fail "Missing the required parameter 'token_user_role' when calling reports_urls_context_id_get" if token_user_role.nil?

  # resource path
  local_var_path = "/reports/urls/{contextID}".sub('{format}','json').sub('{' + 'contextID' + '}', context_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'assignmentIDFilter'] = assignment_id_filter
  query_params[:'tokenUser'] = token_user
  query_params[:'tokenUserRole'] = token_user_role
  query_params[:'userIDFilter'] = opts[:'user_id_filter'] if opts[:'user_id_filter']
  query_params[:'externalContentIDFilter'] = opts[:'external_content_id_filter'] if opts[:'external_content_id_filter']

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'consumer'] = consumer
  header_params[:'consumerSecret'] = consumer_secret

  # 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 => 'Array<ReportURLLinkReponse>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#reports_urls_context_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end