Class: Api::V2::RequestResource
- Inherits:
-
BaseResource
- Object
- JSONAPI::Resource
- BaseResource
- Api::V2::RequestResource
- Defined in:
- app/resources/api/v2/request_resource.rb
Overview
Figure out how to send a POST for a request with request metadata association. Currently, it is possible to create a request and request metadata seperately, but they are not associated with each other. How do you create the association, either in one request or after the individual requests?
This resource supports GET
and PATCH
requests. It allows fetching requests by their attributes and updating them.
Provides a JSON:API representation of Request.
A Request represents work which needs to be done, either to fulfil a customers needs CustomerRequest or for internal reasons SystemRequest. The progress of a request is tracked through its state machine.
Access this resource via the /api/v2/requests/
endpoint.
For more information about JSON:API, see the JSON:API Specifications or check out the JSONAPI::Resources package for Sequencescape's implementation.
Instance Attribute Summary collapse
- #library_type ⇒ Object readonly
- #options ⇒ Object readonly
-
#order ⇒ Object
readonly
The order associated with this request.
-
#poly_metadata ⇒ Array<PolyMetadatumResource>
readonly
The metadata associated with the request.
-
#pre_capture_pool ⇒ PreCapturePoolResource
readonly
The pre-capture pool associated with the request.
-
#primer_panel ⇒ PrimerPanelResource
readonly
The primer panel used for the request, if applicable.
-
#priority ⇒ String
The priority of the request, such as “high,” “medium,” or “low.”.
-
#request_metadata ⇒ RequestMetadataResource
readonly
The metadata associated with the request.
-
#request_type ⇒ Object
readonly
The type of the request, such as “analysis” or “testing.”.
-
#role ⇒ String
The role of the request, such as “analysis” or “testing.”.
-
#state ⇒ String
The current state of the request, such as “pending,” “completed,” or “in progress.”.
-
#submission ⇒ Object
readonly
The submission associated with this request.
-
#uuid ⇒ String
readonly
The UUID of the request.
Instance Method Summary collapse
- #pre_capture_pool_id ⇒ Object
-
#primer_panel_id ⇒ Object
JSONAPI::Resource doesn't support has_one through relationships by default.
Methods inherited from BaseResource
apply_includes, creatable_fields, default_includes, #fetchable_fields, inclusions, resolve_relationship_names_to_relations, updatable_fields
Instance Attribute Details
#library_type ⇒ Object (readonly)
This method retrieves the library type associated with the request.
116 |
# File 'app/resources/api/v2/request_resource.rb', line 116 attribute :library_type, readonly: true |
#options ⇒ Object (readonly)
This method retrieves the options associated with the request, including metadata from the request_metadata
relationship.
110 |
# File 'app/resources/api/v2/request_resource.rb', line 110 attribute :options, readonly: true |
#order ⇒ Object (readonly)
The order associated with this request.
138 |
# File 'app/resources/api/v2/request_resource.rb', line 138 has_one :order, always_include_linkage_data: true |
#poly_metadata ⇒ Array<PolyMetadatumResource> (readonly)
The metadata associated with the request.
164 |
# File 'app/resources/api/v2/request_resource.rb', line 164 has_many :poly_metadata, as: :metadatable, class_name: 'PolyMetadatum' |
#pre_capture_pool ⇒ PreCapturePoolResource (readonly)
This relationship is read-only.
The pre-capture pool associated with the request.
159 |
# File 'app/resources/api/v2/request_resource.rb', line 159 has_one :pre_capture_pool, readonly: true |
#primer_panel ⇒ PrimerPanelResource (readonly)
This relationship is read-only.
The primer panel used for the request, if applicable.
153 |
# File 'app/resources/api/v2/request_resource.rb', line 153 has_one :primer_panel, readonly: true |
#priority ⇒ String
This attribute can only be set once.
The priority of the request, such as “high,” “medium,” or “low.”
104 |
# File 'app/resources/api/v2/request_resource.rb', line 104 attribute :priority, write_once: true |
#request_metadata ⇒ RequestMetadataResource (readonly)
The metadata associated with the request.
169 |
# File 'app/resources/api/v2/request_resource.rb', line 169 has_one :request_metadata, class_name: 'RequestMetadata', foreign_key_on: :related |
#request_type ⇒ Object (readonly)
The type of the request, such as “analysis” or “testing.”
147 |
# File 'app/resources/api/v2/request_resource.rb', line 147 has_one :request_type, always_include_linkage_data: true |
#role ⇒ String
This attribute can only be set once.
The role of the request, such as “analysis” or “testing.”
92 |
# File 'app/resources/api/v2/request_resource.rb', line 92 attribute :role, write_once: true |
#state ⇒ String
This field can be updated during the lifecycle of the request.
The current state of the request, such as “pending,” “completed,” or “in progress.”
98 |
# File 'app/resources/api/v2/request_resource.rb', line 98 attribute :state |
#submission ⇒ Object (readonly)
The submission associated with this request.
129 |
# File 'app/resources/api/v2/request_resource.rb', line 129 has_one :submission, always_include_linkage_data: true |
#uuid ⇒ String (readonly)
This identifier is automatically assigned upon creation and cannot be modified.
The UUID of the request.
86 |
# File 'app/resources/api/v2/request_resource.rb', line 86 attribute :uuid, readonly: true |
Instance Method Details
#pre_capture_pool_id ⇒ Object
This method retrieves the pre-capture pool ID associated with the request.
200 201 202 |
# File 'app/resources/api/v2/request_resource.rb', line 200 def pre_capture_pool_id _model.pooled_request&.pre_capture_pool_id end |
#primer_panel_id ⇒ Object
This method retrieves the primer panel ID associated with the request.
JSONAPI::Resource doesn't support has_one through relationships by default
195 196 197 |
# File 'app/resources/api/v2/request_resource.rb', line 195 def primer_panel_id _model..primer_panel_id end |