Class: Api::V2::LotTypeResource
- Inherits:
-
BaseResource
- Object
- JSONAPI::Resource
- BaseResource
- Api::V2::LotTypeResource
- Defined in:
- app/resources/api/v2/lot_type_resource.rb
Overview
This resource is immutable: its endpoint will not accept POST
, PATCH
, or DELETE
requests.
Access this resource via the /api/v2/lot_types/
endpoint.
Provides a JSON:API representation of LotType.
A LotType governs the behaviour of a Lot
For more information about JSON:API, see the JSON:API Specifications or the JSONAPI::Resources package for Sequencescape's implementation of the JSON:API standard.
Instance Attribute Summary collapse
-
#name ⇒ String
The name of this lot type.
-
#printer_type ⇒ String
readonly
The type of printer used for this lot type.
-
#qcable_name ⇒ String?
readonly
Retrieves the name of the target purpose associated with this lot type.
-
#target_purpose ⇒ PurposeResource
The Purpose that this lot type is associated with.
-
#template_class ⇒ Object
readonly
The class of the template associated with this lot type.
-
#template_type ⇒ String
Retrieves the template type based on the internal class name.
-
#uuid ⇒ String
readonly
The universally unique identifier (UUID) of the lot type.
Instance Method Summary collapse
-
#active ⇒ Boolean
Filter to return only active lot types.
Methods inherited from BaseResource
apply_includes, creatable_fields, default_includes, #fetchable_fields, inclusions, resolve_relationship_names_to_relations, updatable_fields
Instance Attribute Details
#name ⇒ String
This resource is immutable; Update attribute to be read-only.
This attribute must be unique.
The name of this lot type
41 |
# File 'app/resources/api/v2/lot_type_resource.rb', line 41 attribute :name, write_once: true |
#printer_type ⇒ String (readonly)
The type of printer used for this lot type. This is retrieved from the LotType model. e.g. '96 Well Plate'
63 |
# File 'app/resources/api/v2/lot_type_resource.rb', line 63 attribute :printer_type, readonly: true |
#qcable_name ⇒ String? (readonly)
Retrieves the name of the target purpose associated with this lot type. This is the type of labware that end up being created under this lot type. The method (along with naming) was added for consistency with the v1 API when converting Gatekeeper to use the v2 API.
e.g. 'Tag Plate'
56 |
# File 'app/resources/api/v2/lot_type_resource.rb', line 56 attribute :qcable_name, readonly: true |
#target_purpose ⇒ PurposeResource
This resource is immutable; Update relationship to be read-only.
The Purpose that this lot type is associated with
97 |
# File 'app/resources/api/v2/lot_type_resource.rb', line 97 has_one :target_purpose, write_once: true, class_name: 'Purpose' |
#template_class ⇒ Object (readonly)
The class of the template associated with this lot type.
45 |
# File 'app/resources/api/v2/lot_type_resource.rb', line 45 attribute :template_class, readonly: true |
#template_type ⇒ String
Retrieves the template type based on the internal class name.
e.g 'TagLayoutTemplate'
52 |
# File 'app/resources/api/v2/lot_type_resource.rb', line 52 attribute :template_type, write_once: true |
#uuid ⇒ String (readonly)
This identifier is automatically assigned upon creation and cannot be modified.
Returns The universally unique identifier (UUID) of the lot type.
34 |
# File 'app/resources/api/v2/lot_type_resource.rb', line 34 attribute :uuid, readonly: true |
Instance Method Details
#active ⇒ Boolean
Filter to return only active lot types. This filter allows users to specify if only active lot types should be returned.
108 |
# File 'app/resources/api/v2/lot_type_resource.rb', line 108 filter :active, default: true |