Class: Api::V2::AssetAuditResource
- Inherits:
-
BaseResource
- Object
- JSONAPI::Resource
- BaseResource
- Api::V2::AssetAuditResource
- Defined in:
- app/resources/api/v2/asset_audit_resource.rb
Overview
This resource cannot be modified after creation: its endpoint will not accept PATCH
requests.
Access this resource via the /api/v2/asset_audits/
endpoint.
Provides a JSON:API representation of AssetAudit, which records audit events related to assets.
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
-
#asset_uuid ⇒ String
Transforms the Asset into its UUID when generating an API query response.
-
#created_by ⇒ String
writeonly
The user who created the asset audit.
-
#key ⇒ String
writeonly
The key of the asset audit event.
-
#message ⇒ String
writeonly
The message describing the audit event.
-
#metadata ⇒ Hash
writeonly
Additional metadata associated with the asset audit.
-
#witnessed_by ⇒ String
writeonly
The user who witnessed the asset audit.
Class Method Summary collapse
-
.updatable_fields(_context) ⇒ Object
Gets the list of fields that are updatable on an existing AssetAudit.
Methods inherited from BaseResource
apply_includes, creatable_fields, default_includes, #fetchable_fields, inclusions, resolve_relationship_names_to_relations
Instance Attribute Details
#asset_uuid ⇒ String
Transforms the Asset into its UUID when generating an API query response.
90 91 92 |
# File 'app/resources/api/v2/asset_audit_resource.rb', line 90 def asset_uuid @model.asset.uuid end |
#created_by=(value) ⇒ String (writeonly)
Returns The user who created the asset audit.
55 |
# File 'app/resources/api/v2/asset_audit_resource.rb', line 55 attribute :created_by |
#key=(value) ⇒ String (writeonly)
This field is required.
Returns The key of the asset audit event.
45 |
# File 'app/resources/api/v2/asset_audit_resource.rb', line 45 attribute :key |
#message=(value) ⇒ String (writeonly)
Returns The message describing the audit event.
50 |
# File 'app/resources/api/v2/asset_audit_resource.rb', line 50 attribute :message |
#metadata=(value) ⇒ Hash (writeonly)
Currently known clients (Asset Audits App) are sending null; unsure of the expected format.
Returns Additional metadata associated with the asset audit.
73 |
# File 'app/resources/api/v2/asset_audit_resource.rb', line 73 attribute :metadata |
#witnessed_by=(value) ⇒ String (writeonly)
Returns The user who witnessed the asset audit.
67 |
# File 'app/resources/api/v2/asset_audit_resource.rb', line 67 attribute :witnessed_by |
Class Method Details
.updatable_fields(_context) ⇒ Object
Gets the list of fields that are updatable on an existing AssetAudit. AssetAudits cannot be modified after creation. @param _context [JSONAPI::Resource::Context] Not used. @return [Array<Symbol>] The list of updatable fields.
102 103 104 |
# File 'app/resources/api/v2/asset_audit_resource.rb', line 102 def self.updatable_fields(_context) [] # Do not allow updating any fields. end |