Class: V1::Pacbio::RequestResource

Inherits:
JSONAPI::Resource
  • Object
show all
Includes:
Shared::SourceIdentifierFilterable
Defined in:
app/resources/v1/pacbio/request_resource.rb

Overview

Relationship trees:

  • well.plate

  • plate.wells

  • tube.requests

Examples:

curl -X GET http://localhost:3100/v1/pacbio/requests/
curl -X GET http://localhost:3100/v1/pacbio/requests/1
curl -X GET http://localhost:3100/v1/pacbio/requests/1?include=well,plate,tube

curl -X GET http://localhost:3100/v1/pacbio/requests?filter[sample_name]=sample_name
curl -X GET http://localhost:3100/v1/pacbio/requests?filter[species]=species
curl -X GET http://localhost:3100/v1/pacbio/requests?filter[source_identifier]=TRAC-2-12068

curl -X PATCH http://localhost:3100/v1/pacbio/requests/1 \
  -H "Content-Type: application/vnd.api+json" \
  -H "Accept: application/vnd.api+json" \
  -d '{
    "data": {
      "type": "requests",
      "id": "1",
      "attributes": {
        "cost_code": "new_cost_code"
      }
    }
  }'

Direct Known Subclasses

V1::Pacbio::Runs::RequestResource

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#barcodeString (readonly)

Returns the barcode of the sample.

Returns:

  • (String)

    the barcode of the sample



83
84
85
# File 'app/resources/v1/pacbio/request_resource.rb', line 83

attributes :sample_name, :barcode, :sample_species,
:created_at, :source_identifier, :sample_retention_instruction,
readonly: true

#cost_codeString

Returns the cost code.

Returns:

  • (String)

    the cost code



69
# File 'app/resources/v1/pacbio/request_resource.rb', line 69

attributes(*::Pacbio.request_attributes)

#created_atString (readonly)

Returns the creation time of the request.

Returns:

  • (String)

    the creation time of the request



83
84
85
# File 'app/resources/v1/pacbio/request_resource.rb', line 83

attributes :sample_name, :barcode, :sample_species,
:created_at, :source_identifier, :sample_retention_instruction,
readonly: true

#estimate_of_gb_requiredFloat

Returns the estimated gigabytes required.

Returns:

  • (Float)

    the estimated gigabytes required



69
# File 'app/resources/v1/pacbio/request_resource.rb', line 69

attributes(*::Pacbio.request_attributes)

#external_study_idString

Returns the external study ID.

Returns:

  • (String)

    the external study ID



69
# File 'app/resources/v1/pacbio/request_resource.rb', line 69

attributes(*::Pacbio.request_attributes)

#library_typeString

Returns the type of the library.

Returns:

  • (String)

    the type of the library



69
# File 'app/resources/v1/pacbio/request_resource.rb', line 69

attributes(*::Pacbio.request_attributes)

#number_of_smrt_cellsInteger

Returns the number of SMRT cells.

Returns:

  • (Integer)

    the number of SMRT cells



69
# File 'app/resources/v1/pacbio/request_resource.rb', line 69

attributes(*::Pacbio.request_attributes)

#sample_nameString (readonly)

Returns the name of the sample.

Returns:

  • (String)

    the name of the sample



83
84
85
# File 'app/resources/v1/pacbio/request_resource.rb', line 83

attributes :sample_name, :barcode, :sample_species,
:created_at, :source_identifier, :sample_retention_instruction,
readonly: true

#sample_retention_instrctionString (readonly)

Returns the retention instruction of the request.

Returns:

  • (String)

    the retention instruction of the request



83
84
85
# File 'app/resources/v1/pacbio/request_resource.rb', line 83

attributes :sample_name, :barcode, :sample_species,
:created_at, :source_identifier, :sample_retention_instruction,
readonly: true

#sample_speciesString (readonly)

Returns the species of the sample.

Returns:

  • (String)

    the species of the sample



83
84
85
# File 'app/resources/v1/pacbio/request_resource.rb', line 83

attributes :sample_name, :barcode, :sample_species,
:created_at, :source_identifier, :sample_retention_instruction,
readonly: true

#source_identifierString (readonly)

Returns the source identifier of the request.

Returns:

  • (String)

    the source identifier of the request



83
84
85
# File 'app/resources/v1/pacbio/request_resource.rb', line 83

attributes :sample_name, :barcode, :sample_species,
:created_at, :source_identifier, :sample_retention_instruction,
readonly: true

Class Method Details

.default_sortObject



113
114
115
# File 'app/resources/v1/pacbio/request_resource.rb', line 113

def self.default_sort
  [{ field: 'created_at', direction: :desc }]
end

.records_for_populate(*_args) ⇒ Object



129
130
131
# File 'app/resources/v1/pacbio/request_resource.rb', line 129

def self.records_for_populate(*_args)
  super.preload(:sample, :tube, well: :plate)
end

Instance Method Details

#publish_messagesObject



133
134
135
# File 'app/resources/v1/pacbio/request_resource.rb', line 133

def publish_messages
  Messages.publish(@model.sequencing_runs, Pipelines.pacbio.message)
end