Item class

Used to perform operations on a specific item.

Properties

container
id
primaryKey
url

Returns a reference URL to the resource. Used for linking in Permissions.

Methods

delete(RequestOptions)

Delete the item.

delete(RequestOptions)

Delete the item. Any provided type, T, is not necessarily enforced by the SDK. You may get more or less properties and it's up to your logic to enforce it.

read(RequestOptions)

Read the item's definition. There is no set schema for JSON items. They may contain any number of custom properties.

read(RequestOptions)

Read the item's definition. Any provided type, T, is not necessarily enforced by the SDK. You may get more or less properties and it's up to your logic to enforce it. If the type, T, is a class, it won't pass typeof comparisons, because it won't have a match prototype. It's recommended to only use interfaces.

There is no set schema for JSON items. They may contain any number of custom properties.

replace(ItemDefinition, RequestOptions)

Replace the item's definition. There is no set schema for JSON items. They may contain any number of custom properties.

replace(T, RequestOptions)

Replace the item's definition. Any provided type, T, is not necessarily enforced by the SDK. You may get more or less properties and it's up to your logic to enforce it.

There is no set schema for JSON items. They may contain any number of custom properties.

Property Details

container

container: Container

Property Value

id

id: string

Property Value

string

primaryKey

primaryKey: string

Property Value

string

url

Returns a reference URL to the resource. Used for linking in Permissions.

url: string

Property Value

string

Method Details

delete(RequestOptions)

Delete the item.

function delete(options?: RequestOptions)

Parameters

options
RequestOptions

Additional options for the request, such as the partition key.

Returns

delete(RequestOptions)

Delete the item. Any provided type, T, is not necessarily enforced by the SDK. You may get more or less properties and it's up to your logic to enforce it.

function delete<T>(options?: RequestOptions)

Parameters

options
RequestOptions

Additional options for the request, such as the partition key.

Returns

Promise<ItemResponse<T>>

read(RequestOptions)

Read the item's definition. There is no set schema for JSON items. They may contain any number of custom properties.

function read(options?: RequestOptions)

Parameters

options
RequestOptions

Additional options for the request, such as the partition key. Note, if you provide a partition key on the options object, it will override the primary key on this.primaryKey.

Returns

read(RequestOptions)

Read the item's definition. Any provided type, T, is not necessarily enforced by the SDK. You may get more or less properties and it's up to your logic to enforce it. If the type, T, is a class, it won't pass typeof comparisons, because it won't have a match prototype. It's recommended to only use interfaces.

There is no set schema for JSON items. They may contain any number of custom properties.

function read<T>(options?: RequestOptions)

Parameters

options
RequestOptions

Additional options for the request, such as the partition key. Note, if you provide a partition key on the options object, it will override the primary key on this.primaryKey.

Returns

Promise<ItemResponse<T>>

replace(ItemDefinition, RequestOptions)

Replace the item's definition. There is no set schema for JSON items. They may contain any number of custom properties.

function replace(body: ItemDefinition, options?: RequestOptions)

Parameters

body
ItemDefinition

The definition to replace the existing <xref:Item>'s definition with.

options
RequestOptions

Additional options for the request, such as the partition key.

Returns

replace(T, RequestOptions)

Replace the item's definition. Any provided type, T, is not necessarily enforced by the SDK. You may get more or less properties and it's up to your logic to enforce it.

There is no set schema for JSON items. They may contain any number of custom properties.

function replace<T>(body: T, options?: RequestOptions)

Parameters

body
T

The definition to replace the existing <xref:Item>'s definition with.

options
RequestOptions

Additional options for the request, such as the partition key.

Returns

Promise<ItemResponse<T>>