Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Apr 24, 2024
1 parent a8e79bc commit 50d595e
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 7 deletions.
16 changes: 13 additions & 3 deletions src/resources/waiting-rooms/events/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ export class Events extends APIResource {
params: EventListParams,
options?: Core.RequestOptions,
): Core.PagePromise<EventsSinglePage, Event> {
const { zone_id } = params;
const { zone_id, ...query } = params;
return this._client.getAPIList(
`/zones/${zone_id}/waiting_rooms/${waitingRoomId}/events`,
EventsSinglePage,
options,
{ query, ...options },
);
}

Expand Down Expand Up @@ -412,9 +412,19 @@ export interface EventUpdateParams {

export interface EventListParams {
/**
* 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 EventDeleteParams {
Expand Down
19 changes: 16 additions & 3 deletions src/resources/waiting-rooms/waiting-rooms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ export class WaitingRooms extends APIResource {
params: WaitingRoomListParams,
options?: Core.RequestOptions,
): Core.PagePromise<WaitingRoomsSinglePage, WaitingRoom> {
const { zone_id } = params;
return this._client.getAPIList(`/zones/${zone_id}/waiting_rooms`, WaitingRoomsSinglePage, options);
const { zone_id, ...query } = params;
return this._client.getAPIList(`/zones/${zone_id}/waiting_rooms`, WaitingRoomsSinglePage, {
query,
...options,
});
}

/**
Expand Down Expand Up @@ -1502,9 +1505,19 @@ export interface WaitingRoomUpdateParams {

export interface WaitingRoomListParams {
/**
* 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 WaitingRoomDeleteParams {
Expand Down
2 changes: 2 additions & 0 deletions tests/api-resources/waiting-rooms/events/events.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ describe('resource events', () => {
test.skip('list: required and optional params', async () => {
const response = await cloudflare.waitingRooms.events.list('699d98642c564d2e855e9661899b7252', {
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
page: {},
per_page: {},
});
});

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

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

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

0 comments on commit 50d595e

Please sign in to comment.