Maximo API Client - v0.9.01
    Preparing search index...

    Class UpdateBuilder<T>

    Fluent builder for constructing update/create payloads for Maximo resources. Supports field setting, unsetting, child add/update/delete, patch type, etc.

    Type Parameters

    • T extends object = any
    Index

    Methods

    • Set or update a top-level field

      Type Parameters

      • K extends string | number | symbol

      Parameters

      • field: K
      • value: T[K]

      Returns this

    • Unset/clear a field (set to null)

      Parameters

      • field: string

      Returns this

    • Add or update a child object (array field) If the child array does not exist, it is created. If the child object has primary keys, provide them for update; otherwise, it will be added.

      Parameters

      • childName: string
      • childObj: Record<string, any>

      Returns this

    • Update a child object (array field) by primary key(s) or href. This is semantically clearer than addChild for updating existing children. Under the hood, it pushes to the child array (like addChild). Example: .updateChild('assetmeter', { metername: 'HOURS', lastreading: 99 })

      Parameters

      • childName: string
      • childObj: Record<string, any>

      Returns this

    • Remove a child object by key(s) (adds _action: 'Delete' to the child object) Example: .removeChild('assetmeter', { metername: 'TEMP-F' })

      Parameters

      • childName: string
      • childKeyObj: Record<string, any>

      Returns this

    • Set the patch type for update (MERGE or UPDATE)

      Parameters

      • type: "MERGE" | "UPDATE"

      Returns this

    • Build the final payload object

      Returns { payload: Record<string, any>; patchType?: "MERGE" | "UPDATE" }

    Constructors