input-items.d.ts 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import { APIResource } from "../../resource.js";
  2. import * as Core from "../../core.js";
  3. import * as ResponsesAPI from "./responses.js";
  4. import { ResponseItemsPage } from "./responses.js";
  5. import { type CursorPageParams } from "../../pagination.js";
  6. export declare class InputItems extends APIResource {
  7. /**
  8. * Returns a list of input items for a given response.
  9. *
  10. * @example
  11. * ```ts
  12. * // Automatically fetches more pages as needed.
  13. * for await (const responseItem of client.responses.inputItems.list(
  14. * 'response_id',
  15. * )) {
  16. * // ...
  17. * }
  18. * ```
  19. */
  20. list(responseId: string, query?: InputItemListParams, options?: Core.RequestOptions): Core.PagePromise<ResponseItemsPage, ResponsesAPI.ResponseItem>;
  21. list(responseId: string, options?: Core.RequestOptions): Core.PagePromise<ResponseItemsPage, ResponsesAPI.ResponseItem>;
  22. }
  23. /**
  24. * A list of Response items.
  25. */
  26. export interface ResponseItemList {
  27. /**
  28. * A list of items used to generate this response.
  29. */
  30. data: Array<ResponsesAPI.ResponseItem>;
  31. /**
  32. * The ID of the first item in the list.
  33. */
  34. first_id: string;
  35. /**
  36. * Whether there are more items available.
  37. */
  38. has_more: boolean;
  39. /**
  40. * The ID of the last item in the list.
  41. */
  42. last_id: string;
  43. /**
  44. * The type of object returned, must be `list`.
  45. */
  46. object: 'list';
  47. }
  48. export interface InputItemListParams extends CursorPageParams {
  49. /**
  50. * An item ID to list items before, used in pagination.
  51. */
  52. before?: string;
  53. /**
  54. * Additional fields to include in the response. See the `include` parameter for
  55. * Response creation above for more information.
  56. */
  57. include?: Array<ResponsesAPI.ResponseIncludable>;
  58. /**
  59. * The order to return the input items in. Default is `desc`.
  60. *
  61. * - `asc`: Return the input items in ascending order.
  62. * - `desc`: Return the input items in descending order.
  63. */
  64. order?: 'asc' | 'desc';
  65. }
  66. export declare namespace InputItems {
  67. export { type ResponseItemList as ResponseItemList, type InputItemListParams as InputItemListParams };
  68. }
  69. export { ResponseItemsPage };
  70. //# sourceMappingURL=input-items.d.ts.map