Skip to content

Commit d1169c0

Browse files
feat(api): update API spec with pagination headers
1 parent b8fa501 commit d1169c0

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 46
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-33f1feaba7bde46bfa36d2fefb5c3bc9512967945bccf78045ad3f64aafc4eb0.yml
3-
openapi_spec_hash: 52a448889d41216d1ca30e8a57115b14
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-cb38560915edce03abce2ae3ef5bc745489dbe9b6f80c2b4ff42edf8c2ff276d.yml
3+
openapi_spec_hash: a869194d6c864ba28d79ec0105439c3e
44
config_hash: 1f28d5c3c063f418ebd2799df1e4e781

src/resources/deployments.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,13 @@ export class Deployments extends APIResource {
4545
* @example
4646
* ```ts
4747
* // Automatically fetches more pages as needed.
48-
* for await (const deploymentListResponse of client.deployments.list(
49-
* { app_name: 'app_name' },
50-
* )) {
48+
* for await (const deploymentListResponse of client.deployments.list()) {
5149
* // ...
5250
* }
5351
* ```
5452
*/
5553
list(
56-
query: DeploymentListParams,
54+
query: DeploymentListParams | null | undefined = {},
5755
options?: RequestOptions,
5856
): PagePromise<DeploymentListResponsesOffsetPagination, DeploymentListResponse> {
5957
return this._client.getAPIList('/deployments', OffsetPagination<DeploymentListResponse>, {
@@ -384,7 +382,7 @@ export interface DeploymentListParams extends OffsetPaginationParams {
384382
/**
385383
* Filter results by application name.
386384
*/
387-
app_name: string;
385+
app_name?: string;
388386
}
389387

390388
export interface DeploymentFollowParams {

tests/api-resources/deployments.test.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ describe('resource deployments', () => {
4848
});
4949

5050
// Prism tests are disabled
51-
test.skip('list: only required params', async () => {
52-
const responsePromise = client.deployments.list({ app_name: 'app_name' });
51+
test.skip('list', async () => {
52+
const responsePromise = client.deployments.list();
5353
const rawResponse = await responsePromise.asResponse();
5454
expect(rawResponse).toBeInstanceOf(Response);
5555
const response = await responsePromise;
@@ -60,8 +60,14 @@ describe('resource deployments', () => {
6060
});
6161

6262
// Prism tests are disabled
63-
test.skip('list: required and optional params', async () => {
64-
const response = await client.deployments.list({ app_name: 'app_name', limit: 1, offset: 0 });
63+
test.skip('list: request options and params are passed correctly', async () => {
64+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
65+
await expect(
66+
client.deployments.list(
67+
{ app_name: 'app_name', limit: 1, offset: 0 },
68+
{ path: '/_stainless_unknown_path' },
69+
),
70+
).rejects.toThrow(Kernel.NotFoundError);
6571
});
6672

6773
// Prism doesn't support text/event-stream responses

0 commit comments

Comments
 (0)