containers.d.ts 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. import { APIResource } from "../../resource.js";
  2. import * as Core from "../../core.js";
  3. import * as FilesAPI from "./files/files.js";
  4. import { FileCreateParams, FileCreateResponse, FileListParams, FileListResponse, FileListResponsesPage, FileRetrieveResponse, Files } from "./files/files.js";
  5. import { CursorPage, type CursorPageParams } from "../../pagination.js";
  6. export declare class Containers extends APIResource {
  7. files: FilesAPI.Files;
  8. /**
  9. * Create Container
  10. */
  11. create(body: ContainerCreateParams, options?: Core.RequestOptions): Core.APIPromise<ContainerCreateResponse>;
  12. /**
  13. * Retrieve Container
  14. */
  15. retrieve(containerId: string, options?: Core.RequestOptions): Core.APIPromise<ContainerRetrieveResponse>;
  16. /**
  17. * List Containers
  18. */
  19. list(query?: ContainerListParams, options?: Core.RequestOptions): Core.PagePromise<ContainerListResponsesPage, ContainerListResponse>;
  20. list(options?: Core.RequestOptions): Core.PagePromise<ContainerListResponsesPage, ContainerListResponse>;
  21. /**
  22. * Delete Container
  23. */
  24. del(containerId: string, options?: Core.RequestOptions): Core.APIPromise<void>;
  25. }
  26. export declare class ContainerListResponsesPage extends CursorPage<ContainerListResponse> {
  27. }
  28. export interface ContainerCreateResponse {
  29. /**
  30. * Unique identifier for the container.
  31. */
  32. id: string;
  33. /**
  34. * Unix timestamp (in seconds) when the container was created.
  35. */
  36. created_at: number;
  37. /**
  38. * Name of the container.
  39. */
  40. name: string;
  41. /**
  42. * The type of this object.
  43. */
  44. object: string;
  45. /**
  46. * Status of the container (e.g., active, deleted).
  47. */
  48. status: string;
  49. /**
  50. * The container will expire after this time period. The anchor is the reference
  51. * point for the expiration. The minutes is the number of minutes after the anchor
  52. * before the container expires.
  53. */
  54. expires_after?: ContainerCreateResponse.ExpiresAfter;
  55. }
  56. export declare namespace ContainerCreateResponse {
  57. /**
  58. * The container will expire after this time period. The anchor is the reference
  59. * point for the expiration. The minutes is the number of minutes after the anchor
  60. * before the container expires.
  61. */
  62. interface ExpiresAfter {
  63. /**
  64. * The reference point for the expiration.
  65. */
  66. anchor?: 'last_active_at';
  67. /**
  68. * The number of minutes after the anchor before the container expires.
  69. */
  70. minutes?: number;
  71. }
  72. }
  73. export interface ContainerRetrieveResponse {
  74. /**
  75. * Unique identifier for the container.
  76. */
  77. id: string;
  78. /**
  79. * Unix timestamp (in seconds) when the container was created.
  80. */
  81. created_at: number;
  82. /**
  83. * Name of the container.
  84. */
  85. name: string;
  86. /**
  87. * The type of this object.
  88. */
  89. object: string;
  90. /**
  91. * Status of the container (e.g., active, deleted).
  92. */
  93. status: string;
  94. /**
  95. * The container will expire after this time period. The anchor is the reference
  96. * point for the expiration. The minutes is the number of minutes after the anchor
  97. * before the container expires.
  98. */
  99. expires_after?: ContainerRetrieveResponse.ExpiresAfter;
  100. }
  101. export declare namespace ContainerRetrieveResponse {
  102. /**
  103. * The container will expire after this time period. The anchor is the reference
  104. * point for the expiration. The minutes is the number of minutes after the anchor
  105. * before the container expires.
  106. */
  107. interface ExpiresAfter {
  108. /**
  109. * The reference point for the expiration.
  110. */
  111. anchor?: 'last_active_at';
  112. /**
  113. * The number of minutes after the anchor before the container expires.
  114. */
  115. minutes?: number;
  116. }
  117. }
  118. export interface ContainerListResponse {
  119. /**
  120. * Unique identifier for the container.
  121. */
  122. id: string;
  123. /**
  124. * Unix timestamp (in seconds) when the container was created.
  125. */
  126. created_at: number;
  127. /**
  128. * Name of the container.
  129. */
  130. name: string;
  131. /**
  132. * The type of this object.
  133. */
  134. object: string;
  135. /**
  136. * Status of the container (e.g., active, deleted).
  137. */
  138. status: string;
  139. /**
  140. * The container will expire after this time period. The anchor is the reference
  141. * point for the expiration. The minutes is the number of minutes after the anchor
  142. * before the container expires.
  143. */
  144. expires_after?: ContainerListResponse.ExpiresAfter;
  145. }
  146. export declare namespace ContainerListResponse {
  147. /**
  148. * The container will expire after this time period. The anchor is the reference
  149. * point for the expiration. The minutes is the number of minutes after the anchor
  150. * before the container expires.
  151. */
  152. interface ExpiresAfter {
  153. /**
  154. * The reference point for the expiration.
  155. */
  156. anchor?: 'last_active_at';
  157. /**
  158. * The number of minutes after the anchor before the container expires.
  159. */
  160. minutes?: number;
  161. }
  162. }
  163. export interface ContainerCreateParams {
  164. /**
  165. * Name of the container to create.
  166. */
  167. name: string;
  168. /**
  169. * Container expiration time in seconds relative to the 'anchor' time.
  170. */
  171. expires_after?: ContainerCreateParams.ExpiresAfter;
  172. /**
  173. * IDs of files to copy to the container.
  174. */
  175. file_ids?: Array<string>;
  176. }
  177. export declare namespace ContainerCreateParams {
  178. /**
  179. * Container expiration time in seconds relative to the 'anchor' time.
  180. */
  181. interface ExpiresAfter {
  182. /**
  183. * Time anchor for the expiration time. Currently only 'last_active_at' is
  184. * supported.
  185. */
  186. anchor: 'last_active_at';
  187. minutes: number;
  188. }
  189. }
  190. export interface ContainerListParams extends CursorPageParams {
  191. /**
  192. * Sort order by the `created_at` timestamp of the objects. `asc` for ascending
  193. * order and `desc` for descending order.
  194. */
  195. order?: 'asc' | 'desc';
  196. }
  197. export declare namespace Containers {
  198. export { type ContainerCreateResponse as ContainerCreateResponse, type ContainerRetrieveResponse as ContainerRetrieveResponse, type ContainerListResponse as ContainerListResponse, ContainerListResponsesPage as ContainerListResponsesPage, type ContainerCreateParams as ContainerCreateParams, type ContainerListParams as ContainerListParams, };
  199. export { Files as Files, type FileCreateResponse as FileCreateResponse, type FileRetrieveResponse as FileRetrieveResponse, type FileListResponse as FileListResponse, FileListResponsesPage as FileListResponsesPage, type FileCreateParams as FileCreateParams, type FileListParams as FileListParams, };
  200. }
  201. //# sourceMappingURL=containers.d.ts.map