Class: Api::V2::PooledPlateCreationResource

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

Overview

Note:

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

Note:

This resource cannot be modified after creation: its endpoint will not accept PATCH requests.

Provides a JSON:API representation of PooledPlateCreation.

This resource represents the creation of a pooled plate from one or more parent plates.

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 retrieve all pooled plate creations

GET /api/v2/pooled_plate_creation/

GET request to retrieve a specific pooled plate creation

GET /api/v2/pooled_plate_creation/123

POST request with attributes specified by UUID (deprecated)

POST /api/v2/pooled_plate_creation/
{
  "data": {
    "type": "pooled_plate_creation",
    "attributes": {
      "child_purpose_uuid": "uuid-of-child-purpose",
      "parent_uuids": ["uuid-of-parent-1", "uuid-of-parent-2"],
      "user_uuid": "uuid-of-user"
    }
  }
}

POST request to create a pooled plate using relationships

POST /api/v2/pooled_plate_creation/
{
  "data": {
    "type": "pooled_plate_creations",
    "attributes": {
      "child_purpose_uuid": ["f64dec80-f51c-11ef-8842-000000000000"]
    },
    "relationships": {
      "parents": {
        "data": [
          { "type": "labware", "id": 1 },
          { "type": "labware", "id": 4 }
        ]
      },
      "user": {
        "data": { "type": "users", "id": 1 }
      }
    }
  }
}

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

#childPlateResource (readonly)

The plate that was created from the pooling process.

Returns:



116
# File 'app/resources/api/v2/pooled_plate_creation_resource.rb', line 116

has_one :child, class_name: 'Plate', readonly: true

#child_purpose_uuid=(value) ⇒ Void (writeonly)

TODO:

deprecate this attribute in favour of the child_purpose relationship.

The UUID of the child purpose, which determines the type of plate being created.

Parameters:

  • value (String)

    or String - The UUID of a child purpose.

Returns:

  • (Void)


66
# File 'app/resources/api/v2/pooled_plate_creation_resource.rb', line 66

attribute :child_purpose_uuid, writeonly: true

#parent_uuids=(value) ⇒ Void (writeonly)

Deprecated.

Use the parents relationship instead.

This is declared for convenience where parents are not available to set as a relationship. This attribute is optional if the parents relationship is explicitly set. If both parent_uuids and parents are provided, parents takes precedence.

Parameters:

  • value (Array<String>)

    UUIDs of the parent labware.

Returns:

  • (Void)

See Also:



76
# File 'app/resources/api/v2/pooled_plate_creation_resource.rb', line 76

attribute :parent_uuids, writeonly: true

#parentsArray<LabwareResource>

The labware used as the source for the pooled plate. If both parent_uuids and parents are provided, parents takes precedence.

Returns:



122
# File 'app/resources/api/v2/pooled_plate_creation_resource.rb', line 122

has_many :parents, class_name: 'Labware'

#userUserResource

The user who initiated the pooled plate creation. If both user_uuid and user are provided, user takes precedence.

Returns:



128
# File 'app/resources/api/v2/pooled_plate_creation_resource.rb', line 128

has_one :user

#user_uuid=(value) ⇒ Object (writeonly)

Getters and Setters



86
# File 'app/resources/api/v2/pooled_plate_creation_resource.rb', line 86

attribute :user_uuid, writeonly: true

#uuidString (readonly)

Note:

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

Returns This uniquely identifies the pooled plate creation event.

Returns:

  • (String)

    This uniquely identifies the pooled plate creation event.



91
# File 'app/resources/api/v2/pooled_plate_creation_resource.rb', line 91

attribute :uuid, readonly: true