Sha256: 91c36bc7ff328fa3ddd55ff980d9378e21da9a8e9858d1feafddf3945e741ee8

Contents?: true

Size: 1.43 KB

Versions: 4

Compression:

Stored size: 1.43 KB

Contents

# frozen_string_literal: true

module Alula
  class DeviceUser < Alula::RestResource
    extend Alula::ResourceAttributes
    extend Alula::RelationshipAttributes
    extend Alula::ApiOperations::Request
    extend Alula::ApiOperations::List
    extend Alula::ApiOperations::Save
    extend Alula::ApiOperations::Delete

    resource_path 'devices/users'
    type 'devices-users'

    relationship :device, type: 'devices', cardinality: 'To-one'
    relationship :user, type: 'users', cardinality: 'To-one'
    relationship :helix_users, type: 'helix-users', cardinality: 'To-many'
    relationship :revisions, type: 'revisions', cardinality: 'To-many'
    # unused relationships below
    # relationship :hybrid_panel_users, type: 'devices-partitions-users', cardinality: 'To-many'

    field :id,
          type: :string,
          sortable: false,
          filterable: false

    field :device_id,
          type: :string,
          sortable: false,
          filterable: true,
          creatable_by: %i[system station dealer technician user]

    field :user_id,
          type: :string,
          sortable: false,
          filterable: true,
          creatable_by: %i[system station dealer technician user]

    field :panel_user_index,
          type: :number,
          sortable: true,
          filterable: true,
          creatable_by: %i[system station dealer technician user],
          patchable_by: %i[system station dealer technician user]
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
alula-ruby-2.6.1 lib/alula/resources/device_user.rb
alula-ruby-2.6.0 lib/alula/resources/device_user.rb
alula-ruby-2.5.0 lib/alula/resources/device_user.rb
alula-ruby-2.4.0 lib/alula/resources/device_user.rb