Class: Api::V2::OrderResource
- Inherits:
-
BaseResource
- Object
- JSONAPI::Resource
- BaseResource
- Api::V2::OrderResource
- Defined in:
- app/resources/api/v2/order_resource.rb
Overview
This resource cannot be modified after creation: its endpoint will not accept PATCH
requests.
Access this resource via the /api/v2/orders/
endpoint.
For more information about JSON:API see the JSON:API Specifications or refer to the JSONAPI::Resources package for Sequencescape's implementation.
Instance Attribute Summary collapse
-
#order_type ⇒ String
readonly
The Single Table Inheritance (STI) type of the Order.
-
#project ⇒ ProjectResource
readonly
The project associated with this Order.
-
#request_options ⇒ Hash
readonly
Request options for the Order.
-
#request_types ⇒ Array<Integer>
readonly
The IDs of request types associated with this Order.
-
#study ⇒ StudyResource
readonly
The study associated with this Order.
-
#submission_template_attributes ⇒ Object
writeonly
Not stored, consumed by OrderProcessor.
-
#submission_template_uuid ⇒ Object
writeonly
Not stored, consumed by OrderProcessor.
-
#user ⇒ UserResource
readonly
The user who created this Order.
-
#uuid ⇒ String
readonly
The UUID of this Order.
Class Method Summary collapse
-
.create(context) ⇒ OrderResource
Handles the creation of an Order using the specified template.
Methods inherited from BaseResource
apply_includes, creatable_fields, default_includes, #fetchable_fields, inclusions, resolve_relationship_names_to_relations, updatable_fields
Instance Attribute Details
#order_type ⇒ String (readonly)
Returns The Single Table Inheritance (STI) type of the Order.
62 |
# File 'app/resources/api/v2/order_resource.rb', line 62 attribute :order_type, delegate: :sti_type, readonly: true |
#project ⇒ ProjectResource (readonly)
This can only be set once upon creation.
Returns The project associated with this Order.
85 |
# File 'app/resources/api/v2/order_resource.rb', line 85 has_one :project, readonly: true |
#request_options ⇒ Hash (readonly)
These can only be set upon creation.
Returns Request options for the Order.
67 |
# File 'app/resources/api/v2/order_resource.rb', line 67 attribute :request_options, readonly: true |
#request_types ⇒ Array<Integer> (readonly)
These can only be set upon creation.
Returns The IDs of request types associated with this Order.
72 |
# File 'app/resources/api/v2/order_resource.rb', line 72 attribute :request_types, readonly: true |
#study ⇒ StudyResource (readonly)
This can only be set once upon creation.
Returns The study associated with this Order.
90 |
# File 'app/resources/api/v2/order_resource.rb', line 90 has_one :study, readonly: true |
#submission_template_attributes=(value) ⇒ Object (writeonly)
Not stored, consumed by OrderProcessor.
124 |
# File 'app/resources/api/v2/order_resource.rb', line 124 attribute :submission_template_attributes, writeonly: true |
#submission_template_uuid=(value) ⇒ Object (writeonly)
Not stored, consumed by OrderProcessor.
104 |
# File 'app/resources/api/v2/order_resource.rb', line 104 attribute :submission_template_uuid, writeonly: true |
#user ⇒ UserResource (readonly)
This can only be set once upon creation.
Returns The user who created this Order.
95 |
# File 'app/resources/api/v2/order_resource.rb', line 95 has_one :user, readonly: true |
#uuid ⇒ String (readonly)
Returns The UUID of this Order.
76 |
# File 'app/resources/api/v2/order_resource.rb', line 76 attribute :uuid, readonly: true |
Class Method Details
.create(context) ⇒ OrderResource
Handles the creation of an Order using the specified template.
131 132 133 134 135 136 |
# File 'app/resources/api/v2/order_resource.rb', line 131 def self.create(context) return super if context[:template].nil? order = context[:template].create_order!(context[:template_attributes]) new(order, context) end |