Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): OpenAPI spec update via Stainless API #320

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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