|
1 | 1 | import { Client } from '../../Client' |
2 | | -import { StaysBooking } from '../StaysTypes' |
| 2 | +import { ListParamsBookings, StaysBooking } from '../StaysTypes' |
3 | 3 | import { Resource } from '../../Resource' |
4 | 4 | import { DuffelResponse, PaginationMeta } from '../../types' |
5 | 5 |
|
@@ -70,19 +70,18 @@ export class Bookings extends Resource { |
70 | 70 | * @link https://duffel.com/docs/api/bookings/list-bookings |
71 | 71 | */ |
72 | 72 | public list = async ( |
73 | | - options?: PaginationMeta, |
| 73 | + options?: PaginationMeta & ListParamsBookings, |
74 | 74 | ): Promise<DuffelResponse<StaysBooking[]>> => |
75 | 75 | this.request({ method: 'GET', path: this.path, params: options }) |
76 | 76 |
|
77 | 77 | /** |
78 | 78 | * Retrieves a generator of all bookings. The results may be returned in any order. |
79 | 79 | * @link https://duffel.com/docs/api/bookings/list-bookings |
80 | 80 | */ |
81 | | - public listWithGenerator = (): AsyncGenerator< |
82 | | - DuffelResponse<StaysBooking>, |
83 | | - void, |
84 | | - unknown |
85 | | - > => this.paginatedRequest({ path: this.path }) |
| 81 | + public listWithGenerator = ( |
| 82 | + options?: ListParamsBookings, |
| 83 | + ): AsyncGenerator<DuffelResponse<StaysBooking>, void, unknown> => |
| 84 | + this.paginatedRequest({ path: this.path, params: options }) |
86 | 85 |
|
87 | 86 | /** |
88 | 87 | * Cancel a booking |
|
0 commit comments