Class: Api::V2::TagGroupResource
- Inherits:
-
BaseResource
- Object
- JSONAPI::Resource
- BaseResource
- Api::V2::TagGroupResource
- Defined in:
- app/resources/api/v2/tag_group_resource.rb
Overview
The below POST example is provided for reference, however it currently throws an error.
Access this resource via the /api/v2/tag_groups/
endpoint.
Provides a JSON:API representation of TagGroup A TagGroup represents a set of tags used in sequencing.
A Tag is a short, know sequence of DNA which gets applied to a sample. The tag remains attached through subsequent processing, and means that it is possible to identify the origin of a sample if multiple samples are subsequently pooled together.
This is because the example format of the tags
attribute are not permitted.
For more information about JSON:API, see the JSON:API Specifications or refer to JSONAPI::Resources for Sequencescape's implementation.
Instance Attribute Summary collapse
-
#name ⇒ String
The name of the tag group.
-
#tag_group_adapter_type ⇒ TagGroupAdapterTypeResource
The adapter type associated with this tag group.
-
#tags ⇒ Array<Hash>
Returns the list of tags sorted by their index.
-
#uuid ⇒ String
readonly
The UUID of the tag group.
Instance Method Summary collapse
-
#filter_by_name ⇒ String
Filters tag groups by their name.
-
#filter_by_tag_group_adapter_type_name ⇒ String
Filters tag groups by their adapter type name.
-
#filter_by_visible ⇒ Boolean
Filters tag groups based on visibility.
Methods inherited from BaseResource
apply_includes, creatable_fields, default_includes, #fetchable_fields, inclusions, resolve_relationship_names_to_relations, updatable_fields
Instance Attribute Details
#name ⇒ String
The name of the tag group. This attribute is required when creating a new tag group.
63 |
# File 'app/resources/api/v2/tag_group_resource.rb', line 63 attribute :name, write_once: true |
#tag_group_adapter_type ⇒ TagGroupAdapterTypeResource
This relationship is required
The adapter type associated with this tag group. This defines how the tags are used within a sequencing workflow.
79 80 81 82 |
# File 'app/resources/api/v2/tag_group_resource.rb', line 79 has_one :tag_group_adapter_type, foreign_key: :adapter_type_id, write_once: true, class_name: 'TagGroupAdapterType' |
#tags ⇒ Array<Hash>
Returns the list of tags sorted by their index.
68 |
# File 'app/resources/api/v2/tag_group_resource.rb', line 68 attribute :tags, write_once: true |
#uuid ⇒ String (readonly)
This identifier is automatically assigned upon creation and cannot be modified.
Returns The UUID of the tag group.
57 |
# File 'app/resources/api/v2/tag_group_resource.rb', line 57 attribute :uuid, readonly: true |
Instance Method Details
#filter_by_name ⇒ String
Returns Filters tag groups by their name.
98 |
# File 'app/resources/api/v2/tag_group_resource.rb', line 98 filter :name |
#filter_by_tag_group_adapter_type_name ⇒ String
Returns Filters tag groups by their adapter type name.
104 |
# File 'app/resources/api/v2/tag_group_resource.rb', line 104 filter :tag_group_adapter_type_name, apply: ->(records, value, ) { records.by_adapter_type(value) } |
#filter_by_visible ⇒ Boolean
Returns Filters tag groups based on visibility.
92 |
# File 'app/resources/api/v2/tag_group_resource.rb', line 92 filter :visible, default: true |