Class: V1::Pacbio::ContainerMaterialResource

Inherits:
JSONAPI::Resource
  • Object
show all
Defined in:
app/resources/v1/pacbio/container_material_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:

Access this resource via the /v1/pacbio/container_material/ endpoint.

Provides a JSON:API representation of ContainerMaterial.

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.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#barcodeObject

Delegations to container



62
# File 'app/resources/v1/pacbio/container_material_resource.rb', line 62

attributes :barcode, :created_at, :material_type

#concentrationFloat

Returns the concentration of the library.

Returns:

  • (Float)

    the concentration of the library



34
35
# File 'app/resources/v1/pacbio/container_material_resource.rb', line 34

attributes :state, :insert_size, :volume, :concentration,
:template_prep_kit_box_barcode, :deactivated_at, :sample_names

#cost_codeString

Returns the cost code for the library.

Returns:

  • (String)

    the cost code for the library



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

attributes :library_type, :estimate_of_gb_required, :number_of_smrt_cells, :cost_code,
:external_study_id, :sample_name, :sample_species

#created_atString

Returns the creation time of the container.

Returns:

  • (String)

    the creation time of the container



62
# File 'app/resources/v1/pacbio/container_material_resource.rb', line 62

attributes :barcode, :created_at, :material_type

#deactivated_atDateTime?

Returns the deactivation time of the library, or nil if not deactivated.

Returns:

  • (DateTime, nil)

    the deactivation time of the library, or nil if not deactivated



34
35
# File 'app/resources/v1/pacbio/container_material_resource.rb', line 34

attributes :state, :insert_size, :volume, :concentration,
:template_prep_kit_box_barcode, :deactivated_at, :sample_names

#estimate_of_gb_requiredFloat

Returns the estimated gigabytes required for the library.

Returns:

  • (Float)

    the estimated gigabytes required for the library



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

attributes :library_type, :estimate_of_gb_required, :number_of_smrt_cells, :cost_code,
:external_study_id, :sample_name, :sample_species

#external_study_idString

Returns the external study ID for the library.

Returns:

  • (String)

    the external study ID for the library



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

attributes :library_type, :estimate_of_gb_required, :number_of_smrt_cells, :cost_code,
:external_study_id, :sample_name, :sample_species

#insert_sizeInteger

Returns the insert size of the library.

Returns:

  • (Integer)

    the insert size of the library



34
35
# File 'app/resources/v1/pacbio/container_material_resource.rb', line 34

attributes :state, :insert_size, :volume, :concentration,
:template_prep_kit_box_barcode, :deactivated_at, :sample_names

#library_typeString

Returns the type of the library.

Returns:

  • (String)

    the type of the library



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

attributes :library_type, :estimate_of_gb_required, :number_of_smrt_cells, :cost_code,
:external_study_id, :sample_name, :sample_species

#material_typeString

Returns the type of material in the container.

Returns:

  • (String)

    the type of material in the container



62
# File 'app/resources/v1/pacbio/container_material_resource.rb', line 62

attributes :barcode, :created_at, :material_type

#number_of_smrt_cellsInteger

Returns the number of SMRT cells required for the library.

Returns:

  • (Integer)

    the number of SMRT cells required for the library



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

attributes :library_type, :estimate_of_gb_required, :number_of_smrt_cells, :cost_code,
:external_study_id, :sample_name, :sample_species

#sample_nameString

Returns the name of the sample in the library.

Returns:

  • (String)

    the name of the sample in the library



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

attributes :library_type, :estimate_of_gb_required, :number_of_smrt_cells, :cost_code,
:external_study_id, :sample_name, :sample_species

#sample_namesObject

TODO: Moved here as dropped it from library, but this should probably become sample name. But overall, not really convinced this model should be exposed via the API.



34
35
# File 'app/resources/v1/pacbio/container_material_resource.rb', line 34

attributes :state, :insert_size, :volume, :concentration,
:template_prep_kit_box_barcode, :deactivated_at, :sample_names

#sample_speciesString

Returns the species of the sample in the library.

Returns:

  • (String)

    the species of the sample in the library



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

attributes :library_type, :estimate_of_gb_required, :number_of_smrt_cells, :cost_code,
:external_study_id, :sample_name, :sample_species

#stateString

Returns the state of the library.

Returns:

  • (String)

    the state of the library



34
35
# File 'app/resources/v1/pacbio/container_material_resource.rb', line 34

attributes :state, :insert_size, :volume, :concentration,
:template_prep_kit_box_barcode, :deactivated_at, :sample_names

#template_prep_kit_box_barcodeString

Returns the barcode of the template prep kit box.

Returns:

  • (String)

    the barcode of the template prep kit box



34
35
# File 'app/resources/v1/pacbio/container_material_resource.rb', line 34

attributes :state, :insert_size, :volume, :concentration,
:template_prep_kit_box_barcode, :deactivated_at, :sample_names

#volumeFloat

Returns the volume of the library.

Returns:

  • (Float)

    the volume of the library



34
35
# File 'app/resources/v1/pacbio/container_material_resource.rb', line 34

attributes :state, :insert_size, :volume, :concentration,
:template_prep_kit_box_barcode, :deactivated_at, :sample_names

Class Method Details

.records_for_populate(*_args) ⇒ Object



77
78
79
# File 'app/resources/v1/pacbio/container_material_resource.rb', line 77

def self.records_for_populate(*_args)
  super.preload(:container, material: %i[material_type sample])
end

Instance Method Details

#fetchable_fieldsObject



64
65
66
67
68
69
70
71
72
73
74
75
# File 'app/resources/v1/pacbio/container_material_resource.rb', line 64

def fetchable_fields
  case @model.material
  when ::Pacbio::Library
    %i[state barcode volume concentration template_prep_kit_box_barcode insert_size
       created_at deactivated_at sample_names material_type]
  when ::Pacbio::Request
    %i[library_type estimate_of_gb_required number_of_smrt_cells cost_code external_study_id
       sample_name barcode sample_species created_at material_type]
  else
    super
  end
end