containers.d.mts 7.6 KB

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