Class: V1::TagResource

Inherits:
JSONAPI::Resource
  • Object
show all
Defined in:
app/resources/v1/tag_resource.rb

Overview

Note:

Access this resource via the /v1/tags endpoint.

Note:

Tags should not be destroyed via the API; use the active attribute on tag sets

Provides a JSON:API representation of Tag.

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.

Primary relationships: * tag_set TagSetResource - The tag set this tag belongs to.

curl -X PATCH “localhost:3100/v1/tags/1” \ -H “accept: application/vnd.api+json” \ -H “Content-Type: application/vnd.api+json” \ -d ‘{ “data”: { “type”: “tags”, “id”: “1”, “attributes”: { “oligo”: “TGCAACGT” } } }’

to deactivate tags instead.

Examples:

curl -X GET http://localhost:3100/v1/tags/1
curl -X GET http://localhost:3100/v1/tags/
curl -X GET http://localhost:3100/v1/tags/1?include=tag_set

curl -X POST "http://localhost:3100/v1/tags" \
  -H "accept: application/vnd.api+json" \
  -H "Content-Type: application/vnd.api+json" \
  -d '{
    "data": {
      "type": "tags",
      "attributes": {
        "oligo": "ACGTACGT",
        "oligo_reverse": "TGCATGCA",
        "group_id": 1,
        "tag_set_id": 1
      }
    }
  }'

Instance Attribute Summary collapse

Instance Attribute Details

#group_idInteger

Returns the ID of the group.

Returns:

  • (Integer)

    the ID of the group



57
# File 'app/resources/v1/tag_resource.rb', line 57

attributes :oligo, :oligo_reverse, :group_id, :tag_set_id

#oligoString

Returns the oligo sequence.

Returns:

  • (String)

    the oligo sequence



57
# File 'app/resources/v1/tag_resource.rb', line 57

attributes :oligo, :oligo_reverse, :group_id, :tag_set_id

#tag_set_idInteger

Returns the ID of the tag set.

Returns:

  • (Integer)

    the ID of the tag set



57
# File 'app/resources/v1/tag_resource.rb', line 57

attributes :oligo, :oligo_reverse, :group_id, :tag_set_id