Class: Api::V2::RequestResource
- Inherits:
-
BaseResource
- Object
- JSONAPI::Resource
- BaseResource
- Api::V2::RequestResource
- Defined in:
- app/resources/api/v2/request_resource.rb
Overview
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.
111 |
# File 'app/resources/api/v2/request_resource.rb', line 111 attribute :library_type, readonly: true |
#options ⇒ Object (readonly)
This method retrieves the options associated with the request, including metadata from the request_metadata
relationship.
105 |
# File 'app/resources/api/v2/request_resource.rb', line 105 attribute :options, readonly: true |
#order ⇒ Object (readonly)
The order associated with this request.
125 |
# File 'app/resources/api/v2/request_resource.rb', line 125 has_one :order, always_include_linkage_data: true |
#poly_metadata ⇒ Array<PolyMetadatumResource> (readonly)
The metadata associated with the request.
147 |
# File 'app/resources/api/v2/request_resource.rb', line 147 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.
142 |
# File 'app/resources/api/v2/request_resource.rb', line 142 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.
136 |
# File 'app/resources/api/v2/request_resource.rb', line 136 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.”
99 |
# File 'app/resources/api/v2/request_resource.rb', line 99 attribute :priority, write_once: true |
#request_metadata ⇒ RequestMetadataResource (readonly)
The metadata associated with the request.
152 |
# File 'app/resources/api/v2/request_resource.rb', line 152 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.”
130 |
# File 'app/resources/api/v2/request_resource.rb', line 130 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.”
87 |
# File 'app/resources/api/v2/request_resource.rb', line 87 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.”
93 |
# File 'app/resources/api/v2/request_resource.rb', line 93 attribute :state |
#submission ⇒ Object (readonly)
The submission associated with this request.
120 |
# File 'app/resources/api/v2/request_resource.rb', line 120 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.
81 |
# File 'app/resources/api/v2/request_resource.rb', line 81 attribute :uuid, readonly: true |
Instance Method Details
#pre_capture_pool_id ⇒ Object
This method retrieves the pre-capture pool ID associated with the request.
183 184 185 |
# File 'app/resources/api/v2/request_resource.rb', line 183 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
178 179 180 |
# File 'app/resources/api/v2/request_resource.rb', line 178 def primer_panel_id _model..primer_panel_id end |