-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #159 from mkusaka/update-20240501T000304
- Loading branch information
Showing
5 changed files
with
297 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.`, | ||
}, | ||
}); | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.