Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 16, 2024
1 parent 865bfbe commit 63c0da2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
19 changes: 16 additions & 3 deletions src/resources/healthchecks/healthchecks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ export class Healthchecks extends APIResource {
params: HealthcheckListParams,
options?: Core.RequestOptions,
): Core.PagePromise<HealthchecksSinglePage, Healthcheck> {
const { zone_id } = params;
return this._client.getAPIList(`/zones/${zone_id}/healthchecks`, HealthchecksSinglePage, options);
const { zone_id, ...query } = params;
return this._client.getAPIList(`/zones/${zone_id}/healthchecks`, HealthchecksSinglePage, {
query,
...options,
});
}

/**
Expand Down Expand Up @@ -528,9 +531,19 @@ export interface HealthcheckUpdateParams {

export interface HealthcheckListParams {
/**
* Identifier
* Path param: Identifier
*/
zone_id: string;

/**
* Query param: Page number of paginated results.
*/
page?: unknown;

/**
* Query param: Maximum number of results per page. Must be a multiple of 5.
*/
per_page?: unknown;
}

export interface HealthcheckDeleteParams {
Expand Down
6 changes: 5 additions & 1 deletion tests/api-resources/healthchecks/healthchecks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ describe('resource healthchecks', () => {

// skipped: tests are disabled for the time being
test.skip('list: required and optional params', async () => {
const response = await cloudflare.healthchecks.list({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' });
const response = await cloudflare.healthchecks.list({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
page: {},
per_page: {},
});
});

// skipped: tests are disabled for the time being
Expand Down

0 comments on commit 63c0da2

Please sign in to comment.