Class: Api::V2::TransferRequestCollectionResource
- Inherits:
-
BaseResource
- Object
- JSONAPI::Resource
- BaseResource
- Api::V2::TransferRequestCollectionResource
- Defined in:
- app/resources/api/v2/transfer_request_collection_resource.rb
Overview
Access this resource via the /api/v2/transfer_request_collections/
endpoint.
This resource cannot be modified after creation: its endpoint will not accept PATCH
requests.
Provides a JSON:API representation of TransferRequestCollection
A TransferRequestCollection provides a means of bulk creating transfer requests between arbitrary sources and destinations. This resource allows the creation of a collection of transfer requests in a single transaction, avoiding multiple server calls for each transfer request.
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
-
#target_tubes ⇒ Array<TubeResource>
readonly
in this collection.
-
#transfer_requests ⇒ Array<TransferRequestResource>
readonly
An array of transfer requests within this collection.
-
#transfer_requests_attributes ⇒ Void
writeonly
deprecated
Deprecated.
Use the
transfer_requests
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 transfer request collection.
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
#target_tubes ⇒ Array<TubeResource> (readonly)
in this collection.
115 |
# File 'app/resources/api/v2/transfer_request_collection_resource.rb', line 115 has_many :target_tubes, class_name: 'Tube', readonly: true |
#transfer_requests ⇒ Array<TransferRequestResource> (readonly)
Returns An array of transfer requests within this collection.
119 |
# File 'app/resources/api/v2/transfer_request_collection_resource.rb', line 119 has_many :transfer_requests, readonly: true |
#transfer_requests_attributes=(value) ⇒ Void (writeonly)
Use the transfer_requests
relationship instead.
To enable the creation of TransferRequest records server side in a single transaction, the attributes for transfer requests to be included in the collection can be passed as an array of hashes. These will be created at the same time as the TransferRequestCollection to avoid making multiple server calls.
81 |
# File 'app/resources/api/v2/transfer_request_collection_resource.rb', line 81 attribute :transfer_requests_attributes, writeonly: true |
#user ⇒ UserResource
This relationship is required.
Setting this relationship alongside the user_uuid
attribute will override the attribute value.
125 |
# File 'app/resources/api/v2/transfer_request_collection_resource.rb', line 125 has_one :user |
#user_uuid=(value) ⇒ Void (writeonly)
Use the user
relationship instead.
Declared for convenience when the user is not available to set as a relationship. Setting this attribute alongside the user
relationship will prefer the relationship value.
97 |
# File 'app/resources/api/v2/transfer_request_collection_resource.rb', line 97 attribute :user_uuid, writeonly: true |
#uuid ⇒ String (readonly)
This identifier is automatically assigned upon creation and cannot be modified.
Returns The UUID of the transfer request collection.
106 |
# File 'app/resources/api/v2/transfer_request_collection_resource.rb', line 106 attribute :uuid, readonly: true |