Class: V1::Pacbio::LibraryBatchResource

Inherits:
JSONAPI::Resource
  • Object
show all
Defined in:
app/resources/v1/pacbio/library_batch_resource.rb

Overview

Note:

Access this resource via the /v1/pacbio/library_batches/ endpoint. To return the libraries created, add libraries to the include. To return the created libraries tubes add libraries.tube to the include. For example /v1/pacbio/library_batches?include=libraries.tube

This resource is used to create batches of libraries in one go. This resource can only be accessed via a POST request to the library_batches endpoint.

Provides a JSON:API representation of Pacbio::LibraryBatch.

For more information about JSON:API see the JSON:API Specifications or look at the JSONAPI::Resources package for the service implementation of the JSON:API standard.

Examples:

{
   "data": {
     "type": "library_batches",
     "attributes": {
       "libraries_attributes": [
         {
           "volume": 50.2,
           "concentration": 2.222,
           "template_prep_kit_box_barcode": "LK1234567",
           "insert_size": 100,
           "pacbio_request_id": 1,
           "tag_id": 1,
           "primary_aliquot_attributes": {
             "volume": 50.2,
             "concentration": 2.222,
             "template_prep_kit_box_barcode": "LK1234567",
             "insert_size": 100,
             "tag_id": 1
           },
         }
       ]
     }
 }

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#created_at=(value) ⇒ String (writeonly)

Returns the creation time of the library.

Returns:

  • (String)

    the creation time of the library



52
# File 'app/resources/v1/pacbio/library_batch_resource.rb', line 52

attributes :created_at, :libraries_attributes

#libraries_attributes=(libraries_attributes_parameters) ⇒ Array (writeonly)

Returns the attributes of the libraries.

Returns:

  • (Array)

    the attributes of the libraries



52
# File 'app/resources/v1/pacbio/library_batch_resource.rb', line 52

attributes :created_at, :libraries_attributes

Instance Method Details

#fetchable_fieldsObject



70
71
72
# File 'app/resources/v1/pacbio/library_batch_resource.rb', line 70

def fetchable_fields
  super - [:libraries_attributes]
end

#publish_volume_tracking_messagesObject



74
75
76
77
78
79
# File 'app/resources/v1/pacbio/library_batch_resource.rb', line 74

def publish_volume_tracking_messages
  @model.libraries.each do |library|
    Emq::Publisher.publish([library.primary_aliquot, *library.used_aliquots],
                           Pipelines.pacbio, 'volume_tracking')
  end
end