Class: Api::V2::PurposeResource
- Inherits:
-
BaseResource
- Object
- JSONAPI::Resource
- BaseResource
- Api::V2::PurposeResource
- Defined in:
- app/resources/api/v2/purpose_resource.rb
Overview
Access this resource via the /api/v2/purposes/
endpoint.
the below example is currently broken, as target_type
is a required attribute in the model and lifespan
is not.
Provides a JSON:API representation of Purpose.
A Purpose defines the intended function of a labware or sample within the system. While it was historically limited to PlatePurpose, it now applies to other labware like Tubes.
}
For more details on JSON:API, see the JSON:API Specifications or check out the JSONAPI::Resources package for Sequencescape's implementation.
Instance Attribute Summary collapse
-
#lifespan ⇒ Integer
The expected lifespan of the purpose.
-
#name ⇒ String
The name of the purpose.
-
#size ⇒ Integer
The expected size of the purpose.
-
#uuid ⇒ String
readonly
The universally unique identifier (UUID) of purpose.
Instance Method Summary collapse
-
#filter_by_name ⇒ Object
Allows filtering projects by name.
Methods inherited from BaseResource
apply_includes, creatable_fields, default_includes, #fetchable_fields, inclusions, resolve_relationship_names_to_relations, updatable_fields
Instance Attribute Details
#lifespan ⇒ Integer
The expected lifespan of the purpose.
61 |
# File 'app/resources/api/v2/purpose_resource.rb', line 61 attribute :lifespan, write_once: true |
#name ⇒ String
The name of the purpose.
51 |
# File 'app/resources/api/v2/purpose_resource.rb', line 51 attribute :name, write_once: true |
#size ⇒ Integer
The expected size of the purpose.
56 |
# File 'app/resources/api/v2/purpose_resource.rb', line 56 attribute :size, write_once: true |
#uuid ⇒ String (readonly)
This identifier is automatically assigned upon creation and cannot be modified.
Returns The universally unique identifier (UUID) of purpose.
46 |
# File 'app/resources/api/v2/purpose_resource.rb', line 46 attribute :uuid, readonly: true |
Instance Method Details
#filter_by_name ⇒ Object
Allows filtering projects by name.
71 |
# File 'app/resources/api/v2/purpose_resource.rb', line 71 filter :name |