Class: Api::V2::SpecificTubeRackCreationResource

Inherits:
BaseResource
  • Object
show all
Defined in:
app/resources/api/v2/specific_tube_rack_creation_resource.rb

Overview

Note:

This resource cannot be modified after creation: its endpoint will not accept PATCH requests.

Note:

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

This resource represents the api v2 resource for the specific tube rack creations endpoint. This endpoint is used to create tube rack instances and the racked tubes within them.

Provides a JSON:API representation of SpecificTubeRackCreation.

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 Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseResource

apply_includes, default_includes, inclusions, resolve_relationship_names_to_relations, updatable_fields

Instance Attribute Details

#childrenArray<TubeRackResource> (readonly)

Returns An array of tube racks that were created.

Returns:



91
# File 'app/resources/api/v2/specific_tube_rack_creation_resource.rb', line 91

has_many :children, class_name: 'TubeRack'

#parent_uuids=(value) ⇒ Void (writeonly)

Deprecated.

Use the parents relationship instead.

This is declared for convenience where the parent is not available to set as a relationship. Setting this attribute alongside the parents relationship will prefer the relationship value. and tubes created.

Parameters:

  • value (Array<String>)

    The UUIDs of labware that will be the parents for all tube racks

Returns:

  • (Void)

See Also:



29
# File 'app/resources/api/v2/specific_tube_rack_creation_resource.rb', line 29

attribute :parent_uuids

#parentsArray<LabwareResource>

Note:

This relationship is required.

Setting this relationship alongside the parent_uuids attribute will override the attribute value.

Returns:

  • (Array<LabwareResource>)

    An array of the parents of the tubes being created.



97
# File 'app/resources/api/v2/specific_tube_rack_creation_resource.rb', line 97

has_many :parents, class_name: 'Labware'

#tube_rack_attributes=(value) ⇒ Void (writeonly)

{ :tube_rack_name=>“Tube Rack”, :tube_rack_barcode=>“TR00000001”, :tube_rack_purpose_uuid=>“0ab4c9cc-4dad-11ef-8ca3-82c61098d1a1”, :racked_tubes=>[ { :tube_barcode=>“SQ45303801”, :tube_name=>“SEQ:NT749R:A1”, :tube_purpose_uuid=>“0ab4c9cc-4dad-11ef-8ca3-82c61098d1a1”, :tube_position=>“A1”, :parent_uuids=> }, etc… more tubes ] }, etc… more tube racks

Examples:

[

Parameters:

  • value (Array<Hash>)

    Hashes defining the attributes to apply to each tube rack and the tubes within that are being created. This is used to set custom attributes on the tube racks, such as name. As well as to create the tubes within the tube rack and link them together.

Returns:

  • (Void)


59
# File 'app/resources/api/v2/specific_tube_rack_creation_resource.rb', line 59

attribute :tube_rack_attributes

#userUserResource

Note:

This relationship is required.

Setting this relationship alongside the user_uuid attribute will override the attribute value.

Returns:

  • (UserResource)

    The user who initiated the creation of tubes.



103
# File 'app/resources/api/v2/specific_tube_rack_creation_resource.rb', line 103

has_one :user

#user_uuid=(value) ⇒ Void (writeonly)

Deprecated.

Use the user relationship instead.

This is declared for convenience where the user is not available to set as a relationship. Setting this attribute alongside the user relationship will prefer the relationship value.

Parameters:

  • value (String)

    The UUID of the user who initiated the creation of tubes.

Returns:

  • (Void)

See Also:



75
# File 'app/resources/api/v2/specific_tube_rack_creation_resource.rb', line 75

attribute :user_uuid

#uuidString (readonly)

Returns The UUID of the AssetCreation instance.

Returns:

  • (String)

    The UUID of the AssetCreation instance.



83
# File 'app/resources/api/v2/specific_tube_rack_creation_resource.rb', line 83

attribute :uuid, readonly: true

Class Method Details

.creatable_fields(context) ⇒ Object



105
106
107
108
# File 'app/resources/api/v2/specific_tube_rack_creation_resource.rb', line 105

def self.creatable_fields(context)
  # UUID is set by the system.
  super - %i[uuid]
end

Instance Method Details

#fetchable_fieldsObject



110
111
112
113
114
# File 'app/resources/api/v2/specific_tube_rack_creation_resource.rb', line 110

def fetchable_fields
  # The tube_rack_attributes attribute is only available during resource creation.
  # UUIDs for relationships are not fetchable. They should be accessed via the relationship itself.
  super - %i[parent_uuids tube_rack_attributes user_uuid]
end