Class: Api::V2::TransferRequestCollectionResource

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

Overview

TODO:

This documentation does not yet include a detailed description of what this resource represents.

TODO:

This documentation does not yet include detailed descriptions for relationships, attributes and filters.

TODO:

This documentation does not yet include any example usage of the API via cURL or similar.

Note:

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

Note:

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

Provides a JSON:API representation of TransferRequestCollection.

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

Method Summary

Methods inherited from BaseResource

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

Instance Attribute Details

#target_tubesArray<TubeResource> (readonly)

Returns An array of tubes targeted by the transfer requests in this collection.

Returns:

  • (Array<TubeResource>)

    An array of tubes targeted by the transfer requests in this collection.



71
# File 'app/resources/api/v2/transfer_request_collection_resource.rb', line 71

has_many :target_tubes, class_name: 'Tube', readonly: true

#transfer_requestsArray<TransferRequestResource> (readonly)

Returns An array of transfer requests in this collection.

Returns:



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

has_many :transfer_requests, readonly: true

#transfer_requests_attributes=(value) ⇒ Void (writeonly)

To enable the creation of TransferRequest records server side in a single transaction, the attributes for transfer requests to be included in the collection can be passed as an array of hashes. These will be created at the same time as the TransferRequestCollection to avoid making multiple server calls.

Examples:

Hashes should contain the following data about each transfer request

{
  'source_asset': 'The UUID of the source asset as a string.',
  'target_asset': 'The UUID of the destination asset as a string.',
  'aliquot_attributes': {
    'tag_depth': 'The tag depth of the source as a string.'
  }
}

Parameters:

  • value (Array<Hash>)

    An array of hashes containing the attributes for transfer request to be created.

Returns:

  • (Void)

See Also:



39
# File 'app/resources/api/v2/transfer_request_collection_resource.rb', line 39

attribute :transfer_requests_attributes, writeonly: true

#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 the pooled plate.



81
# File 'app/resources/api/v2/transfer_request_collection_resource.rb', line 81

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 this pooled plate.

Returns:

  • (Void)

See Also:



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

attribute :user_uuid, writeonly: true

#uuidString (readonly)

Returns The UUID of the state change.

Returns:

  • (String)

    The UUID of the state change.



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

attribute :uuid, readonly: true