Class: Api::V2::StateChangeResource
- Inherits:
-
BaseResource
- Object
- JSONAPI::Resource
- BaseResource
- Api::V2::StateChangeResource
- Defined in:
- app/resources/api/v2/state_change_resource.rb
Overview
Access this resource via the /api/v2/state_changes/
endpoint.
This resource cannot be modified after creation: its endpoint will not accept PATCH
requests.
Provides a JSON:API representation of StateChange
A StateChange records a transition from one state to another for a piece of labware.
}
For more information about JSON:API see the JSON:API Specifications or look at the JSONAPI::Resources package for Sequencescape's implementation of the JSON:API standard.
Instance Attribute Summary collapse
-
#contents ⇒ Array
Some targets can have “contents” updated (notably plates).
- #customer_accepts_responsibility ⇒ Void writeonly
-
#previous_state ⇒ String
readonly
The state of the target labware before this state change was applied.
-
#reason ⇒ String
The reason provided for the state change.
-
#target ⇒ LabwareResource
Setting this relationship alongside the
target_uuid
attribute will override the attribute value. -
#target_state ⇒ String
The new state to which the target will be transitioned.
-
#target_uuid ⇒ Void
writeonly
deprecated
Deprecated.
Use the
target
relationship instead. -
#user ⇒ UserResource
Setting this relationship alongside the
user_uuid
attribute will override the attribute value. -
#user_uuid ⇒ Void
writeonly
deprecated
Deprecated.
Use the
user
relationship instead. -
#uuid ⇒ String
readonly
The UUID identifier for this state change.
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
#contents ⇒ Array
This is an optional attribute.
Some targets can have “contents” updated (notably plates). The meaning of this is is dealt with by the target being updated.
48 |
# File 'app/resources/api/v2/state_change_resource.rb', line 48 attribute :contents |
#customer_accepts_responsibility=(value) ⇒ Void (writeonly)
54 |
# File 'app/resources/api/v2/state_change_resource.rb', line 54 attribute :customer_accepts_responsibility, writeonly: true |
#previous_state ⇒ String (readonly)
The state of the target labware before this state change was applied.
59 |
# File 'app/resources/api/v2/state_change_resource.rb', line 59 attribute :previous_state, readonly: true |
#reason ⇒ String
The reason provided for the state change. This can be used to explain why the transition occurred.
65 |
# File 'app/resources/api/v2/state_change_resource.rb', line 65 attribute :reason |
#target ⇒ LabwareResource
This relationship is required.
Setting this relationship alongside the target_uuid
attribute will override the attribute value.
119 |
# File 'app/resources/api/v2/state_change_resource.rb', line 119 has_one :target, class_name: 'Labware' |
#target_state ⇒ String
This attribute is required.
The new state to which the target will be transitioned.
71 |
# File 'app/resources/api/v2/state_change_resource.rb', line 71 attribute :target_state |
#target_uuid=(value) ⇒ Void (writeonly)
Use the target
relationship instead.
This is provided as a shortcut for setting the target
relationship. If both this attribute and the target
relationship are provided, the relationship takes precedence.
80 |
# File 'app/resources/api/v2/state_change_resource.rb', line 80 attribute :target_uuid, writeonly: true |
#user ⇒ UserResource
This relationship is required.
Setting this relationship alongside the user_uuid
attribute will override the attribute value.
113 |
# File 'app/resources/api/v2/state_change_resource.rb', line 113 has_one :user |
#user_uuid=(value) ⇒ Void (writeonly)
Use the user
relationship instead.
This is provided as a shortcut for setting the user
relationship. If both this attribute and the user
relationship are provided, the relationship takes precedence.
93 |
# File 'app/resources/api/v2/state_change_resource.rb', line 93 attribute :user_uuid, writeonly: true |
#uuid ⇒ String (readonly)
This identifier is automatically assigned upon creation and cannot be modified.
The UUID identifier for this state change.
103 |
# File 'app/resources/api/v2/state_change_resource.rb', line 103 attribute :uuid, readonly: true |