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

    Class ResourceCreate<T>

    Fluent builder for creating a single resource. Provides a chainable API for configuring POST /os/{objectStructure} requests.

    const asset = await client.asset
    .createResource({ assetnum: 'A001', description: 'New Asset' })
    .returnProperties(['assetnum', 'status'])
    .suppressEvents()
    .withTransactionId('unique-tx-id')
    .execute();

    Type Parameters

    • T extends OslcResource

      The resource type that extends OslcResource

    Index

    Methods

    • Adds an attachment (doclink) to be created along with the resource.

      Parameters

      • attachment: DocLink

        The attachment data

      Returns this

      This builder instance for chaining

    • Convenience method to add a file attachment using Base64 data.

      Parameters

      • fileName: string

        Name of the file (e.g., 'report.pdf')

      • base64Data: string

        Base64 encoded file content

      • Optionaldescription: string

        Optional description

      • doctype: string = 'Attachments'

        Optional document type (defaults to 'Attachments')

      Returns this

      This builder instance for chaining

    • Sets the properties to return in the response (properties header)

      Parameters

      • fields: string | string[]

        Field names to include in the response

      Returns this

      This builder instance for chaining

    • Sets the transaction ID for deduplication (transactionid header)

      Parameters

      • transactionId: string

        Unique transaction identifier

      Returns this

      This builder instance for chaining

    • Suppresses business object events (sets x-allow-events to 0)

      Returns this

      This builder instance for chaining

    • Explicitly allows business object events (sets x-allow-events to 1)

      Returns this

      This builder instance for chaining

    • Sets the public URI header (x-public-uri)

      Parameters

      • uri: string

        The public URI base for generated links

      Returns this

      This builder instance for chaining

    • Ignores collection references in the response (ignorecollectionref=1)

      Returns this

      This builder instance for chaining

    • Sets an action to execute during creation

      Parameters

      • name: string

        The action name

      Returns this

      This builder instance for chaining

    • Removes rowstamps from parent and child objects (ignorers=1)

      Returns this

      This builder instance for chaining

    • Removes ref and localref from parent and child objects (ignorekeyref=1)

      Returns this

      This builder instance for chaining

    • Adds internal values to the response (internalvalues=1) For example, adds status_maxvalue alongside status

      Returns this

      This builder instance for chaining

    • Returns relative URIs instead of absolute URIs (relativeuri=1)

      Returns this

      This builder instance for chaining

    • Request the server to return all validation errors at once instead of stopping at the first one. Sets the batcherror: 1 header.

      Returns this

      This builder instance for chaining

    • Sets a custom header

      Parameters

      • name: string

        Header name

      • value: string

        Header value

      Returns this

      This builder instance for chaining

    • Sets a custom query parameter

      Parameters

      • name: string

        Parameter name

      • value: string

        Parameter value

      Returns this

      This builder instance for chaining

    • Gets the data to create

      Returns Partial<T>

    • Internal

      Builds the headers for the request

      Returns Record<string, string>

    • Internal

      Builds the query parameters for the request

      Returns Record<string, string>

    • Executes the create request and returns the created resource

      Returns Promise<T>

      A promise resolving to the created resource

    Constructors