Share via


RuntimeDataClient class

RuntimeDataClient handles data operations through PowerOperationExecutor

Constructors

RuntimeDataClient(IPowerOperationExecutor)

Methods

createDataAsync<TRequest, TResponse>(string, string, string, TRequest, IOperationContext)

Creates data using POST method

createInstanceAsync(IPowerOperationExecutor)

Creates a new instance of RuntimeDataClient

deleteDataAsync(string, string, string, IOperationContext)

Deletes data using DELETE method

retrieveDataAsync<TRequest, TResponse>(string, string, string, HttpMethod, {[key: string]: string}, unknown, IOperationContext)

Retrieves data using GET or POST method

updateDataAsync<TRequest, TResponse>(string, string, string, TRequest, IOperationContext)

Updates data using PATCH method

Constructor Details

RuntimeDataClient(IPowerOperationExecutor)

new RuntimeDataClient(_powerOperationExecutor: IPowerOperationExecutor)

Parameters

_powerOperationExecutor
IPowerOperationExecutor

Method Details

createDataAsync<TRequest, TResponse>(string, string, string, TRequest, IOperationContext)

Creates data using POST method

function createDataAsync<TRequest, TResponse>(url: string, apiId: string, tableName: string, body: TRequest, context?: IOperationContext): Promise<IOperationResult<TResponse>>

Parameters

url

string

The URL for the request

apiId

string

The API ID for authentication

tableName

string

The name of the table to access

body

TRequest

The request body for the POST method

Returns

Promise<IOperationResult<TResponse>>

Promise resolving to the response data

createInstanceAsync(IPowerOperationExecutor)

Creates a new instance of RuntimeDataClient

static function createInstanceAsync(powerOperationExecutor: IPowerOperationExecutor): Promise<IRuntimeDataClient>

Parameters

powerOperationExecutor
IPowerOperationExecutor

Returns

deleteDataAsync(string, string, string, IOperationContext)

Deletes data using DELETE method

function deleteDataAsync(url: string, connectionApi: string, serviceNamespace: string, context?: IOperationContext): Promise<IOperationResult<void>>

Parameters

url

string

The URL for the request

connectionApi

string

The API ID for authentication

serviceNamespace

string

The name of the service namespace

Returns

Promise<IOperationResult<void>>

Promise resolving to the response data

retrieveDataAsync<TRequest, TResponse>(string, string, string, HttpMethod, {[key: string]: string}, unknown, IOperationContext)

Retrieves data using GET or POST method

function retrieveDataAsync<TRequest, TResponse>(url: string, apiId: string, tableName: string, method: HttpMethod, headers?: {[key: string]: string}, body?: unknown, context?: IOperationContext): Promise<IOperationResult<TResponse>>

Parameters

url

string

The URL for the request

apiId

string

The API ID for authentication

tableName

string

The name of the table to access

method
HttpMethod

The HTTP method

headers

{[key: string]: string}

body

unknown

Optional request body for POST method

context
IOperationContext

Optional operation context

Returns

Promise<IOperationResult<TResponse>>

Promise resolving to the response data

updateDataAsync<TRequest, TResponse>(string, string, string, TRequest, IOperationContext)

Updates data using PATCH method

function updateDataAsync<TRequest, TResponse>(url: string, apiId: string, tableName: string, body: TRequest, context?: IOperationContext): Promise<IOperationResult<TResponse>>

Parameters

url

string

The URL for the request

apiId

string

The API ID for authentication

tableName

string

The name of the table to access

body

TRequest

The request body for the PATCH method

Returns

Promise<IOperationResult<TResponse>>

Promise resolving to the response data