Skip to content

Commit

Permalink
fix: casing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shivam-pareek committed Nov 5, 2024
1 parent 07eb546 commit 6b3e647
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 15 deletions.
41 changes: 27 additions & 14 deletions src/apis/logsExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@ import { APIPromise, RequestOptions } from '../baseClient';
import { createHeaders } from './createHeaders';
import { toQueryParams } from '../utils';


export interface LogsExportCreateParams {
filters?: Record<string, any>;
workspace_id?: string;
workspaceId?: string;
description?: string;
requested_data?: string[];
requestedData?: string[];
}
export interface LogsExportCreateResponse extends APIResponseType {
id?: string;
total?: number;
object?: string;
}
export interface LogsExportListParams {
workspace_id?: string;
workspaceId?: string;
}
export interface LogsExportListResponse extends APIResponseType {
object?: string;
Expand All @@ -26,9 +25,9 @@ export interface LogsExportListResponse extends APIResponseType {
}
export interface LogsExportUpdateParams {
exportId?: string;
workspace_id?: string;
workspaceId?: string;
filters?: Record<string, any>;
requested_data?: string[];
requestedData?: string[];
}
export interface LogsExportUpdateResponse extends APIResponseType {
id?: string;
Expand Down Expand Up @@ -73,19 +72,24 @@ export interface LogsExportDownloadResponse extends APIResponseType {
signed_url?: string;
}
export class Logs extends ApiResource {
exports: Exports;
constructor(client:any){
super(client);
this.exports = new Exports(client);
}
exports: Exports;
constructor(client: any) {
super(client);
this.exports = new Exports(client);
}
}
export class Exports extends ApiResource {
create(
_body: LogsExportCreateParams,
params?: ApiClientInterface,
opts?: RequestOptions
): APIPromise<LogsExportCreateResponse> {
const body = _body;
const { workspaceId, requestedData, ...rest } = _body;
const body = {
...rest,
workspace_id: workspaceId,
requested_data: requestedData,
};
if (params) {
this.client.customHeaders = {
...this.client.customHeaders,
Expand Down Expand Up @@ -122,7 +126,11 @@ export class Exports extends ApiResource {
params?: ApiClientInterface,
opts?: RequestOptions
): APIPromise<LogsExportListResponse> {
const body = _body;
const { workspaceId, ...rest } = _body;
const body = {
...rest,
workspace_id: workspaceId,
};
const query = toQueryParams(body);
if (params) {
this.client.customHeaders = {
Expand All @@ -141,7 +149,12 @@ export class Exports extends ApiResource {
params?: ApiClientInterface,
opts?: RequestOptions
): APIPromise<LogsExportUpdateResponse> {
const body = _body;
const { workspaceId, requestedData, ...rest } = _body;
const body = {
...rest,
workspace_id: workspaceId,
requested_data: requestedData,
};
const exportId = body.exportId;
if (params) {
this.client.customHeaders = {
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export function toQueryParams(
| VirtualKeysListParams
| ApiKeysListParams
| CongfigsListParams
| LogsExportListParams
| LogsExportListParams|any
): string {
if (!params) {
return '';
Expand Down

0 comments on commit 6b3e647

Please sign in to comment.