Class ResourceAbstract

Base class for all DataTrue resource types

Hierarchy

Constructors

Properties

name: string
options: ResourceOptions = {}
childTypes: readonly string[]
resourceType: string
resourceTypeRun?: string

Methods

  • Delete the resource in DataTrue

    Returns

    Promise

    Returns Promise<void>

  • Gets the contextID of a resource

    Returns

    contextID of the resource

    Returns undefined | number

  • Gets the contextType of a resource

    Returns

    contextType of the resource

    Returns string

  • Gets the resourceID of a resource

    Returns

    resourceID of the resource

    Returns undefined | number

  • Sets the contextID of a resource

    Parameters

    • id: undefined | number

      the contextID to set

    Returns void

  • Set options from the passed options object

    Parameters

    • options: ResourceOptions

      the object to set options from

    • Optional override: boolean

      whether to override the options object

    Returns void

  • Sets the resourceID of a resource

    Parameters

    • id: undefined | number

      the resourceID to set

    Returns void

  • Convert the resource to an Object

    Returns

    object representation of the resource

    Returns Promise<Record<string, any>>

  • Convert the resource to a JSON string

    Returns

    the resource represented as a JSON string

    Returns Promise<string>

  • Create a resource from a given ID

    Returns

    Promise of the resource

    Parameters

    • id: number

      the ID of the resource

    Returns Promise<Resource>

  • Create a resource from an object

    Returns

    new Resource

    Parameters

    • obj: Record<string, any>

      object to create resource from

    • copy: boolean = false

      whether to create a copy of the resource or not (removes resource IDs)

    Returns Resource

Generated using TypeDoc