Class: Api::V2::RequestResource
- Inherits:
-
BaseResource
- Object
- JSONAPI::Resource
- BaseResource
- Api::V2::RequestResource
- Defined in:
- app/resources/api/v2/request_resource.rb
Overview
This documentation does not yet include a detailed description of what this resource represents.
This documentation does not yet include detailed descriptions for relationships, attributes and filters.
This documentation does not yet include any example usage of the API via cURL or similar.
Access this resource via the /api/v2/requests/
endpoint.
Provides a JSON:API representation of Request.
For more information about JSON:API see the JSON:API Specifications or look at the JSONAPI::Resources package for Sequencescape’s implementation of the JSON:API standard.
Instance Method Summary collapse
- #library_type ⇒ Object
-
#options ⇒ Object
Field Methods.
- #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 Method Details
#library_type ⇒ Object
67 68 69 |
# File 'app/resources/api/v2/request_resource.rb', line 67 def library_type _model.try(:library_type) end |
#options ⇒ Object
Field Methods
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'app/resources/api/v2/request_resource.rb', line 42 def # rubocop:todo Metrics/AbcSize # We need to pass in the attribute details here, as eager loading the metadata just instantiates # Request::Metadata # TODO: Nuke the separate metadata classes and metaprogramming {}.tap do |attrs| _model . .attribute_value_pairs(_model.class::Metadata.attribute_details) .each { |attribute, value| attrs[attribute.name.to_s] = value unless value.nil? } _model . .association_value_pairs(_model.class::Metadata.association_details) .each { |association, value| attrs[association.name.to_s] = value unless value.nil? } end end |
#pre_capture_pool_id ⇒ Object
63 64 65 |
# File 'app/resources/api/v2/request_resource.rb', line 63 def pre_capture_pool_id _model.pooled_request&.pre_capture_pool_id end |
#primer_panel_id ⇒ Object
JSONAPI::Resource doesn’t support has_one through relationships by default
59 60 61 |
# File 'app/resources/api/v2/request_resource.rb', line 59 def primer_panel_id _model..primer_panel_id end |