RuntimeDataClient class
RuntimeDataClient handles data operations through PowerOperationExecutor
Constructors
| Runtime |
Methods
| create |
Creates data using POST method |
| create |
Creates a new instance of RuntimeDataClient |
| delete |
Deletes data using DELETE method |
| retrieve |
Retrieves data using GET or POST method |
| update |
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
- context
- IOperationContext
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
Promise<IRuntimeDataClient>
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
- context
- IOperationContext
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
- context
- IOperationContext
Returns
Promise<IOperationResult<TResponse>>
Promise resolving to the response data