Options
All
  • Public
  • Public/Protected
  • All
Menu

An Item which does not exist in the API

Hierarchy

  • ItemChange
    • NewItem

Index

Constructors

constructor

  • new NewItem(label: string, template_name: string, slots?: NewSlot[], classification_nodes?: ClassificationNode[]): NewItem
  • Required fields for creating a new Item.

    Parameters

    • label: string

      Must be non-empty string

    • template_name: string

      Must be non-empty string

    • slots: NewSlot[] = []
    • classification_nodes: ClassificationNode[] = []

    Returns NewItem

Properties

classification_nodes

classification_nodes: ClassificationNode[] = []

Readonly label

label: string

slots

slots: NewSlot[] = []

template_name

template_name: string

Accessors

slotsByName

  • get slotsByName(): Record<string, SlotType>

values

  • set values(assignment: Record<string, undefined | string>): void
  • Set the Slot values in this change-set to exactly the given values. Properties of existing Slots will be preserved. Any Slots not in assignment will be removed from the change-set.

    Parameters

    • assignment: Record<string, undefined | string>

    Returns void

Methods

assignValues

  • assignValues(assignment: Record<string, undefined | string>): void
  • Existing values in this.slots are overwritten if present in assignment. assignment names that do not correspond to existing names in this.slots are created.

    Parameters

    • assignment: Record<string, undefined | string>

      A map from Slot.name to Slot.value.

    Returns void

removeSlot

  • removeSlot(spec: { label?: string; name?: string }): void
  • This just removes the Slot from the creation request. The Slot may still exist on the created Item if it is a Template slot.

    Parameters

    • spec: { label?: string; name?: string }
      • Optional label?: string
      • Optional name?: string

    Returns void

toRequest

  • constraints:

    • each slot must have either a non-empty label or name
    • slots may not have a 'value' field
    • encrypted_value is either a cryppo formatted string or is not present
    • slot type must be a valid type

    Parameters

    Returns Promise<PostItemsRequest>

Static fromTemplate

  • fromTemplate(template: ItemTemplate, templateSlots: Slot[], label: string, extraSlots?: NewSlot[]): NewItem

Generated using TypeDoc