Class: Api::V2::TransferResource
- Inherits:
-
BaseResource
- Object
- JSONAPI::Resource
- BaseResource
- Api::V2::TransferResource
- Defined in:
- app/resources/api/v2/transfer_resource.rb
Overview
TransferRequestCollection is preferred, as it allows the client applications to control the transfer behaviour.
Access this resource via the /api/v2/transfers/
endpoint.
This resource cannot be modified after creation: its endpoint will not accept PATCH
requests.
Provides a JSON:API representation of Transfer.
A transfer handles the transfer of material from one piece of labware to another. Different classes are used to determine exactly how the transfers are performed. For more information about JSON:API see the JSON:API Specifications or refer to the JSONAPI::Resources package for Sequencescape's implementation of the JSON:API standard.
Instance Attribute Summary collapse
-
#destination ⇒ LabwareResource, Void
The destination labware for the transfer.
-
#destination_uuid ⇒ String, Void
deprecated
Deprecated.
Use the
destination
relationship instead. -
#source ⇒ LabwareResource
The source labware for the transfer.
-
#source_uuid ⇒ Void
deprecated
Deprecated.
Use the
source
relationship instead. -
#transfer_template_uuid ⇒ Object
writeonly
This is consumed by the transfers_controller and not stored in the model.
-
#transfer_type ⇒ Object
readonly
A filter to restrict the type of transfer to retrieve.
-
#transfers ⇒ Hash
A hash of transfers made, usually populated by a TransferTemplate used during the creation of the Transfer.
-
#user ⇒ UserResource
The user who requested the transfer.
- #user_uuid ⇒ Object
-
#uuid ⇒ String
readonly
The UUID of the transfer.
Class Method Summary collapse
-
.create(context) ⇒ Object
Custom Methods for Creation.
Methods inherited from BaseResource
apply_includes, creatable_fields, default_includes, #fetchable_fields, inclusions, resolve_relationship_names_to_relations, updatable_fields
Instance Attribute Details
#destination ⇒ LabwareResource, Void
The destination labware for the transfer. Setting this relationship alongside the destination_uuid
attribute will override the attribute value.
170 |
# File 'app/resources/api/v2/transfer_resource.rb', line 170 has_one :destination |
#destination_uuid ⇒ String, Void
Use the destination
relationship instead.
This attribute allows the user to specify the destination labware by UUID. Setting this attribute alongside the destination
relationship will prefer the relationship value.
111 |
# File 'app/resources/api/v2/transfer_resource.rb', line 111 attribute :destination_uuid |
#source ⇒ LabwareResource
This relationship is required.
The source labware for the transfer. The type of the labware varies by the transfer type. Setting this relationship alongside the source_uuid
attribute will override the attribute value.
177 |
# File 'app/resources/api/v2/transfer_resource.rb', line 177 has_one :source, class_name: 'Labware' |
#source_uuid ⇒ Void
Use the source
relationship instead.
This attribute allows the user to specify the source labware by UUID. Setting this attribute alongside the source
relationship will prefer the relationship value.
127 |
# File 'app/resources/api/v2/transfer_resource.rb', line 127 attribute :source_uuid |
#transfer_template_uuid=(value) ⇒ Object (writeonly)
This is consumed by the transfers_controller and not stored in the model.
98 |
# File 'app/resources/api/v2/transfer_resource.rb', line 98 attribute :transfer_template_uuid, writeonly: true |
#transfer_type ⇒ Object (readonly)
A filter to restrict the type of transfer to retrieve. Example usage: GET /api/v2/transfers?filter=Transfer::BetweenPlates One of the following types: - 'Transfer::BetweenPlateAndTubes' - 'Transfer::BetweenPlatesBySubmission' - 'Transfer::BetweenPlates' - 'Transfer::BetweenSpecificTubes' - 'Transfer::BetweenTubesBySubmission' - 'Transfer::FromPlateToSpecificTubesByPool' - 'Transfer::FromPlateToSpecificTubes' - 'Transfer::FromPlateToTubeByMultiplex' - 'Transfer::FromPlateToTubeBySubmission' - 'Transfer::FromPlateToTube'
91 |
# File 'app/resources/api/v2/transfer_resource.rb', line 91 attribute :transfer_type, delegate: :sti_type, readonly: true |
#transfers ⇒ Hash
A hash of transfers made, usually populated by a TransferTemplate used during the creation of the Transfer. This method varies depending on the type of transfer being performed.
68 |
# File 'app/resources/api/v2/transfer_resource.rb', line 68 attribute :transfers |
#user ⇒ UserResource
This relationship is required.
The user who requested the transfer. Setting this relationship alongside the user_uuid
attribute will override the attribute value.
184 |
# File 'app/resources/api/v2/transfer_resource.rb', line 184 has_one :user |
#user_uuid ⇒ Object
Some old records may not have a User relationship, even though it's required for new records.
143 |
# File 'app/resources/api/v2/transfer_resource.rb', line 143 attribute :user_uuid, write_once: true |
#uuid ⇒ String (readonly)
This identifier is automatically assigned upon creation and cannot be modified.
The UUID of the transfer.
62 |
# File 'app/resources/api/v2/transfer_resource.rb', line 62 attribute :uuid, readonly: true |
Class Method Details
.create(context) ⇒ Object
Custom Methods for Creation
158 159 160 |
# File 'app/resources/api/v2/transfer_resource.rb', line 158 def self.create(context) new(context[:model_type].new, context) end |