Class: Api::V2::LotTypeResource

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

Overview

Note:

This resource is immutable: its endpoint will not accept POST, PATCH, or DELETE requests.

Note:

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

Provides a JSON:API representation of LotType.

A LotType governs the behaviour of a Lot

For more information about JSON:API, see the JSON:API Specifications or the JSONAPI::Resources package for Sequencescape's implementation of the JSON:API standard.

Examples:

GET request to fetch all lot types

GET /api/v2/lot_types/

GET request to fetch a specific lot type by ID

GET /api/v2/lot_types/123/

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

#nameString

TODO:

This resource is immutable; Update attribute to be read-only.

Note:

This attribute must be unique.

The name of this lot type

Returns:

  • (String)

    The lot type name.



41
# File 'app/resources/api/v2/lot_type_resource.rb', line 41

attribute :name, write_once: true

#target_purposePurposeResource

TODO:

This resource is immutable; Update relationship to be read-only.

The Purpose that this lot type is associated with

Returns:



58
# File 'app/resources/api/v2/lot_type_resource.rb', line 58

has_one :target_purpose, write_once: true, class_name: 'Purpose'

#template_typeString

Retrieves the template type based on the internal class name.

Returns:

  • (String)

    The template type e.g 'tag_layout_template'



48
# File 'app/resources/api/v2/lot_type_resource.rb', line 48

attribute :template_type, write_once: true

#uuidString (readonly)

Note:

This identifier is automatically assigned upon creation and cannot be modified.

Returns The universally unique identifier (UUID) of the lot type.

Returns:

  • (String)

    The universally unique identifier (UUID) of the lot type.



34
# File 'app/resources/api/v2/lot_type_resource.rb', line 34

attribute :uuid, readonly: true