Class: Api::V2::ProjectResource

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

Overview

Note:

This resource is immutable: it does not accept POST, PATCH, or DELETE requests.

Note:

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

Provides a JSON:API representation of Project.

A Project represents a defined research or sequencing initiative within the system. It holds the cost code, for billing.

For more details on JSON:API, see the JSON:API Specifications or check out the JSONAPI::Resources package for Sequencescape's implementation.

Examples:

Fetching all projects

GET /api/v2/projects

Fetching a project by ID

GET /api/v2/projects/{id}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseResource

apply_includes, creatable_fields, default_includes, #fetchable_fields, inclusions, resolve_relationship_names_to_relations, updatable_fields

Instance Attribute Details

#cost_codeString

The financial cost code associated with the project. This is delegated to project_cost_code in the underlying model.

Returns:

  • (String)


39
# File 'app/resources/api/v2/project_resource.rb', line 39

attribute :cost_code, delegate: :project_cost_code

#nameString

The name of the project.

Returns:

  • (String)


33
# File 'app/resources/api/v2/project_resource.rb', line 33

attribute :name

#uuidString (readonly)

Note:

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

Returns The universally unique identifier (UUID) of project.

Returns:

  • (String)

    The universally unique identifier (UUID) of project.



44
# File 'app/resources/api/v2/project_resource.rb', line 44

attribute :uuid, readonly: true

Instance Method Details

#filter_by_nameObject

Allows filtering projects by name.

Examples:

Fetching projects by name

GET /api/v2/projects?filter[name]=Example


54
# File 'app/resources/api/v2/project_resource.rb', line 54

filter :name