|
2 | 2 |
|
3 | 3 | module V1 |
4 | 4 | module Ont |
5 | | - # @todo This documentation does not yet include a detailed description of what this resource represents. |
6 | | - # @todo This documentation does not yet include detailed descriptions for relationships, attributes and filters. |
7 | | - # @todo This documentation does not yet include any example usage of the API via cURL or similar. |
| 5 | + # Provides a JSON:API representation of {Ont::Request}. |
8 | 6 | # |
9 | 7 | # @note Access this resource via the `/v1/ont/requests/` endpoint. |
10 | 8 | # |
11 | | - # Provides a JSON:API representation of {Ont::Request}. |
12 | | - # |
13 | 9 | # For more information about JSON:API see the [JSON:API Specifications](https://jsonapi.org/format/) |
14 | 10 | # or look at the [JSONAPI::Resources](http://jsonapi-resources.com/) package |
15 | 11 | # for the service implementation of the JSON:API standard. |
| 12 | + # This resource represents an ONT Request and can return all requests, a single request or |
| 13 | + # multiple requests along with their relationships. |
| 14 | + # |
| 15 | + # ## Filters: |
| 16 | + # |
| 17 | + # * sample_name |
| 18 | + # * source_identifier |
| 19 | + # |
| 20 | + # @example |
| 21 | + # |
| 22 | + # # Get a single request |
| 23 | + # curl -X GET http://localhost:3000/v1/ont/requests/1 |
| 24 | + # |
| 25 | + # # Get all requests |
| 26 | + # curl -X GET http://localhost:3000/v1/ont/requests/ |
| 27 | + # |
| 28 | + # # Filter requests by sample name or source identifier |
| 29 | + # curl -X GET "http://localhost:3000/v1/ont/requests?filter[sample_name]=sample_name" |
| 30 | + # curl -X GET "http://localhost:3000/v1/ont/requests?filter[source_identifier]=mock-plate-2:B12" |
| 31 | + # curl -X GET "http://localhost:3000/v1/ont/requests?filter[source_identifier]=mock-plate-2:B12,mock-plate-3:A1" |
| 32 | + # |
| 33 | + # # Create a new ONT request |
| 34 | + # curl -X POST http://localhost:3000/v1/ont/requests \ |
| 35 | + # -H "Content-Type: application/vnd.api+json" \ |
| 36 | + # -d '{ |
| 37 | + # "data": { |
| 38 | + # "type": "requests", |
| 39 | + # "attributes": { |
| 40 | + # "library_type": "ONT", |
| 41 | + # "data_type": "Basecalling", |
| 42 | + # "cost_code": "S12345", |
| 43 | + # "external_study_id": "EXT-001", |
| 44 | + # "number_of_flowcells": 2, |
| 45 | + # "sample_name": "Sample 1" |
| 46 | + # } |
| 47 | + # } |
| 48 | + # }' |
| 49 | + # |
| 50 | + # # Update an existing ONT request |
| 51 | + # curl -X PATCH http://localhost:3000/v1/ont/requests/1 \ |
| 52 | + # -H "Content-Type: application/vnd.api+json" \ |
| 53 | + # -d '{ |
| 54 | + # "data": { |
| 55 | + # "id": "1", |
| 56 | + # "type": "requests", |
| 57 | + # "attributes": { |
| 58 | + # "cost_code": "S54321" |
| 59 | + # } |
| 60 | + # } |
| 61 | + # |
16 | 62 | class RequestResource < JSONAPI::Resource |
17 | 63 | include Shared::SourceIdentifierFilterable |
18 | 64 | model_name 'Ont::Request', add_model_hint: false |
|
0 commit comments