|
1 | 1 | // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
2 | 2 |
|
3 | 3 | import { APIResource } from '../../resource'; |
| 4 | +import * as Core from '../../core'; |
4 | 5 | import * as TestResultsAPI from './test-results'; |
5 | 6 | import { TestResultListParams, TestResultListResponse, TestResults } from './test-results'; |
6 | 7 |
|
7 | 8 | export class Commits extends APIResource { |
8 | 9 | testResults: TestResultsAPI.TestResults = new TestResultsAPI.TestResults(this._client); |
| 10 | + |
| 11 | + /** |
| 12 | + * Retrieve a project version (commit) by its id. |
| 13 | + */ |
| 14 | + retrieve(projectVersionId: string, options?: Core.RequestOptions): Core.APIPromise<CommitRetrieveResponse> { |
| 15 | + return this._client.get(`/versions/${projectVersionId}`, options); |
| 16 | + } |
| 17 | +} |
| 18 | + |
| 19 | +export interface CommitRetrieveResponse { |
| 20 | + /** |
| 21 | + * The project version (commit) id. |
| 22 | + */ |
| 23 | + id: string; |
| 24 | + |
| 25 | + /** |
| 26 | + * The details of a commit (project version). |
| 27 | + */ |
| 28 | + commit: CommitRetrieveResponse.Commit; |
| 29 | + |
| 30 | + /** |
| 31 | + * The commit archive date. |
| 32 | + */ |
| 33 | + dateArchived: string | null; |
| 34 | + |
| 35 | + /** |
| 36 | + * The project version (commit) creation date. |
| 37 | + */ |
| 38 | + dateCreated: string; |
| 39 | + |
| 40 | + /** |
| 41 | + * The number of tests that are failing for the commit. |
| 42 | + */ |
| 43 | + failingGoalCount: number; |
| 44 | + |
| 45 | + /** |
| 46 | + * The model id. |
| 47 | + */ |
| 48 | + mlModelId: string | null; |
| 49 | + |
| 50 | + /** |
| 51 | + * The number of tests that are passing for the commit. |
| 52 | + */ |
| 53 | + passingGoalCount: number; |
| 54 | + |
| 55 | + /** |
| 56 | + * The project id. |
| 57 | + */ |
| 58 | + projectId: string; |
| 59 | + |
| 60 | + /** |
| 61 | + * The commit status. Initially, the commit is `queued`, then, it switches to |
| 62 | + * `running`. Finally, it can be `paused`, `failed`, or `completed`. |
| 63 | + */ |
| 64 | + status: 'queued' | 'running' | 'paused' | 'failed' | 'completed' | 'unknown'; |
| 65 | + |
| 66 | + /** |
| 67 | + * The commit status message. |
| 68 | + */ |
| 69 | + statusMessage: string | null; |
| 70 | + |
| 71 | + /** |
| 72 | + * The total number of tests for the commit. |
| 73 | + */ |
| 74 | + totalGoalCount: number; |
| 75 | + |
| 76 | + /** |
| 77 | + * The training dataset id. |
| 78 | + */ |
| 79 | + trainingDatasetId: string | null; |
| 80 | + |
| 81 | + /** |
| 82 | + * The validation dataset id. |
| 83 | + */ |
| 84 | + validationDatasetId: string | null; |
| 85 | + |
| 86 | + /** |
| 87 | + * Whether the commit is archived. |
| 88 | + */ |
| 89 | + archived?: boolean | null; |
| 90 | + |
| 91 | + /** |
| 92 | + * The deployment status associated with the commit's model. |
| 93 | + */ |
| 94 | + deploymentStatus?: string; |
| 95 | + |
| 96 | + links?: CommitRetrieveResponse.Links; |
| 97 | +} |
| 98 | + |
| 99 | +export namespace CommitRetrieveResponse { |
| 100 | + /** |
| 101 | + * The details of a commit (project version). |
| 102 | + */ |
| 103 | + export interface Commit { |
| 104 | + /** |
| 105 | + * The commit id. |
| 106 | + */ |
| 107 | + id: string; |
| 108 | + |
| 109 | + /** |
| 110 | + * The author id of the commit. |
| 111 | + */ |
| 112 | + authorId: string; |
| 113 | + |
| 114 | + /** |
| 115 | + * The size of the commit bundle in bytes. |
| 116 | + */ |
| 117 | + fileSize: number | null; |
| 118 | + |
| 119 | + /** |
| 120 | + * The commit message. |
| 121 | + */ |
| 122 | + message: string; |
| 123 | + |
| 124 | + /** |
| 125 | + * The model id. |
| 126 | + */ |
| 127 | + mlModelId: string | null; |
| 128 | + |
| 129 | + /** |
| 130 | + * The storage URI where the commit bundle is stored. |
| 131 | + */ |
| 132 | + storageUri: string; |
| 133 | + |
| 134 | + /** |
| 135 | + * The training dataset id. |
| 136 | + */ |
| 137 | + trainingDatasetId: string | null; |
| 138 | + |
| 139 | + /** |
| 140 | + * The validation dataset id. |
| 141 | + */ |
| 142 | + validationDatasetId: string | null; |
| 143 | + |
| 144 | + /** |
| 145 | + * The commit creation date. |
| 146 | + */ |
| 147 | + dateCreated?: string; |
| 148 | + |
| 149 | + /** |
| 150 | + * The ref of the corresponding git commit. |
| 151 | + */ |
| 152 | + gitCommitRef?: string; |
| 153 | + |
| 154 | + /** |
| 155 | + * The SHA of the corresponding git commit. |
| 156 | + */ |
| 157 | + gitCommitSha?: number; |
| 158 | + |
| 159 | + /** |
| 160 | + * The URL of the corresponding git commit. |
| 161 | + */ |
| 162 | + gitCommitUrl?: string; |
| 163 | + } |
| 164 | + |
| 165 | + export interface Links { |
| 166 | + app: string; |
| 167 | + } |
9 | 168 | } |
10 | 169 |
|
11 | 170 | Commits.TestResults = TestResults; |
12 | 171 |
|
13 | 172 | export declare namespace Commits { |
| 173 | + export { type CommitRetrieveResponse as CommitRetrieveResponse }; |
| 174 | + |
14 | 175 | export { |
15 | 176 | TestResults as TestResults, |
16 | 177 | type TestResultListResponse as TestResultListResponse, |
|
0 commit comments