Skip to content

Commit 4a0e489

Browse files
committed
SDK regeneration
1 parent 78d8cab commit 4a0e489

File tree

5 files changed

+117
-101
lines changed

5 files changed

+117
-101
lines changed

reference.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,21 +1816,21 @@ Fetch all deployments for a given application ID with optional filters such as d
18161816

18171817
```typescript
18181818
const response = await client.v1.applicationVersions.list("id", {
1819-
limit: 50,
1819+
limit: 10,
18201820
offset: 0,
18211821
version: "1",
1822-
id: "deployment123",
1822+
deploymentId: "deployment123",
18231823
});
18241824
for await (const item of response) {
18251825
console.log(item);
18261826
}
18271827

18281828
// Or you can manually iterate page-by-page
18291829
const page = await client.v1.applicationVersions.list("id", {
1830-
limit: 50,
1830+
limit: 10,
18311831
offset: 0,
18321832
version: "1",
1833-
id: "deployment123",
1833+
deploymentId: "deployment123",
18341834
});
18351835
while (page.hasNextPage()) {
18361836
page = page.getNextPage();
@@ -6058,7 +6058,7 @@ await client.v1.dataDirectories.createMultipartUpload({
60586058

60596059
## V1 TracingProjects
60606060

6061-
<details><summary><code>client.v1.tracingProjects.<a href="/src/api/resources/v1/resources/tracingProjects/client/Client.ts">list</a>({ ...params }) -> TrueFoundry.ListTracingProjectsResponse</code></summary>
6061+
<details><summary><code>client.v1.tracingProjects.<a href="/src/api/resources/v1/resources/tracingProjects/client/Client.ts">list</a>({ ...params }) -> core.Page<TrueFoundry.TracingProject></code></summary>
60626062
<dl>
60636063
<dd>
60646064

@@ -6071,7 +6071,16 @@ await client.v1.dataDirectories.createMultipartUpload({
60716071
<dd>
60726072

60736073
```typescript
6074-
await client.v1.tracingProjects.list();
6074+
const response = await client.v1.tracingProjects.list();
6075+
for await (const item of response) {
6076+
console.log(item);
6077+
}
6078+
6079+
// Or you can manually iterate page-by-page
6080+
const page = await client.v1.tracingProjects.list();
6081+
while (page.hasNextPage()) {
6082+
page = page.getNextPage();
6083+
}
60756084
```
60766085

60776086
</dd>

src/api/resources/v1/resources/applicationVersions/client/Client.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ export class ApplicationVersions {
4343
*
4444
* @example
4545
* await client.v1.applicationVersions.list("id", {
46-
* limit: 50,
46+
* limit: 10,
4747
* offset: 0,
4848
* version: "1",
49-
* id: "deployment123"
49+
* deploymentId: "deployment123"
5050
* })
5151
*/
5252
public async list(
@@ -57,7 +57,7 @@ export class ApplicationVersions {
5757
const list = async (
5858
request: TrueFoundry.v1.ApplicationVersionsListRequest,
5959
): Promise<TrueFoundry.ListApplicationDeploymentsResponse> => {
60-
const { limit, offset, version, id: id_ } = request;
60+
const { limit, offset, version, deploymentId } = request;
6161
const _queryParams: Record<string, string | string[] | object | object[] | null> = {};
6262
if (limit != null) {
6363
_queryParams["limit"] = limit.toString();
@@ -68,8 +68,8 @@ export class ApplicationVersions {
6868
if (version != null) {
6969
_queryParams["version"] = version;
7070
}
71-
if (id_ != null) {
72-
_queryParams["id"] = id_;
71+
if (deploymentId != null) {
72+
_queryParams["deploymentId"] = deploymentId;
7373
}
7474
const _response = await (this._options.fetcher ?? core.fetcher)({
7575
url: urlJoin(

src/api/resources/v1/resources/applicationVersions/client/requests/ApplicationVersionsListRequest.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
/**
66
* @example
77
* {
8-
* limit: 50,
8+
* limit: 10,
99
* offset: 0,
1010
* version: "1",
11-
* id: "deployment123"
11+
* deploymentId: "deployment123"
1212
* }
1313
*/
1414
export interface ApplicationVersionsListRequest {
1515
/**
16-
* Number of items per page. Defaults to 50 if not provided.
16+
* Number of items per page
1717
*/
1818
limit?: number;
1919
/**
20-
* Number of items to skip.
20+
* Number of items to skip
2121
*/
2222
offset?: number;
2323
/**
@@ -27,5 +27,5 @@ export interface ApplicationVersionsListRequest {
2727
/**
2828
* Deployment ID. Filter deployments by a specific ID.
2929
*/
30-
id?: string;
30+
deploymentId?: string;
3131
}

src/api/resources/v1/resources/tracingProjects/client/Client.ts

Lines changed: 81 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -43,84 +43,91 @@ export class TracingProjects {
4343
public async list(
4444
request: TrueFoundry.v1.TracingProjectsListRequest = {},
4545
requestOptions?: TracingProjects.RequestOptions,
46-
): Promise<TrueFoundry.ListTracingProjectsResponse> {
47-
const { ml_repo_id: mlRepoId, fqn, name, offset, limit } = request;
48-
const _queryParams: Record<string, string | string[] | object | object[] | null> = {};
49-
if (mlRepoId != null) {
50-
_queryParams["ml_repo_id"] = mlRepoId.toString();
51-
}
52-
53-
if (fqn != null) {
54-
_queryParams["fqn"] = fqn;
55-
}
56-
57-
if (name != null) {
58-
_queryParams["name"] = name;
59-
}
60-
61-
if (offset != null) {
62-
_queryParams["offset"] = offset.toString();
63-
}
64-
65-
if (limit != null) {
66-
_queryParams["limit"] = limit.toString();
67-
}
68-
69-
const _response = await (this._options.fetcher ?? core.fetcher)({
70-
url: urlJoin(
71-
(await core.Supplier.get(this._options.baseUrl)) ??
72-
(await core.Supplier.get(this._options.environment)),
73-
"api/ml/v1/tracing-projects",
74-
),
75-
method: "GET",
76-
headers: {
77-
Authorization: await this._getAuthorizationHeader(),
78-
"X-Fern-Language": "JavaScript",
79-
"X-Fern-SDK-Name": "truefoundry-sdk",
80-
"X-Fern-SDK-Version": "0.0.0",
81-
"User-Agent": "truefoundry-sdk/0.0.0",
82-
"X-Fern-Runtime": core.RUNTIME.type,
83-
"X-Fern-Runtime-Version": core.RUNTIME.version,
84-
...requestOptions?.headers,
85-
},
86-
contentType: "application/json",
87-
queryParameters: _queryParams,
88-
requestType: "json",
89-
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
90-
maxRetries: requestOptions?.maxRetries,
91-
abortSignal: requestOptions?.abortSignal,
92-
});
93-
if (_response.ok) {
94-
return _response.body as TrueFoundry.ListTracingProjectsResponse;
95-
}
96-
97-
if (_response.error.reason === "status-code") {
98-
switch (_response.error.statusCode) {
99-
case 422:
100-
throw new TrueFoundry.UnprocessableEntityError(_response.error.body as unknown);
101-
default:
46+
): Promise<core.Page<TrueFoundry.TracingProject>> {
47+
const list = async (
48+
request: TrueFoundry.v1.TracingProjectsListRequest,
49+
): Promise<TrueFoundry.ListTracingProjectsResponse> => {
50+
const { ml_repo_id: mlRepoId, fqn, name, offset, limit } = request;
51+
const _queryParams: Record<string, string | string[] | object | object[] | null> = {};
52+
if (mlRepoId != null) {
53+
_queryParams["ml_repo_id"] = mlRepoId.toString();
54+
}
55+
if (fqn != null) {
56+
_queryParams["fqn"] = fqn;
57+
}
58+
if (name != null) {
59+
_queryParams["name"] = name;
60+
}
61+
if (offset != null) {
62+
_queryParams["offset"] = offset.toString();
63+
}
64+
if (limit != null) {
65+
_queryParams["limit"] = limit.toString();
66+
}
67+
const _response = await (this._options.fetcher ?? core.fetcher)({
68+
url: urlJoin(
69+
(await core.Supplier.get(this._options.baseUrl)) ??
70+
(await core.Supplier.get(this._options.environment)),
71+
"api/ml/v1/tracing-projects",
72+
),
73+
method: "GET",
74+
headers: {
75+
Authorization: await this._getAuthorizationHeader(),
76+
"X-Fern-Language": "JavaScript",
77+
"X-Fern-SDK-Name": "truefoundry-sdk",
78+
"X-Fern-SDK-Version": "0.0.0",
79+
"User-Agent": "truefoundry-sdk/0.0.0",
80+
"X-Fern-Runtime": core.RUNTIME.type,
81+
"X-Fern-Runtime-Version": core.RUNTIME.version,
82+
...requestOptions?.headers,
83+
},
84+
contentType: "application/json",
85+
queryParameters: _queryParams,
86+
requestType: "json",
87+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
88+
maxRetries: requestOptions?.maxRetries,
89+
abortSignal: requestOptions?.abortSignal,
90+
});
91+
if (_response.ok) {
92+
return _response.body as TrueFoundry.ListTracingProjectsResponse;
93+
}
94+
if (_response.error.reason === "status-code") {
95+
switch (_response.error.statusCode) {
96+
case 422:
97+
throw new TrueFoundry.UnprocessableEntityError(_response.error.body as unknown);
98+
default:
99+
throw new errors.TrueFoundryError({
100+
statusCode: _response.error.statusCode,
101+
body: _response.error.body,
102+
});
103+
}
104+
}
105+
switch (_response.error.reason) {
106+
case "non-json":
102107
throw new errors.TrueFoundryError({
103108
statusCode: _response.error.statusCode,
104-
body: _response.error.body,
109+
body: _response.error.rawBody,
110+
});
111+
case "timeout":
112+
throw new errors.TrueFoundryTimeoutError(
113+
"Timeout exceeded when calling GET /api/ml/v1/tracing-projects.",
114+
);
115+
case "unknown":
116+
throw new errors.TrueFoundryError({
117+
message: _response.error.errorMessage,
105118
});
106119
}
107-
}
108-
109-
switch (_response.error.reason) {
110-
case "non-json":
111-
throw new errors.TrueFoundryError({
112-
statusCode: _response.error.statusCode,
113-
body: _response.error.rawBody,
114-
});
115-
case "timeout":
116-
throw new errors.TrueFoundryTimeoutError(
117-
"Timeout exceeded when calling GET /api/ml/v1/tracing-projects.",
118-
);
119-
case "unknown":
120-
throw new errors.TrueFoundryError({
121-
message: _response.error.errorMessage,
122-
});
123-
}
120+
};
121+
let _offset = request?.offset != null ? request?.offset : 0;
122+
return new core.Pageable<TrueFoundry.ListTracingProjectsResponse, TrueFoundry.TracingProject>({
123+
response: await list(request),
124+
hasNextPage: (response) => (response?.data ?? []).length > 0,
125+
getItems: (response) => response?.data ?? [],
126+
loadPage: (response) => {
127+
_offset += response?.data != null ? response.data.length : 1;
128+
return list(core.setObjectProperty(request, "offset", _offset));
129+
},
130+
});
124131
}
125132

126133
/**

yarn.lock

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,10 +1332,10 @@ enhanced-resolve@^5.0.0, enhanced-resolve@^5.17.1:
13321332
graceful-fs "^4.2.4"
13331333
tapable "^2.2.0"
13341334

1335-
entities@^4.5.0:
1336-
version "4.5.0"
1337-
resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48"
1338-
integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==
1335+
entities@^6.0.0:
1336+
version "6.0.0"
1337+
resolved "https://registry.yarnpkg.com/entities/-/entities-6.0.0.tgz#09c9e29cb79b0a6459a9b9db9efb418ac5bb8e51"
1338+
integrity sha512-aKstq2TDOndCn4diEyp9Uq/Flu2i1GlLkc6XIDQSDMuaFE3OPW5OphLCyQ5SpSJZTb4reN+kTcYru5yIfXoRPw==
13391339

13401340
error-ex@^1.3.1:
13411341
version "1.3.2"
@@ -2487,11 +2487,11 @@ parse-json@^5.2.0:
24872487
lines-and-columns "^1.1.6"
24882488

24892489
parse5@^7.0.0, parse5@^7.1.1:
2490-
version "7.2.1"
2491-
resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.2.1.tgz#8928f55915e6125f430cc44309765bf17556a33a"
2492-
integrity sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==
2490+
version "7.3.0"
2491+
resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.3.0.tgz#d7e224fa72399c7a175099f45fc2ad024b05ec05"
2492+
integrity sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==
24932493
dependencies:
2494-
entities "^4.5.0"
2494+
entities "^6.0.0"
24952495

24962496
path-exists@^4.0.0:
24972497
version "4.0.0"
@@ -2678,9 +2678,9 @@ saxes@^6.0.0:
26782678
xmlchars "^2.2.0"
26792679

26802680
schema-utils@^4.3.0:
2681-
version "4.3.1"
2682-
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.3.1.tgz#0fe982d6bfaf404e77f02ed433d429d0f0ad0b6c"
2683-
integrity sha512-jjlZ7UknkyQxGnHF1w8wDgWfdtnW0hBX7tmDp04zBwDBZ/6tPJI1+RWfBHGMA4+0nAjGptp+eDpIYP6mldJbqg==
2681+
version "4.3.2"
2682+
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.3.2.tgz#0c10878bf4a73fd2b1dfd14b9462b26788c806ae"
2683+
integrity sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ==
26842684
dependencies:
26852685
"@types/json-schema" "^7.0.9"
26862686
ajv "^8.9.0"

0 commit comments

Comments
 (0)