Class: Api::V2::SpecificTubeRackCreationResource
- Inherits:
-
BaseResource
- Object
- JSONAPI::Resource
- BaseResource
- Api::V2::SpecificTubeRackCreationResource
- Defined in:
- app/resources/api/v2/specific_tube_rack_creation_resource.rb
Overview
This resource cannot be modified after creation: its endpoint will not accept PATCH
requests.
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
-
#children ⇒ Array<TubeRackResource>
readonly
An array of tube racks that were created.
-
#parent_uuids ⇒ Void
writeonly
deprecated
Deprecated.
Use the
parents
relationship instead. -
#parents ⇒ Array<LabwareResource>
Setting this relationship alongside the
parent_uuids
attribute will override the attribute value. -
#tube_rack_attributes ⇒ 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…
-
#user ⇒ UserResource
Setting this relationship alongside the
user_uuid
attribute will override the attribute value. -
#user_uuid ⇒ Void
writeonly
deprecated
Deprecated.
Use the
user
relationship instead. -
#uuid ⇒ String
readonly
The UUID of the AssetCreation instance.
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
#children ⇒ Array<TubeRackResource> (readonly)
Returns An array of tube racks that were created.
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)
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.
29 |
# File 'app/resources/api/v2/specific_tube_rack_creation_resource.rb', line 29 attribute :parent_uuids |
#parents ⇒ Array<LabwareResource>
This relationship is required.
Setting this relationship alongside the parent_uuids
attribute will override the attribute value.
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
59 |
# File 'app/resources/api/v2/specific_tube_rack_creation_resource.rb', line 59 attribute :tube_rack_attributes |
#user ⇒ UserResource
This relationship is required.
Setting this relationship alongside the user_uuid
attribute will override the attribute value.
103 |
# File 'app/resources/api/v2/specific_tube_rack_creation_resource.rb', line 103 has_one :user |
#user_uuid=(value) ⇒ Void (writeonly)
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.
75 |
# File 'app/resources/api/v2/specific_tube_rack_creation_resource.rb', line 75 attribute :user_uuid |
#uuid ⇒ String (readonly)
Returns 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_fields ⇒ Object
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 |