Skip to content

Commit

Permalink
Merge pull request #159 from mkusaka/update-20240501T000304
Browse files Browse the repository at this point in the history
  • Loading branch information
mkusaka authored May 1, 2024
2 parents 2b3bb91 + f5734ac commit 75b41a8
Show file tree
Hide file tree
Showing 5 changed files with 297 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ export type { context_project_restrictions_list } from "./models/context_project
export type { Decision } from "./models/Decision.ts";
export type { DecisionLog } from "./models/DecisionLog.ts";
export type { DecisionSettings } from "./models/DecisionSettings.ts";
export type { get_usage_export_job_status } from "./models/get_usage_export_job_status.ts";
export type { JSONDuration } from "./models/JSONDuration.ts";
export type { PatchClaimsRequest } from "./models/PatchClaimsRequest.ts";
export type { Policy } from "./models/Policy.ts";
export type { PolicyBundle } from "./models/PolicyBundle.ts";
export type { project_settings } from "./models/project_settings.ts";
export type { restriction_created } from "./models/restriction_created.ts";
export type { restriction_deleted } from "./models/restriction_deleted.ts";
export type { usage_export_job } from "./models/usage_export_job.ts";
export type { Violation } from "./models/Violation.ts";
export { ContextService } from "./services/ContextService.ts";
export { InsightsService } from "./services/InsightsService.ts";
Expand All @@ -25,6 +27,7 @@ export { PipelineService } from "./services/PipelineService.ts";
export { PolicyManagementService } from "./services/PolicyManagementService.ts";
export { ProjectService } from "./services/ProjectService.ts";
export { ScheduleService } from "./services/ScheduleService.ts";
export { UsageService } from "./services/UsageService.ts";
export { UserService } from "./services/UserService.ts";
export { WebhookService } from "./services/WebhookService.ts";
export { WorkflowService } from "./services/WorkflowService.ts";
12 changes: 12 additions & 0 deletions client/models/get_usage_export_job_status.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type get_usage_export_job_status = {
/**
* A list of pre signed urls that the client can use to download the results of a Usage Export.
*/
download_urls: Array<string>;
error_reason?: string;
state: "created" | "processing" | "failed" | "completed";
usage_export_job_id: string;
};
13 changes: 13 additions & 0 deletions client/models/usage_export_job.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type usage_export_job = {
/**
* A list of pre signed urls that the client can use to download the results of a Usage Export.
*/
download_urls: Array<string>;
end: string;
start: string;
state: "created" | "processing" | "failed" | "completed";
usage_export_job_id: string;
};
85 changes: 85 additions & 0 deletions client/services/UsageService.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import type { get_usage_export_job_status } from "../models/get_usage_export_job_status.ts";
import type { usage_export_job } from "../models/usage_export_job.ts";
import type { CancelablePromise } from "../core/CancelablePromise.ts";
import { OpenAPI } from "../core/OpenAPI.ts";
import { request as __request } from "../core/request.ts";
export class UsageService {
/**
* Create a usage export
* Submits a request to create a usage export for an organization.
* @returns usage_export_job Usage export created successfully
* @throws ApiError
*/
public static createUsageExport({
orgId,
requestBody,
}: {
/**
* An opaque identifier of an organization.
*/
orgId: string;
requestBody: {
/**
* The end date & time (inclusive) of the range from which data will be pulled. Must be no more than 31 days after `start`.
*/
end: string;
shared_org_ids?: Array<string>;
/**
* The start date & time (inclusive) of the range from which data will be pulled. Must be no more than one year ago.
*/
start: string;
};
}): CancelablePromise<usage_export_job> {
return __request(OpenAPI, {
method: "POST",
url: "/organizations/{org_id}/usage_export_job",
path: {
org_id: orgId,
},
body: requestBody,
mediaType: "application/json",
errors: {
400: `Unexpected request body provided.`,
401: `Credentials provided are invalid.`,
404: `Entity not found.`,
429: `API rate limits exceeded.`,
500: `Internal server error.`,
},
});
}
/**
* Get a usage export
* Gets a usage export for an organization.
* @returns get_usage_export_job_status Usage export fetched successfully
* @throws ApiError
*/
public static getUsageExport({
orgId,
usageExportJobId,
}: {
/**
* An opaque identifier of an organization.
*/
orgId: string;
/**
* An opaque identifier of a usage export job.
*/
usageExportJobId: string;
}): CancelablePromise<get_usage_export_job_status> {
return __request(OpenAPI, {
method: "GET",
url: "/organizations/{org_id}/usage_export_job/{usage_export_job_id}",
path: {
org_id: orgId,
usage_export_job_id: usageExportJobId,
},
errors: {
400: `Unexpected request body provided.`,
401: `Credentials provided are invalid.`,
404: `Entity not found.`,
429: `API rate limits exceeded.`,
500: `Internal server error.`,
},
});
}
}
184 changes: 184 additions & 0 deletions swagger.json

Large diffs are not rendered by default.

0 comments on commit 75b41a8

Please sign in to comment.