Class: Api::V2::TubeResource

Inherits:
BaseResource
  • Object
show all
Includes:
SharedBehaviour::Labware
Defined in:
app/resources/api/v2/tube_resource.rb

Overview

Note:

This resource is immutable: its endpoint will not accept POST, PATCH, or DELETE requests.

Note:

Access this resource via the /api/v2/tubes/ endpoint.

Provides a JSON:API representation of a Tube.

A Tube is a piece of Labware, which is a container that can hold samples, aliquots, or other entities in a laboratory setting.

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.

Examples:

GET request for all Tube resources

GET /api/v2/tubes/

GET request for a Tube with ID 123

GET /api/v2/tubes/123/

Instance Attribute Summary collapse

Method Summary

Methods included from SharedBehaviour::Labware

#labware_barcode

Methods inherited from BaseResource

apply_includes, creatable_fields, default_includes, #fetchable_fields, inclusions, resolve_relationship_names_to_relations, updatable_fields

Instance Attribute Details

#aliquotsArray<Api::V2::AliquotResource> (readonly)

Note:

This relationship is read-only and represents the aliquots that are physically stored within the tube.

The aliquots contained within this tube. An aliquot is a portion of the contents from a larger sample, typically for further analysis or experimentation.

Returns:



55
# File 'app/resources/api/v2/tube_resource.rb', line 55

has_many :aliquots, readonly: true

#receptacleApi::V2::ReceptacleResource (readonly)

Note:

This relationship is read-only and is primarily used for retrieving information about the receptacle,

The receptacle associated with aliquots contained by this tube. A receptacle can refer to a container that holds multiple aliquots. not for modifying it.

Returns:



63
# File 'app/resources/api/v2/tube_resource.rb', line 63

has_one :receptacle, readonly: true, foreign_key_on: :related

#sibling_tubesArray<Hash> (readonly)

Note:

This attribute is read-only and may not be present for all tubes, as it depends on the context (e.g., tubes that are part of a group or series).

An array of hashes containing metadata for sibling tubes. Sibling tubes are tubes that share a common ancestor, often used in a grouping of tubes.

Returns:

  • (Array<Hash>)

    The metadata of sibling tubes.

See Also:



40
# File 'app/resources/api/v2/tube_resource.rb', line 40

attribute :sibling_tubes, readonly: true

#transfer_requests_as_targetArray<Api::V2::TransferRequestResource> (readonly)

Note:

This relationship is read-only and provides insights into the transfer requests targeting this tube.

The transfer requests that target this tube. A transfer request represents an instruction to move aliquots or samples into the tube.

Returns:



70
# File 'app/resources/api/v2/tube_resource.rb', line 70

has_many :transfer_requests_as_target, readonly: true