Class: Api::V2::TubeFromTubeCreationResource
- Inherits:
-
BaseResource
- Object
- JSONAPI::Resource
- BaseResource
- Api::V2::TubeFromTubeCreationResource
- Defined in:
- app/resources/api/v2/tube_from_tube_creation_resource.rb
Overview
This resource cannot be modified after creation: its endpoint will not accept PATCH
requests.
Access this resource via the /api/v2/tube_from_tube_creations/
endpoint.
Provides a JSON:API representation of TubeFromTubeCreation for the creation of a single child tube from a single parent tube. Creation of this resource via a POST
request will create the new child tube with the parent tube as an ancestor. The created child will have the specified purpose and can be accessed via the #child relationship.
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
-
#child ⇒ TubeResource
readonly
The child tube which was created.
-
#child_purpose ⇒ TubePurposeResource
Setting this relationship alongside the
child_purpose_uuid
attribute will override the attribute value. -
#child_purpose_uuid ⇒ Void
writeonly
deprecated
Deprecated.
Use the
child_purpose
relationship instead. -
#parent ⇒ TubeResource
Setting this relationship alongside the
parent_uuid
attribute will override the attribute value. -
#parent_uuid ⇒ Void
writeonly
deprecated
Deprecated.
Use the
parent
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 of the tube from tube creation.
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
#child ⇒ TubeResource (readonly)
Returns The child tube which was created.
109 |
# File 'app/resources/api/v2/tube_from_tube_creation_resource.rb', line 109 has_one :child, class_name: 'Tube', readonly: true |
#child_purpose ⇒ TubePurposeResource
This relationship is required.
Setting this relationship alongside the child_purpose_uuid
attribute will override the attribute value.
115 |
# File 'app/resources/api/v2/tube_from_tube_creation_resource.rb', line 115 has_one :child_purpose, class_name: 'TubePurpose' |
#child_purpose_uuid=(value) ⇒ Void (writeonly)
Use the child_purpose
relationship instead.
This is declared for convenience where child purpose is not available to set as a relationship. Setting this attribute alongside the child_purpose
relationship will prefer the relationship value.
67 |
# File 'app/resources/api/v2/tube_from_tube_creation_resource.rb', line 67 attribute :child_purpose_uuid, writeonly: true |
#parent ⇒ TubeResource
This relationship is required.
Setting this relationship alongside the parent_uuid
attribute will override the attribute value.
121 |
# File 'app/resources/api/v2/tube_from_tube_creation_resource.rb', line 121 has_one :parent, class_name: 'Tube' |
#parent_uuid=(value) ⇒ Void (writeonly)
Use the parent
relationship instead.
This is declared for convenience where parent is not available to set as a relationship. Setting this attribute alongside the parent
relationship will prefer the relationship value.
80 |
# File 'app/resources/api/v2/tube_from_tube_creation_resource.rb', line 80 attribute :parent_uuid, writeonly: true |
#user ⇒ UserResource
This relationship is required.
Setting this relationship alongside the user_uuid
attribute will override the attribute value.
127 |
# File 'app/resources/api/v2/tube_from_tube_creation_resource.rb', line 127 has_one :user, write_once: true |
#user_uuid=(value) ⇒ Void (writeonly)
Use the user
relationship instead.
This is declared for convenience where the user is not available to set as a relationship. Setting this attribute alongside the user
relationship will prefer the relationship value.
93 |
# File 'app/resources/api/v2/tube_from_tube_creation_resource.rb', line 93 attribute :user_uuid, writeonly: true |
#uuid ⇒ String (readonly)
Returns The UUID of the tube from tube creation.
101 |
# File 'app/resources/api/v2/tube_from_tube_creation_resource.rb', line 101 attribute :uuid, readonly: true |