Skip to content

Commit 4ce27ba

Browse files
feat(api): dummy change to cause a version PR (#12)
1 parent 5b9a83b commit 4ce27ba

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 111
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6860d955bb7b497681b9d1ae03c10c51a458c68f5011efc648ae9d049250d6c7.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-4e3ac088751d52ff03184c39a009d093a7457f4e25dc489a938fe25ad5d83d98.yml

src/resources/users/pats.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ export class Pats extends APIResource {
1111
* ListPersonalAccessTokens
1212
*/
1313
list(
14-
params: PatListParams,
14+
params: PatListParams | null | undefined = {},
1515
options?: RequestOptions,
1616
): PagePromise<PersonalAccessTokensPersonalAccessTokensPage, PersonalAccessToken> {
17-
const { token, pageSize, ...body } = params;
17+
const { token, pageSize, ...body } = params ?? {};
1818
return this._client.getAPIList(
1919
'/gitpod.v1.UserService/ListPersonalAccessTokens',
2020
PersonalAccessTokensPage<PersonalAccessToken>,

tests/api-resources/users/pats.test.ts

+17-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const client = new Gitpod({
1010
describe('resource pats', () => {
1111
// skipped: tests are disabled for the time being
1212
test.skip('list', async () => {
13-
const responsePromise = client.users.pats.list({});
13+
const responsePromise = client.users.pats.list();
1414
const rawResponse = await responsePromise.asResponse();
1515
expect(rawResponse).toBeInstanceOf(Response);
1616
const response = await responsePromise;
@@ -20,6 +20,22 @@ describe('resource pats', () => {
2020
expect(dataAndResponse.response).toBe(rawResponse);
2121
});
2222

23+
// skipped: tests are disabled for the time being
24+
test.skip('list: request options and params are passed correctly', async () => {
25+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
26+
await expect(
27+
client.users.pats.list(
28+
{
29+
token: 'token',
30+
pageSize: 0,
31+
filter: { userIds: ['182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'] },
32+
pagination: { token: 'token', pageSize: 100 },
33+
},
34+
{ path: '/_stainless_unknown_path' },
35+
),
36+
).rejects.toThrow(Gitpod.NotFoundError);
37+
});
38+
2339
// skipped: tests are disabled for the time being
2440
test.skip('delete', async () => {
2541
const responsePromise = client.users.pats.delete({});

0 commit comments

Comments
 (0)