Class: FlatApi::EduResourcesApi
- Inherits:
-
Object
- Object
- FlatApi::EduResourcesApi
- Defined in:
- lib/flat_api/api/edu_resources_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#copy_edu_resource(resource, edu_resource_copy, opts = {}) ⇒ EduResource
Copy an education resource to a Resource Library.
-
#copy_edu_resource_to_demo_class(resource, opts = {}) ⇒ ClassAssignment
Copy an education assignment to a teacher demo class Once a resource library can be published to a class (‘Assignment.capabilities.canPublishInClass = true`), this endpoint can be used for the feature "View as student".
-
#copy_edu_resource_to_demo_class_with_http_info(resource, opts = {}) ⇒ Array<(ClassAssignment, Integer, Hash)>
Copy an education assignment to a teacher demo class Once a resource library can be published to a class (`Assignment.capabilities.canPublishInClass = true`), this endpoint can be used for the feature "View as student".
-
#copy_edu_resource_with_http_info(resource, edu_resource_copy, opts = {}) ⇒ Array<(EduResource, Integer, Hash)>
Copy an education resource to a Resource Library.
-
#create_edu_resource(edu_resource_creation, opts = {}) ⇒ EduResource
Create a new education resource.
-
#create_edu_resource_lti_link(resource, opts = {}) ⇒ EduResourceLtiLink
Create an LTI link for an education resource This endpoint will return an LTI link that can be used to launch Flat for Education.
-
#create_edu_resource_lti_link_with_http_info(resource, opts = {}) ⇒ Array<(EduResourceLtiLink, Integer, Hash)>
Create an LTI link for an education resource This endpoint will return an LTI link that can be used to launch Flat for Education.
-
#create_edu_resource_with_http_info(edu_resource_creation, opts = {}) ⇒ Array<(EduResource, Integer, Hash)>
Create a new education resource.
-
#delete_edu_resource(resource, opts = {}) ⇒ nil
Delete an education resource.
-
#delete_edu_resource_with_http_info(resource, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete an education resource.
-
#get_edu_resource(resource, opts = {}) ⇒ EduResource
Get an education resource.
-
#get_edu_resource_with_http_info(resource, opts = {}) ⇒ Array<(EduResource, Integer, Hash)>
Get an education resource.
-
#initialize(api_client = ApiClient.default) ⇒ EduResourcesApi
constructor
A new instance of EduResourcesApi.
-
#list_edu_libraries(opts = {}) ⇒ Array<EduLibrary>
List the education libraries.
-
#list_edu_libraries_with_http_info(opts = {}) ⇒ Array<(Array<EduLibrary>, Integer, Hash)>
List the education libraries.
-
#list_edu_resources(opts = {}) ⇒ Array<EduResource>
List education resources in a library or folder.
-
#list_edu_resources_with_http_info(opts = {}) ⇒ Array<(Array<EduResource>, Integer, Hash)>
List education resources in a library or folder.
-
#move_edu_resource(resource, edu_resource_move, opts = {}) ⇒ EduResource
Move an education resource.
-
#move_edu_resource_with_http_info(resource, edu_resource_move, opts = {}) ⇒ Array<(EduResource, Integer, Hash)>
Move an education resource.
-
#update_edu_resource(resource, edu_resource_update, opts = {}) ⇒ EduResource
Update an education resource metadata Update any resources metadata (e.g. title).
-
#update_edu_resource_assignment(resource, assignment_update, opts = {}) ⇒ Assignment
Update an education resource assignment.
-
#update_edu_resource_assignment_with_http_info(resource, assignment_update, opts = {}) ⇒ Array<(Assignment, Integer, Hash)>
Update an education resource assignment.
-
#update_edu_resource_with_http_info(resource, edu_resource_update, opts = {}) ⇒ Array<(EduResource, Integer, Hash)>
Update an education resource metadata Update any resources metadata (e.g. title).
-
#use_edu_resource_in_class(resource, edu_resource_use_in_class, opts = {}) ⇒ ClassAssignment
Use an education resource in a class This endpoint will copy a resource and the underlying resources.
-
#use_edu_resource_in_class_with_http_info(resource, edu_resource_use_in_class, opts = {}) ⇒ Array<(ClassAssignment, Integer, Hash)>
Use an education resource in a class This endpoint will copy a resource and the underlying resources.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ EduResourcesApi
Returns a new instance of EduResourcesApi.
19 20 21 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#copy_edu_resource(resource, edu_resource_copy, opts = {}) ⇒ EduResource
Copy an education resource to a Resource Library
27 28 29 30 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 27 def copy_edu_resource(resource, edu_resource_copy, opts = {}) data, _status_code, _headers = copy_edu_resource_with_http_info(resource, edu_resource_copy, opts) data end |
#copy_edu_resource_to_demo_class(resource, opts = {}) ⇒ ClassAssignment
Copy an education assignment to a teacher demo class Once a resource library can be published to a class (‘Assignment.capabilities.canPublishInClass = true`), this endpoint can be used for the feature "View as student". It will ensure the teacher has a demo class, then copy the assignment to the demo class. You can then use `POST /classes/class/testStudent` to create a testing student account in the demo class.
99 100 101 102 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 99 def copy_edu_resource_to_demo_class(resource, opts = {}) data, _status_code, _headers = copy_edu_resource_to_demo_class_with_http_info(resource, opts) data end |
#copy_edu_resource_to_demo_class_with_http_info(resource, opts = {}) ⇒ Array<(ClassAssignment, Integer, Hash)>
Copy an education assignment to a teacher demo class Once a resource library can be published to a class (`Assignment.capabilities.canPublishInClass = true`), this endpoint can be used for the feature "View as student". It will ensure the teacher has a demo class, then copy the assignment to the demo class. You can then use `POST /classes/class/testStudent` to create a testing student account in the demo class.
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 151 152 153 154 155 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 109 def copy_edu_resource_to_demo_class_with_http_info(resource, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EduResourcesApi.copy_edu_resource_to_demo_class ...' end # verify the required parameter 'resource' is set if @api_client.config.client_side_validation && resource.nil? fail ArgumentError, "Missing the required parameter 'resource' when calling EduResourcesApi.copy_edu_resource_to_demo_class" end # resource path local_var_path = '/eduResources/{resource}/copyToDemoClass'.sub('{' + 'resource' + '}', CGI.escape(resource.to_s)) # 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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ClassAssignment' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"EduResourcesApi.copy_edu_resource_to_demo_class", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: EduResourcesApi#copy_edu_resource_to_demo_class\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#copy_edu_resource_with_http_info(resource, edu_resource_copy, opts = {}) ⇒ Array<(EduResource, Integer, Hash)>
Copy an education resource to a Resource Library
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 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 37 def copy_edu_resource_with_http_info(resource, edu_resource_copy, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EduResourcesApi.copy_edu_resource ...' end # verify the required parameter 'resource' is set if @api_client.config.client_side_validation && resource.nil? fail ArgumentError, "Missing the required parameter 'resource' when calling EduResourcesApi.copy_edu_resource" end # verify the required parameter 'edu_resource_copy' is set if @api_client.config.client_side_validation && edu_resource_copy.nil? fail ArgumentError, "Missing the required parameter 'edu_resource_copy' when calling EduResourcesApi.copy_edu_resource" end # resource path local_var_path = '/eduResources/{resource}/copy'.sub('{' + 'resource' + '}', CGI.escape(resource.to_s)) # 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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(edu_resource_copy) # return_type return_type = opts[:debug_return_type] || 'EduResource' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"EduResourcesApi.copy_edu_resource", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: EduResourcesApi#copy_edu_resource\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_edu_resource(edu_resource_creation, opts = {}) ⇒ EduResource
Create a new education resource
161 162 163 164 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 161 def create_edu_resource(edu_resource_creation, opts = {}) data, _status_code, _headers = create_edu_resource_with_http_info(edu_resource_creation, opts) data end |
#create_edu_resource_lti_link(resource, opts = {}) ⇒ EduResourceLtiLink
Create an LTI link for an education resource This endpoint will return an LTI link that can be used to launch Flat for Education. The link, in a context from a class, will ensure the assignment has been copied in the class.
228 229 230 231 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 228 def create_edu_resource_lti_link(resource, opts = {}) data, _status_code, _headers = create_edu_resource_lti_link_with_http_info(resource, opts) data end |
#create_edu_resource_lti_link_with_http_info(resource, opts = {}) ⇒ Array<(EduResourceLtiLink, Integer, Hash)>
Create an LTI link for an education resource This endpoint will return an LTI link that can be used to launch Flat for Education. The link, in a context from a class, will ensure the assignment has been copied in the class.
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 276 277 278 279 280 281 282 283 284 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 238 def create_edu_resource_lti_link_with_http_info(resource, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EduResourcesApi.create_edu_resource_lti_link ...' end # verify the required parameter 'resource' is set if @api_client.config.client_side_validation && resource.nil? fail ArgumentError, "Missing the required parameter 'resource' when calling EduResourcesApi.create_edu_resource_lti_link" end # resource path local_var_path = '/eduResources/{resource}/createLtiLink'.sub('{' + 'resource' + '}', CGI.escape(resource.to_s)) # 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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'EduResourceLtiLink' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"EduResourcesApi.create_edu_resource_lti_link", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: EduResourcesApi#create_edu_resource_lti_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_edu_resource_with_http_info(edu_resource_creation, opts = {}) ⇒ Array<(EduResource, Integer, Hash)>
Create a new education resource
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 215 216 217 218 219 220 221 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 170 def create_edu_resource_with_http_info(edu_resource_creation, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EduResourcesApi.create_edu_resource ...' end # verify the required parameter 'edu_resource_creation' is set if @api_client.config.client_side_validation && edu_resource_creation.nil? fail ArgumentError, "Missing the required parameter 'edu_resource_creation' when calling EduResourcesApi.create_edu_resource" end # resource path local_var_path = '/eduResources' # 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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(edu_resource_creation) # return_type return_type = opts[:debug_return_type] || 'EduResource' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"EduResourcesApi.create_edu_resource", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: EduResourcesApi#create_edu_resource\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_edu_resource(resource, opts = {}) ⇒ nil
Delete an education resource
290 291 292 293 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 290 def delete_edu_resource(resource, opts = {}) delete_edu_resource_with_http_info(resource, opts) nil end |
#delete_edu_resource_with_http_info(resource, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete an education resource
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 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 299 def delete_edu_resource_with_http_info(resource, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EduResourcesApi.delete_edu_resource ...' end # verify the required parameter 'resource' is set if @api_client.config.client_side_validation && resource.nil? fail ArgumentError, "Missing the required parameter 'resource' when calling EduResourcesApi.delete_edu_resource" end # resource path local_var_path = '/eduResources/{resource}'.sub('{' + 'resource' + '}', CGI.escape(resource.to_s)) # 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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"EduResourcesApi.delete_edu_resource", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: EduResourcesApi#delete_edu_resource\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_edu_resource(resource, opts = {}) ⇒ EduResource
Get an education resource
351 352 353 354 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 351 def get_edu_resource(resource, opts = {}) data, _status_code, _headers = get_edu_resource_with_http_info(resource, opts) data end |
#get_edu_resource_with_http_info(resource, opts = {}) ⇒ Array<(EduResource, Integer, Hash)>
Get an education resource
360 361 362 363 364 365 366 367 368 369 370 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 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 360 def get_edu_resource_with_http_info(resource, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EduResourcesApi.get_edu_resource ...' end # verify the required parameter 'resource' is set if @api_client.config.client_side_validation && resource.nil? fail ArgumentError, "Missing the required parameter 'resource' when calling EduResourcesApi.get_edu_resource" end # resource path local_var_path = '/eduResources/{resource}'.sub('{' + 'resource' + '}', CGI.escape(resource.to_s)) # 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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'EduResource' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"EduResourcesApi.get_edu_resource", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: EduResourcesApi#get_edu_resource\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_edu_libraries(opts = {}) ⇒ Array<EduLibrary>
List the education libraries
411 412 413 414 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 411 def list_edu_libraries(opts = {}) data, _status_code, _headers = list_edu_libraries_with_http_info(opts) data end |
#list_edu_libraries_with_http_info(opts = {}) ⇒ Array<(Array<EduLibrary>, Integer, Hash)>
List the education libraries
419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 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 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 419 def list_edu_libraries_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EduResourcesApi.list_edu_libraries ...' end # resource path local_var_path = '/eduResources/libraries' # 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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array<EduLibrary>' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"EduResourcesApi.list_edu_libraries", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: EduResourcesApi#list_edu_libraries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_edu_resources(opts = {}) ⇒ Array<EduResource>
List education resources in a library or folder
473 474 475 476 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 473 def list_edu_resources(opts = {}) data, _status_code, _headers = list_edu_resources_with_http_info(opts) data end |
#list_edu_resources_with_http_info(opts = {}) ⇒ Array<(Array<EduResource>, Integer, Hash)>
List education resources in a library or folder
488 489 490 491 492 493 494 495 496 497 498 499 500 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 548 549 550 551 552 553 554 555 556 557 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 488 def list_edu_resources_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EduResourcesApi.list_edu_resources ...' end allowable_values = ["assignment", "folder"] if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type']) fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}" end allowable_values = ["creationDate", "updateDate", "title"] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end allowable_values = ["asc", "desc"] if @api_client.config.client_side_validation && opts[:'direction'] && !allowable_values.include?(opts[:'direction']) fail ArgumentError, "invalid value for \"direction\", must be one of #{allowable_values}" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling EduResourcesApi.list_edu_resources, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling EduResourcesApi.list_edu_resources, must be greater than or equal to 1.' end # resource path local_var_path = '/eduResources' # query parameters query_params = opts[:query_params] || {} query_params[:'parent'] = opts[:'parent'] if !opts[:'parent'].nil? query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'next'] = opts[:'_next'] if !opts[:'_next'].nil? query_params[:'previous'] = opts[:'previous'] if !opts[:'previous'].nil? # 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[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array<EduResource>' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"EduResourcesApi.list_edu_resources", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: EduResourcesApi#list_edu_resources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#move_edu_resource(resource, edu_resource_move, opts = {}) ⇒ EduResource
Move an education resource
564 565 566 567 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 564 def move_edu_resource(resource, edu_resource_move, opts = {}) data, _status_code, _headers = move_edu_resource_with_http_info(resource, edu_resource_move, opts) data end |
#move_edu_resource_with_http_info(resource, edu_resource_move, opts = {}) ⇒ Array<(EduResource, Integer, Hash)>
Move an education resource
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 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 574 def move_edu_resource_with_http_info(resource, edu_resource_move, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EduResourcesApi.move_edu_resource ...' end # verify the required parameter 'resource' is set if @api_client.config.client_side_validation && resource.nil? fail ArgumentError, "Missing the required parameter 'resource' when calling EduResourcesApi.move_edu_resource" end # verify the required parameter 'edu_resource_move' is set if @api_client.config.client_side_validation && edu_resource_move.nil? fail ArgumentError, "Missing the required parameter 'edu_resource_move' when calling EduResourcesApi.move_edu_resource" end # resource path local_var_path = '/eduResources/{resource}/move'.sub('{' + 'resource' + '}', CGI.escape(resource.to_s)) # 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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(edu_resource_move) # return_type return_type = opts[:debug_return_type] || 'EduResource' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"EduResourcesApi.move_edu_resource", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: EduResourcesApi#move_edu_resource\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_edu_resource(resource, edu_resource_update, opts = {}) ⇒ EduResource
Update an education resource metadata Update any resources metadata (e.g. title). Use this method to rename education resources folders or assignments.
637 638 639 640 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 637 def update_edu_resource(resource, edu_resource_update, opts = {}) data, _status_code, _headers = update_edu_resource_with_http_info(resource, edu_resource_update, opts) data end |
#update_edu_resource_assignment(resource, assignment_update, opts = {}) ⇒ Assignment
Update an education resource assignment
710 711 712 713 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 710 def update_edu_resource_assignment(resource, assignment_update, opts = {}) data, _status_code, _headers = update_edu_resource_assignment_with_http_info(resource, assignment_update, opts) data end |
#update_edu_resource_assignment_with_http_info(resource, assignment_update, opts = {}) ⇒ Array<(Assignment, Integer, Hash)>
Update an education resource assignment
720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 720 def update_edu_resource_assignment_with_http_info(resource, assignment_update, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EduResourcesApi.update_edu_resource_assignment ...' end # verify the required parameter 'resource' is set if @api_client.config.client_side_validation && resource.nil? fail ArgumentError, "Missing the required parameter 'resource' when calling EduResourcesApi.update_edu_resource_assignment" end # verify the required parameter 'assignment_update' is set if @api_client.config.client_side_validation && assignment_update.nil? fail ArgumentError, "Missing the required parameter 'assignment_update' when calling EduResourcesApi.update_edu_resource_assignment" end # resource path local_var_path = '/eduResources/{resource}/assignment'.sub('{' + 'resource' + '}', CGI.escape(resource.to_s)) # 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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(assignment_update) # return_type return_type = opts[:debug_return_type] || 'Assignment' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"EduResourcesApi.update_edu_resource_assignment", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: EduResourcesApi#update_edu_resource_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_edu_resource_with_http_info(resource, edu_resource_update, opts = {}) ⇒ Array<(EduResource, Integer, Hash)>
Update an education resource metadata Update any resources metadata (e.g. title). Use this method to rename education resources folders or assignments.
648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 648 def update_edu_resource_with_http_info(resource, edu_resource_update, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EduResourcesApi.update_edu_resource ...' end # verify the required parameter 'resource' is set if @api_client.config.client_side_validation && resource.nil? fail ArgumentError, "Missing the required parameter 'resource' when calling EduResourcesApi.update_edu_resource" end # verify the required parameter 'edu_resource_update' is set if @api_client.config.client_side_validation && edu_resource_update.nil? fail ArgumentError, "Missing the required parameter 'edu_resource_update' when calling EduResourcesApi.update_edu_resource" end # resource path local_var_path = '/eduResources/{resource}'.sub('{' + 'resource' + '}', CGI.escape(resource.to_s)) # 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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(edu_resource_update) # return_type return_type = opts[:debug_return_type] || 'EduResource' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"EduResourcesApi.update_edu_resource", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: EduResourcesApi#update_edu_resource\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#use_edu_resource_in_class(resource, edu_resource_use_in_class, opts = {}) ⇒ ClassAssignment
Use an education resource in a class This endpoint will copy a resource and the underlying resources. The assignment will be created as a draft that can be completed with other options before publishing (e.g. due date, publication date for scheduling, etc.).
783 784 785 786 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 783 def use_edu_resource_in_class(resource, edu_resource_use_in_class, opts = {}) data, _status_code, _headers = use_edu_resource_in_class_with_http_info(resource, edu_resource_use_in_class, opts) data end |
#use_edu_resource_in_class_with_http_info(resource, edu_resource_use_in_class, opts = {}) ⇒ Array<(ClassAssignment, Integer, Hash)>
Use an education resource in a class This endpoint will copy a resource and the underlying resources. The assignment will be created as a draft that can be completed with other options before publishing (e.g. due date, publication date for scheduling, etc.).
794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 |
# File 'lib/flat_api/api/edu_resources_api.rb', line 794 def use_edu_resource_in_class_with_http_info(resource, edu_resource_use_in_class, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EduResourcesApi.use_edu_resource_in_class ...' end # verify the required parameter 'resource' is set if @api_client.config.client_side_validation && resource.nil? fail ArgumentError, "Missing the required parameter 'resource' when calling EduResourcesApi.use_edu_resource_in_class" end # verify the required parameter 'edu_resource_use_in_class' is set if @api_client.config.client_side_validation && edu_resource_use_in_class.nil? fail ArgumentError, "Missing the required parameter 'edu_resource_use_in_class' when calling EduResourcesApi.use_edu_resource_in_class" end # resource path local_var_path = '/eduResources/{resource}/useInClass'.sub('{' + 'resource' + '}', CGI.escape(resource.to_s)) # 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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(edu_resource_use_in_class) # return_type return_type = opts[:debug_return_type] || 'ClassAssignment' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"EduResourcesApi.use_edu_resource_in_class", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: EduResourcesApi#use_edu_resource_in_class\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |