File

src/models/resource/resource-ref.ts

Description

Base class reference to a Resource (Device, Component, etc.). This object is only the id-name pair one would find in a Device Manager's devices array, not the full model.

NOTE: This is not related to the Core Framework Resource class! The English word made sense for these objects that are ID-name pairs since they are resource references (ResourceRef) on the REST server that resolve into actual resource entities at the server.

Implements

ISerializable

Index

Properties
Methods

Methods

deserialize
deserialize(input: any)

Deserializes a JSON object into this class

Parameters :
Name Type Optional Description
input any
Returns : this

Properties

Public id
id: string
Type : string

Unique ID of the resource

Public name
name: string
Type : string

Name of the resource

import { ISerializable } from '../serialization/index';

/**
 * Base class reference to a Resource (Device, Component, etc.).  This object is
 * only the id-name pair one would find in a Device Manager's devices array,
 * not the full model.
 * 
 * NOTE: This is not related to the Core Framework Resource class!  The English
 * word made sense for these objects that are ID-name pairs since they are
 * resource references (ResourceRef) on the REST server that resolve into actual
 * resource entities at the server.
 */
export class ResourceRef implements ISerializable<ResourceRef> {
    /** Name of the resource */
    public name: string;
    /** Unique ID of the resource */
    public id: string;

    /** Deserializes a JSON object into this class */
    deserialize(input: any) {
        this.name = input.name;
        this.id = input.id;
        return this;
    }
}

results matching ""

    No results matching ""