@oystehr/sdk
Version:
Oystehr SDK
54 lines (51 loc) • 2.64 kB
text/typescript
// AUTOGENERATED -- DO NOT EDIT
import {
OystehrClientRequest,
ZambdaLogStreamGetParams,
ZambdaLogStreamGetResponse,
ZambdaLogStreamListParams,
ZambdaLogStreamListResponse,
ZambdaLogStreamSearchParams,
ZambdaLogStreamSearchResponse,
} from '../..';
import { SDKResource } from '../../client/client';
import { OystehrConfig } from '../../config';
export class ZambdaLogStream extends SDKResource {
constructor(config: OystehrConfig) {
super(config);
}
#baseUrlThunk(): string {
return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
}
/**
* Get the log streams for the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
*
* Access Policy Action: `Zambda:ReadLogs`
* Access Policy Resource: `Zambda:Function`
*/
list(params: ZambdaLogStreamListParams, request?: OystehrClientRequest): Promise<ZambdaLogStreamListResponse> {
return this.request('/zambda/{id}/logStream', 'post', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Get all logs for the Zambda Function with the provided ID, filtered by any of: text in messages, minimum start date, and/or maximum end date. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
*
* Access Policy Action: `Zambda:ReadLogs`
* Access Policy Resource: `Zambda:Function`
*/
search(params: ZambdaLogStreamSearchParams, request?: OystehrClientRequest): Promise<ZambdaLogStreamSearchResponse> {
return this.request('/zambda/{id}/logStream/search', 'post', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Get the logs from the specified log stream for the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
*
* Access Policy Action: `Zambda:ReadLogs`
* Access Policy Resource: `Zambda:Function`
*/
get(params: ZambdaLogStreamGetParams, request?: OystehrClientRequest): Promise<ZambdaLogStreamGetResponse> {
return this.request(
'/zambda/{id}/logStream/{logStreamName}',
'post',
this.#baseUrlThunk.bind(this)
)(params, request);
}
}