Options
All
  • Public
  • Public/Protected
  • All
Menu

Construct an update for an existing Item given its id.

Hierarchy

  • ItemChange
    • ItemUpdate

Index

Constructors

constructor

  • new ItemUpdate(id: string, update: Partial<{ classification_nodes: ClassificationNode[]; label: string; slots: NewSlot[] }>): ItemUpdate

Properties

classification_nodes

classification_nodes: ClassificationNode[] = []

Readonly id

id: string

Optional label

label: string

slots

slots: NewSlot[] = []

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

toJSON

  • toJSON(): { classification_nodes: ClassificationNode[]; id: string; label: undefined | string; slots: NewSlot[] }

toNewItem

  • toNewItem(label: string, templateName: string): NewItem

toRequest

  • toRequest(key: IDEK): Promise<PutItemsRequest>

Static fromJSON

Generated using TypeDoc