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

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

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.

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_atString (readonly)

Returns the creation time of the library.

Returns:

  • (String)

    the creation time of the library



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

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



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

attributes :created_at, :libraries_attributes

Instance Method Details

#fetchable_fieldsObject



66
67
68
# File 'app/resources/v1/pacbio/library_batch_resource.rb', line 66

def fetchable_fields
  super - [:libraries_attributes]
end

#publish_volume_tracking_messagesObject



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

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