Class: Api::V2::TransferResource
- Inherits:
-
BaseResource
- Object
- JSONAPI::Resource
- BaseResource
- Api::V2::TransferResource
- Defined in:
- app/resources/api/v2/transfer_resource.rb
Overview
This documentation does not yet include a detailed description of what this resource represents.
This documentation does not yet include detailed descriptions for relationships, attributes and filters.
This documentation does not yet include any example usage of the API via cURL or similar.
Access this resource via the /api/v2/transfers/
endpoint.
Provides a JSON:API representation of Transfer.
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
-
#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 ⇒ String
deprecated
Deprecated.
Use the
source
relationship instead. -
#transfer_template_uuid ⇒ String
writeonly
The UUID of a TransferTemplate to create a transfer from.
-
#transfer_type ⇒ Object
readonly
A filter to restrict the type of transfer to retrieve.
-
#transfers ⇒ Hash
A hash of the transfers made.
-
#user ⇒ UserResource
Setting this relationship alongside the
user_uuid
attribute will override the attribute value. -
#user_uuid ⇒ String
deprecated
Deprecated.
Use the
user
relationship instead. -
#uuid ⇒ String
readonly
The UUID of the transfer.
Class Method Summary collapse
-
.create_with_model(context, model_type) ⇒ TransferResource
The new Transfer resource.
Instance Method Summary collapse
-
#create_with_model ⇒ Object
Create a new Transfer resource with the polymorphic type extracted from a template.
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.
118 |
# File 'app/resources/api/v2/transfer_resource.rb', line 118 has_one :destination |
#destination_uuid ⇒ String, Void
Use the destination
relationship instead.
Setting this attribute alongside the destination
relationship will prefer the relationship value.
26 |
# File 'app/resources/api/v2/transfer_resource.rb', line 26 attribute :destination_uuid |
#source ⇒ LabwareResource
This relationship is required.
The source labware for the transfer. The type of the labware varies by the type of transfer. Setting this relationship alongside the source_uuid
attribute will override the attribute value.
125 |
# File 'app/resources/api/v2/transfer_resource.rb', line 125 has_one :source, class_name: 'Labware' |
#source_uuid ⇒ String
Use the source
relationship instead.
Setting this attribute alongside the source
relationship will prefer the relationship value.
42 |
# File 'app/resources/api/v2/transfer_resource.rb', line 42 attribute :source_uuid |
#transfer_template_uuid=(uuid) ⇒ String (writeonly)
Returns the UUID of a TransferTemplate to create a transfer from. This must be provided or the Transfer creation will raise an error.
78 |
# File 'app/resources/api/v2/transfer_resource.rb', line 78 attribute :transfer_template_uuid, writeonly: true |
#transfer_type ⇒ Object (readonly)
A filter to restrict the type of transfer to retrieve. 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’
88 |
# File 'app/resources/api/v2/transfer_resource.rb', line 88 attribute :transfer_type, delegate: :sti_type, readonly: true |
#transfers ⇒ Hash
Returns a hash of the transfers made. This is usually populated by the TransferTemplate used during creation of the Transfer.
55 |
# File 'app/resources/api/v2/transfer_resource.rb', line 55 attribute :transfers |
#user ⇒ UserResource
This relationship is required.
Setting this relationship alongside the user_uuid
attribute will override the attribute value.
131 |
# File 'app/resources/api/v2/transfer_resource.rb', line 131 has_one :user |
#user_uuid ⇒ String
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.
96 |
# File 'app/resources/api/v2/transfer_resource.rb', line 96 attribute :user_uuid, write_once: true |
#uuid ⇒ String (readonly)
Returns the UUID of the transfer.
108 |
# File 'app/resources/api/v2/transfer_resource.rb', line 108 attribute :uuid, readonly: true |
Class Method Details
.create_with_model(context, model_type) ⇒ TransferResource
Returns The new Transfer resource.
162 163 164 165 |
# File 'app/resources/api/v2/transfer_resource.rb', line 162 def self.create_with_model(context, model_type) # Create the polymorphic type, not the base class. new(model_type.new, context) end |
Instance Method Details
#create_with_model ⇒ Object
Create a new Transfer resource with the polymorphic type extracted from a template. This is called by the controller when a create request for a Transfer is made.
162 163 164 165 |
# File 'app/resources/api/v2/transfer_resource.rb', line 162 def self.create_with_model(context, model_type) # Create the polymorphic type, not the base class. new(model_type.new, context) end |