@nirvana-labs/nirvana 1.20.3 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +31 -0
  3. package/client.d.mts +7 -0
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +7 -0
  6. package/client.d.ts.map +1 -1
  7. package/client.js +8 -0
  8. package/client.js.map +1 -1
  9. package/client.mjs +8 -0
  10. package/client.mjs.map +1 -1
  11. package/core/pagination.d.mts +61 -0
  12. package/core/pagination.d.mts.map +1 -0
  13. package/core/pagination.d.ts +61 -0
  14. package/core/pagination.d.ts.map +1 -0
  15. package/core/pagination.js +101 -0
  16. package/core/pagination.js.map +1 -0
  17. package/core/pagination.mjs +95 -0
  18. package/core/pagination.mjs.map +1 -0
  19. package/index.d.mts +1 -0
  20. package/index.d.mts.map +1 -1
  21. package/index.d.ts +1 -0
  22. package/index.d.ts.map +1 -1
  23. package/index.js +3 -1
  24. package/index.js.map +1 -1
  25. package/index.mjs +1 -0
  26. package/index.mjs.map +1 -1
  27. package/internal/tslib.js +18 -18
  28. package/package.json +11 -1
  29. package/pagination.d.mts +2 -0
  30. package/pagination.d.mts.map +1 -0
  31. package/pagination.d.ts +2 -0
  32. package/pagination.d.ts.map +1 -0
  33. package/pagination.js +6 -0
  34. package/pagination.js.map +1 -0
  35. package/pagination.mjs +2 -0
  36. package/pagination.mjs.map +1 -0
  37. package/resources/api-keys.d.mts +16 -4
  38. package/resources/api-keys.d.mts.map +1 -1
  39. package/resources/api-keys.d.ts +16 -4
  40. package/resources/api-keys.d.ts.map +1 -1
  41. package/resources/api-keys.js +8 -4
  42. package/resources/api-keys.js.map +1 -1
  43. package/resources/api-keys.mjs +8 -4
  44. package/resources/api-keys.mjs.map +1 -1
  45. package/resources/compute/compute.d.mts +4 -4
  46. package/resources/compute/compute.d.mts.map +1 -1
  47. package/resources/compute/compute.d.ts +4 -4
  48. package/resources/compute/compute.d.ts.map +1 -1
  49. package/resources/compute/compute.js.map +1 -1
  50. package/resources/compute/compute.mjs.map +1 -1
  51. package/resources/compute/index.d.mts +2 -2
  52. package/resources/compute/index.d.mts.map +1 -1
  53. package/resources/compute/index.d.ts +2 -2
  54. package/resources/compute/index.d.ts.map +1 -1
  55. package/resources/compute/index.js.map +1 -1
  56. package/resources/compute/index.mjs.map +1 -1
  57. package/resources/compute/vms/index.d.mts +3 -3
  58. package/resources/compute/vms/index.d.mts.map +1 -1
  59. package/resources/compute/vms/index.d.ts +3 -3
  60. package/resources/compute/vms/index.d.ts.map +1 -1
  61. package/resources/compute/vms/index.js.map +1 -1
  62. package/resources/compute/vms/index.mjs.map +1 -1
  63. package/resources/compute/vms/os-images.d.mts +11 -5
  64. package/resources/compute/vms/os-images.d.mts.map +1 -1
  65. package/resources/compute/vms/os-images.d.ts +11 -5
  66. package/resources/compute/vms/os-images.d.ts.map +1 -1
  67. package/resources/compute/vms/os-images.js +10 -3
  68. package/resources/compute/vms/os-images.js.map +1 -1
  69. package/resources/compute/vms/os-images.mjs +10 -3
  70. package/resources/compute/vms/os-images.mjs.map +1 -1
  71. package/resources/compute/vms/vms.d.mts +19 -7
  72. package/resources/compute/vms/vms.d.mts.map +1 -1
  73. package/resources/compute/vms/vms.d.ts +19 -7
  74. package/resources/compute/vms/vms.d.ts.map +1 -1
  75. package/resources/compute/vms/vms.js +7 -3
  76. package/resources/compute/vms/vms.js.map +1 -1
  77. package/resources/compute/vms/vms.mjs +7 -3
  78. package/resources/compute/vms/vms.mjs.map +1 -1
  79. package/resources/compute/vms/volumes.d.mts +15 -5
  80. package/resources/compute/vms/volumes.d.mts.map +1 -1
  81. package/resources/compute/vms/volumes.d.ts +15 -5
  82. package/resources/compute/vms/volumes.d.ts.map +1 -1
  83. package/resources/compute/vms/volumes.js +11 -4
  84. package/resources/compute/vms/volumes.js.map +1 -1
  85. package/resources/compute/vms/volumes.mjs +11 -4
  86. package/resources/compute/vms/volumes.mjs.map +1 -1
  87. package/resources/compute/volumes/index.d.mts +1 -1
  88. package/resources/compute/volumes/index.d.mts.map +1 -1
  89. package/resources/compute/volumes/index.d.ts +1 -1
  90. package/resources/compute/volumes/index.d.ts.map +1 -1
  91. package/resources/compute/volumes/index.js.map +1 -1
  92. package/resources/compute/volumes/index.mjs.map +1 -1
  93. package/resources/compute/volumes/volumes.d.mts +14 -3
  94. package/resources/compute/volumes/volumes.d.mts.map +1 -1
  95. package/resources/compute/volumes/volumes.d.ts +14 -3
  96. package/resources/compute/volumes/volumes.d.ts.map +1 -1
  97. package/resources/compute/volumes/volumes.js +7 -3
  98. package/resources/compute/volumes/volumes.js.map +1 -1
  99. package/resources/compute/volumes/volumes.mjs +7 -3
  100. package/resources/compute/volumes/volumes.mjs.map +1 -1
  101. package/resources/networking/connect/connect.d.mts +15 -4
  102. package/resources/networking/connect/connect.d.mts.map +1 -1
  103. package/resources/networking/connect/connect.d.ts +15 -4
  104. package/resources/networking/connect/connect.d.ts.map +1 -1
  105. package/resources/networking/connect/connect.js.map +1 -1
  106. package/resources/networking/connect/connect.mjs +1 -1
  107. package/resources/networking/connect/connect.mjs.map +1 -1
  108. package/resources/networking/connect/connections.d.mts +11 -4
  109. package/resources/networking/connect/connections.d.mts.map +1 -1
  110. package/resources/networking/connect/connections.d.ts +11 -4
  111. package/resources/networking/connect/connections.d.ts.map +1 -1
  112. package/resources/networking/connect/connections.js +7 -4
  113. package/resources/networking/connect/connections.js.map +1 -1
  114. package/resources/networking/connect/connections.mjs +7 -4
  115. package/resources/networking/connect/connections.mjs.map +1 -1
  116. package/resources/networking/connect/index.d.mts +3 -3
  117. package/resources/networking/connect/index.d.mts.map +1 -1
  118. package/resources/networking/connect/index.d.ts +3 -3
  119. package/resources/networking/connect/index.d.ts.map +1 -1
  120. package/resources/networking/connect/index.js.map +1 -1
  121. package/resources/networking/connect/index.mjs +1 -1
  122. package/resources/networking/connect/index.mjs.map +1 -1
  123. package/resources/networking/connect/routes.d.mts +13 -4
  124. package/resources/networking/connect/routes.d.mts.map +1 -1
  125. package/resources/networking/connect/routes.d.ts +13 -4
  126. package/resources/networking/connect/routes.d.ts.map +1 -1
  127. package/resources/networking/connect/routes.js +10 -4
  128. package/resources/networking/connect/routes.js.map +1 -1
  129. package/resources/networking/connect/routes.mjs +10 -4
  130. package/resources/networking/connect/routes.mjs.map +1 -1
  131. package/resources/networking/firewall-rules.d.mts +16 -4
  132. package/resources/networking/firewall-rules.d.mts.map +1 -1
  133. package/resources/networking/firewall-rules.d.ts +16 -4
  134. package/resources/networking/firewall-rules.d.ts.map +1 -1
  135. package/resources/networking/firewall-rules.js +12 -4
  136. package/resources/networking/firewall-rules.js.map +1 -1
  137. package/resources/networking/firewall-rules.mjs +12 -4
  138. package/resources/networking/firewall-rules.mjs.map +1 -1
  139. package/resources/networking/index.d.mts +3 -3
  140. package/resources/networking/index.d.mts.map +1 -1
  141. package/resources/networking/index.d.ts +3 -3
  142. package/resources/networking/index.d.ts.map +1 -1
  143. package/resources/networking/index.js.map +1 -1
  144. package/resources/networking/index.mjs.map +1 -1
  145. package/resources/networking/networking.d.mts +4 -4
  146. package/resources/networking/networking.d.mts.map +1 -1
  147. package/resources/networking/networking.d.ts +4 -4
  148. package/resources/networking/networking.d.ts.map +1 -1
  149. package/resources/networking/networking.js.map +1 -1
  150. package/resources/networking/networking.mjs +1 -1
  151. package/resources/networking/networking.mjs.map +1 -1
  152. package/resources/networking/vpcs/index.d.mts +1 -1
  153. package/resources/networking/vpcs/index.d.mts.map +1 -1
  154. package/resources/networking/vpcs/index.d.ts +1 -1
  155. package/resources/networking/vpcs/index.d.ts.map +1 -1
  156. package/resources/networking/vpcs/index.js.map +1 -1
  157. package/resources/networking/vpcs/index.mjs.map +1 -1
  158. package/resources/networking/vpcs/vpcs.d.mts +14 -3
  159. package/resources/networking/vpcs/vpcs.d.mts.map +1 -1
  160. package/resources/networking/vpcs/vpcs.d.ts +14 -3
  161. package/resources/networking/vpcs/vpcs.d.ts.map +1 -1
  162. package/resources/networking/vpcs/vpcs.js +7 -3
  163. package/resources/networking/vpcs/vpcs.js.map +1 -1
  164. package/resources/networking/vpcs/vpcs.mjs +7 -3
  165. package/resources/networking/vpcs/vpcs.mjs.map +1 -1
  166. package/resources/operations.d.mts +11 -2
  167. package/resources/operations.d.mts.map +1 -1
  168. package/resources/operations.d.ts +11 -2
  169. package/resources/operations.d.ts.map +1 -1
  170. package/resources/operations.js +3 -2
  171. package/resources/operations.js.map +1 -1
  172. package/resources/operations.mjs +3 -2
  173. package/resources/operations.mjs.map +1 -1
  174. package/resources/rpc-nodes/dedicated/blockchains.d.mts +13 -4
  175. package/resources/rpc-nodes/dedicated/blockchains.d.mts.map +1 -1
  176. package/resources/rpc-nodes/dedicated/blockchains.d.ts +13 -4
  177. package/resources/rpc-nodes/dedicated/blockchains.d.ts.map +1 -1
  178. package/resources/rpc-nodes/dedicated/blockchains.js +7 -4
  179. package/resources/rpc-nodes/dedicated/blockchains.js.map +1 -1
  180. package/resources/rpc-nodes/dedicated/blockchains.mjs +7 -4
  181. package/resources/rpc-nodes/dedicated/blockchains.mjs.map +1 -1
  182. package/resources/rpc-nodes/dedicated/dedicated.d.mts +22 -6
  183. package/resources/rpc-nodes/dedicated/dedicated.d.mts.map +1 -1
  184. package/resources/rpc-nodes/dedicated/dedicated.d.ts +22 -6
  185. package/resources/rpc-nodes/dedicated/dedicated.d.ts.map +1 -1
  186. package/resources/rpc-nodes/dedicated/dedicated.js +7 -4
  187. package/resources/rpc-nodes/dedicated/dedicated.js.map +1 -1
  188. package/resources/rpc-nodes/dedicated/dedicated.mjs +7 -4
  189. package/resources/rpc-nodes/dedicated/dedicated.mjs.map +1 -1
  190. package/resources/rpc-nodes/dedicated/index.d.mts +2 -2
  191. package/resources/rpc-nodes/dedicated/index.d.mts.map +1 -1
  192. package/resources/rpc-nodes/dedicated/index.d.ts +2 -2
  193. package/resources/rpc-nodes/dedicated/index.d.ts.map +1 -1
  194. package/resources/rpc-nodes/dedicated/index.js.map +1 -1
  195. package/resources/rpc-nodes/dedicated/index.mjs.map +1 -1
  196. package/resources/rpc-nodes/flex/blockchains.d.mts +13 -4
  197. package/resources/rpc-nodes/flex/blockchains.d.mts.map +1 -1
  198. package/resources/rpc-nodes/flex/blockchains.d.ts +13 -4
  199. package/resources/rpc-nodes/flex/blockchains.d.ts.map +1 -1
  200. package/resources/rpc-nodes/flex/blockchains.js +10 -4
  201. package/resources/rpc-nodes/flex/blockchains.js.map +1 -1
  202. package/resources/rpc-nodes/flex/blockchains.mjs +10 -4
  203. package/resources/rpc-nodes/flex/blockchains.mjs.map +1 -1
  204. package/resources/rpc-nodes/flex/flex.d.mts +22 -5
  205. package/resources/rpc-nodes/flex/flex.d.mts.map +1 -1
  206. package/resources/rpc-nodes/flex/flex.d.ts +22 -5
  207. package/resources/rpc-nodes/flex/flex.d.ts.map +1 -1
  208. package/resources/rpc-nodes/flex/flex.js +7 -3
  209. package/resources/rpc-nodes/flex/flex.js.map +1 -1
  210. package/resources/rpc-nodes/flex/flex.mjs +7 -3
  211. package/resources/rpc-nodes/flex/flex.mjs.map +1 -1
  212. package/resources/rpc-nodes/flex/index.d.mts +2 -2
  213. package/resources/rpc-nodes/flex/index.d.mts.map +1 -1
  214. package/resources/rpc-nodes/flex/index.d.ts +2 -2
  215. package/resources/rpc-nodes/flex/index.d.ts.map +1 -1
  216. package/resources/rpc-nodes/flex/index.js.map +1 -1
  217. package/resources/rpc-nodes/flex/index.mjs.map +1 -1
  218. package/resources/rpc-nodes/index.d.mts +2 -2
  219. package/resources/rpc-nodes/index.d.mts.map +1 -1
  220. package/resources/rpc-nodes/index.d.ts +2 -2
  221. package/resources/rpc-nodes/index.d.ts.map +1 -1
  222. package/resources/rpc-nodes/index.js.map +1 -1
  223. package/resources/rpc-nodes/index.mjs.map +1 -1
  224. package/resources/rpc-nodes/rpc-nodes.d.mts +4 -4
  225. package/resources/rpc-nodes/rpc-nodes.d.mts.map +1 -1
  226. package/resources/rpc-nodes/rpc-nodes.d.ts +4 -4
  227. package/resources/rpc-nodes/rpc-nodes.d.ts.map +1 -1
  228. package/resources/rpc-nodes/rpc-nodes.js.map +1 -1
  229. package/resources/rpc-nodes/rpc-nodes.mjs.map +1 -1
  230. package/resources/shared.d.mts +8 -0
  231. package/resources/shared.d.mts.map +1 -1
  232. package/resources/shared.d.ts +8 -0
  233. package/resources/shared.d.ts.map +1 -1
  234. package/src/client.ts +25 -0
  235. package/src/core/pagination.ts +167 -0
  236. package/src/index.ts +1 -0
  237. package/src/pagination.ts +2 -0
  238. package/src/resources/api-keys.ts +23 -4
  239. package/src/resources/compute/compute.ts +8 -0
  240. package/src/resources/compute/index.ts +5 -0
  241. package/src/resources/compute/vms/index.ts +5 -2
  242. package/src/resources/compute/vms/os-images.ts +18 -6
  243. package/src/resources/compute/vms/vms.ts +24 -7
  244. package/src/resources/compute/vms/volumes.ts +25 -6
  245. package/src/resources/compute/volumes/index.ts +2 -0
  246. package/src/resources/compute/volumes/volumes.ts +21 -3
  247. package/src/resources/networking/connect/connect.ts +24 -3
  248. package/src/resources/networking/connect/connections.ts +20 -4
  249. package/src/resources/networking/connect/index.ts +9 -2
  250. package/src/resources/networking/connect/routes.ts +22 -5
  251. package/src/resources/networking/firewall-rules.ts +27 -4
  252. package/src/resources/networking/index.ts +6 -0
  253. package/src/resources/networking/networking.ts +16 -1
  254. package/src/resources/networking/vpcs/index.ts +2 -0
  255. package/src/resources/networking/vpcs/vpcs.ts +18 -3
  256. package/src/resources/operations.ts +18 -2
  257. package/src/resources/rpc-nodes/dedicated/blockchains.ts +23 -5
  258. package/src/resources/rpc-nodes/dedicated/dedicated.ts +31 -6
  259. package/src/resources/rpc-nodes/dedicated/index.ts +4 -1
  260. package/src/resources/rpc-nodes/flex/blockchains.ts +22 -5
  261. package/src/resources/rpc-nodes/flex/flex.ts +31 -5
  262. package/src/resources/rpc-nodes/flex/index.ts +4 -1
  263. package/src/resources/rpc-nodes/index.ts +6 -0
  264. package/src/resources/rpc-nodes/rpc-nodes.ts +8 -0
  265. package/src/resources/shared.ts +11 -0
  266. package/src/version.ts +1 -1
  267. package/version.d.mts +1 -1
  268. package/version.d.ts +1 -1
  269. package/version.js +1 -1
  270. package/version.mjs +1 -1
@@ -12,10 +12,11 @@ import {
12
12
  AvailabilityUpdateResponse,
13
13
  } from './availability';
14
14
  import * as OSImagesAPI from './os-images';
15
- import { OSImageListResponse, OSImages } from './os-images';
15
+ import { OSImageListParams, OSImages } from './os-images';
16
16
  import * as VolumesAPI from './volumes';
17
- import { Volumes } from './volumes';
17
+ import { VolumeListParams, Volumes } from './volumes';
18
18
  import { APIPromise } from '../../../core/api-promise';
19
+ import { Cursor, type CursorParams, PagePromise } from '../../../core/pagination';
19
20
  import { RequestOptions } from '../../../internal/request-options';
20
21
  import { path } from '../../../internal/utils/path';
21
22
 
@@ -66,11 +67,14 @@ export class VMs extends APIResource {
66
67
  *
67
68
  * @example
68
69
  * ```ts
69
- * const vmList = await client.compute.vms.list();
70
+ * // Automatically fetches more pages as needed.
71
+ * for await (const vm of client.compute.vms.list()) {
72
+ * // ...
73
+ * }
70
74
  * ```
71
75
  */
72
- list(options?: RequestOptions): APIPromise<VMList> {
73
- return this._client.get('/v1/compute/vms', options);
76
+ list(query: VMListParams | null | undefined = {}, options?: RequestOptions): PagePromise<VMsCursor, VM> {
77
+ return this._client.getAPIList('/v1/compute/vms', Cursor<VM>, { query, ...options });
74
78
  }
75
79
 
76
80
  /**
@@ -110,6 +114,10 @@ export class VMs extends APIResource {
110
114
  }
111
115
  }
112
116
 
117
+ export type VMsCursor = Cursor<VM>;
118
+
119
+ export type OSImagesCursor = Cursor<OSImage>;
120
+
113
121
  /**
114
122
  * CPU configuration for the VM.
115
123
  */
@@ -272,6 +280,11 @@ export interface VM {
272
280
 
273
281
  export interface VMList {
274
282
  items: Array<VM>;
283
+
284
+ /**
285
+ * Pagination response details.
286
+ */
287
+ pagination: Shared.Pagination;
275
288
  }
276
289
 
277
290
  export interface VMCreateParams {
@@ -395,6 +408,8 @@ export interface VMUpdateParams {
395
408
  tags?: Array<string>;
396
409
  }
397
410
 
411
+ export interface VMListParams extends CursorParams {}
412
+
398
413
  VMs.Availability = Availability;
399
414
  VMs.Volumes = Volumes;
400
415
  VMs.OSImages = OSImages;
@@ -409,8 +424,10 @@ export declare namespace VMs {
409
424
  type SSHKeyRequest as SSHKeyRequest,
410
425
  type VM as VM,
411
426
  type VMList as VMList,
427
+ type VMsCursor as VMsCursor,
412
428
  type VMCreateParams as VMCreateParams,
413
429
  type VMUpdateParams as VMUpdateParams,
430
+ type VMListParams as VMListParams,
414
431
  };
415
432
 
416
433
  export {
@@ -421,7 +438,7 @@ export declare namespace VMs {
421
438
  type AvailabilityUpdateParams as AvailabilityUpdateParams,
422
439
  };
423
440
 
424
- export { Volumes as Volumes };
441
+ export { Volumes as Volumes, type VolumeListParams as VolumeListParams };
425
442
 
426
- export { OSImages as OSImages, type OSImageListResponse as OSImageListResponse };
443
+ export { OSImages as OSImages, type OSImageListParams as OSImageListParams };
427
444
  }
@@ -1,8 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../../core/resource';
4
- import * as VolumesAPI from '../volumes/volumes';
5
- import { APIPromise } from '../../../core/api-promise';
4
+ import * as VolumesVolumesAPI from '../volumes/volumes';
5
+ import { VolumesCursor } from '../volumes/volumes';
6
+ import { Cursor, type CursorParams, PagePromise } from '../../../core/pagination';
6
7
  import { RequestOptions } from '../../../internal/request-options';
7
8
  import { path } from '../../../internal/utils/path';
8
9
 
@@ -12,12 +13,30 @@ export class Volumes extends APIResource {
12
13
  *
13
14
  * @example
14
15
  * ```ts
15
- * const volumeList = await client.compute.vms.volumes.list(
16
+ * // Automatically fetches more pages as needed.
17
+ * for await (const volume of client.compute.vms.volumes.list(
16
18
  * 'vm_id',
17
- * );
19
+ * )) {
20
+ * // ...
21
+ * }
18
22
  * ```
19
23
  */
20
- list(vmID: string, options?: RequestOptions): APIPromise<VolumesAPI.VolumeList> {
21
- return this._client.get(path`/v1/compute/vms/${vmID}/volumes`, options);
24
+ list(
25
+ vmID: string,
26
+ query: VolumeListParams | null | undefined = {},
27
+ options?: RequestOptions,
28
+ ): PagePromise<VolumesCursor, VolumesVolumesAPI.Volume> {
29
+ return this._client.getAPIList(path`/v1/compute/vms/${vmID}/volumes`, Cursor<VolumesVolumesAPI.Volume>, {
30
+ query,
31
+ ...options,
32
+ });
22
33
  }
23
34
  }
35
+
36
+ export interface VolumeListParams extends CursorParams {}
37
+
38
+ export declare namespace Volumes {
39
+ export { type VolumeListParams as VolumeListParams };
40
+ }
41
+
42
+ export { type VolumesCursor };
@@ -15,4 +15,6 @@ export {
15
15
  type VolumeList,
16
16
  type VolumeCreateParams,
17
17
  type VolumeUpdateParams,
18
+ type VolumeListParams,
19
+ type VolumesCursor,
18
20
  } from './volumes';
@@ -12,6 +12,7 @@ import {
12
12
  AvailabilityUpdateResponse,
13
13
  } from './availability';
14
14
  import { APIPromise } from '../../../core/api-promise';
15
+ import { Cursor, type CursorParams, PagePromise } from '../../../core/pagination';
15
16
  import { RequestOptions } from '../../../internal/request-options';
16
17
  import { path } from '../../../internal/utils/path';
17
18
 
@@ -57,11 +58,17 @@ export class Volumes extends APIResource {
57
58
  *
58
59
  * @example
59
60
  * ```ts
60
- * const volumeList = await client.compute.volumes.list();
61
+ * // Automatically fetches more pages as needed.
62
+ * for await (const volume of client.compute.volumes.list()) {
63
+ * // ...
64
+ * }
61
65
  * ```
62
66
  */
63
- list(options?: RequestOptions): APIPromise<VolumeList> {
64
- return this._client.get('/v1/compute/volumes', options);
67
+ list(
68
+ query: VolumeListParams | null | undefined = {},
69
+ options?: RequestOptions,
70
+ ): PagePromise<VolumesCursor, Volume> {
71
+ return this._client.getAPIList('/v1/compute/volumes', Cursor<Volume>, { query, ...options });
65
72
  }
66
73
 
67
74
  /**
@@ -93,6 +100,8 @@ export class Volumes extends APIResource {
93
100
  }
94
101
  }
95
102
 
103
+ export type VolumesCursor = Cursor<Volume>;
104
+
96
105
  /**
97
106
  * Storage type the Volume is using.
98
107
  */
@@ -165,6 +174,11 @@ export type VolumeKind = 'boot' | 'data';
165
174
 
166
175
  export interface VolumeList {
167
176
  items: Array<Volume>;
177
+
178
+ /**
179
+ * Pagination response details.
180
+ */
181
+ pagination: Shared.Pagination;
168
182
  }
169
183
 
170
184
  export interface VolumeCreateParams {
@@ -206,6 +220,8 @@ export interface VolumeUpdateParams {
206
220
  tags?: Array<string>;
207
221
  }
208
222
 
223
+ export interface VolumeListParams extends CursorParams {}
224
+
209
225
  Volumes.Availability = Availability;
210
226
 
211
227
  export declare namespace Volumes {
@@ -214,8 +230,10 @@ export declare namespace Volumes {
214
230
  type Volume as Volume,
215
231
  type VolumeKind as VolumeKind,
216
232
  type VolumeList as VolumeList,
233
+ type VolumesCursor as VolumesCursor,
217
234
  type VolumeCreateParams as VolumeCreateParams,
218
235
  type VolumeUpdateParams as VolumeUpdateParams,
236
+ type VolumeListParams as VolumeListParams,
219
237
  };
220
238
 
221
239
  export {
@@ -3,15 +3,25 @@
3
3
  import { APIResource } from '../../../core/resource';
4
4
  import * as Shared from '../../shared';
5
5
  import * as ConnectionsAPI from './connections';
6
- import { ConnectionCreateParams, ConnectionUpdateParams, Connections } from './connections';
6
+ import {
7
+ ConnectionCreateParams,
8
+ ConnectionListParams,
9
+ ConnectionUpdateParams,
10
+ Connections,
11
+ } from './connections';
7
12
  import * as RoutesAPI from './routes';
8
- import { Routes } from './routes';
13
+ import { RouteListParams, Routes } from './routes';
14
+ import { Cursor } from '../../../core/pagination';
9
15
 
10
16
  export class Connect extends APIResource {
11
17
  connections: ConnectionsAPI.Connections = new ConnectionsAPI.Connections(this._client);
12
18
  routes: RoutesAPI.Routes = new RoutesAPI.Routes(this._client);
13
19
  }
14
20
 
21
+ export type ConnectConnectionsCursor = Cursor<ConnectConnection>;
22
+
23
+ export type ConnectRoutesCursor = Cursor<ConnectRoute>;
24
+
15
25
  /**
16
26
  * Connect Connection speed in Mbps
17
27
  */
@@ -124,6 +134,11 @@ export interface ConnectConnectionAWSConfigRequest {
124
134
 
125
135
  export interface ConnectConnectionList {
126
136
  items: Array<ConnectConnection>;
137
+
138
+ /**
139
+ * Pagination response details.
140
+ */
141
+ pagination: Shared.Pagination;
127
142
  }
128
143
 
129
144
  /**
@@ -148,6 +163,11 @@ export interface ConnectRoute {
148
163
 
149
164
  export interface ConnectRouteList {
150
165
  items: Array<ConnectRoute>;
166
+
167
+ /**
168
+ * Pagination response details.
169
+ */
170
+ pagination: Shared.Pagination;
151
171
  }
152
172
 
153
173
  Connect.Connections = Connections;
@@ -168,7 +188,8 @@ export declare namespace Connect {
168
188
  Connections as Connections,
169
189
  type ConnectionCreateParams as ConnectionCreateParams,
170
190
  type ConnectionUpdateParams as ConnectionUpdateParams,
191
+ type ConnectionListParams as ConnectionListParams,
171
192
  };
172
193
 
173
- export { Routes as Routes };
194
+ export { Routes as Routes, type RouteListParams as RouteListParams };
174
195
  }
@@ -4,7 +4,9 @@ import { APIResource } from '../../../core/resource';
4
4
  import * as OperationsAPI from '../../operations';
5
5
  import * as Shared from '../../shared';
6
6
  import * as ConnectAPI from './connect';
7
+ import { ConnectConnectionsCursor } from './connect';
7
8
  import { APIPromise } from '../../../core/api-promise';
9
+ import { Cursor, type CursorParams, PagePromise } from '../../../core/pagination';
8
10
  import { RequestOptions } from '../../../internal/request-options';
9
11
  import { path } from '../../../internal/utils/path';
10
12
 
@@ -52,12 +54,21 @@ export class Connections extends APIResource {
52
54
  *
53
55
  * @example
54
56
  * ```ts
55
- * const connectConnectionList =
56
- * await client.networking.connect.connections.list();
57
+ * // Automatically fetches more pages as needed.
58
+ * for await (const connectConnection of client.networking.connect.connections.list()) {
59
+ * // ...
60
+ * }
57
61
  * ```
58
62
  */
59
- list(options?: RequestOptions): APIPromise<ConnectAPI.ConnectConnectionList> {
60
- return this._client.get('/v1/networking/connect/connections', options);
63
+ list(
64
+ query: ConnectionListParams | null | undefined = {},
65
+ options?: RequestOptions,
66
+ ): PagePromise<ConnectConnectionsCursor, ConnectAPI.ConnectConnection> {
67
+ return this._client.getAPIList(
68
+ '/v1/networking/connect/connections',
69
+ Cursor<ConnectAPI.ConnectConnection>,
70
+ { query, ...options },
71
+ );
61
72
  }
62
73
 
63
74
  /**
@@ -140,9 +151,14 @@ export interface ConnectionUpdateParams {
140
151
  tags?: Array<string>;
141
152
  }
142
153
 
154
+ export interface ConnectionListParams extends CursorParams {}
155
+
143
156
  export declare namespace Connections {
144
157
  export {
145
158
  type ConnectionCreateParams as ConnectionCreateParams,
146
159
  type ConnectionUpdateParams as ConnectionUpdateParams,
160
+ type ConnectionListParams as ConnectionListParams,
147
161
  };
148
162
  }
163
+
164
+ export { type ConnectConnectionsCursor };
@@ -9,6 +9,13 @@ export {
9
9
  type ConnectConnectionList,
10
10
  type ConnectRoute,
11
11
  type ConnectRouteList,
12
+ type ConnectConnectionsCursor,
13
+ type ConnectRoutesCursor,
12
14
  } from './connect';
13
- export { Connections, type ConnectionCreateParams, type ConnectionUpdateParams } from './connections';
14
- export { Routes } from './routes';
15
+ export {
16
+ Connections,
17
+ type ConnectionCreateParams,
18
+ type ConnectionUpdateParams,
19
+ type ConnectionListParams,
20
+ } from './connections';
21
+ export { Routes, type RouteListParams } from './routes';
@@ -2,7 +2,8 @@
2
2
 
3
3
  import { APIResource } from '../../../core/resource';
4
4
  import * as ConnectAPI from './connect';
5
- import { APIPromise } from '../../../core/api-promise';
5
+ import { ConnectRoutesCursor } from './connect';
6
+ import { Cursor, type CursorParams, PagePromise } from '../../../core/pagination';
6
7
  import { RequestOptions } from '../../../internal/request-options';
7
8
 
8
9
  export class Routes extends APIResource {
@@ -11,11 +12,27 @@ export class Routes extends APIResource {
11
12
  *
12
13
  * @example
13
14
  * ```ts
14
- * const connectRouteList =
15
- * await client.networking.connect.routes.list();
15
+ * // Automatically fetches more pages as needed.
16
+ * for await (const connectRoute of client.networking.connect.routes.list()) {
17
+ * // ...
18
+ * }
16
19
  * ```
17
20
  */
18
- list(options?: RequestOptions): APIPromise<ConnectAPI.ConnectRouteList> {
19
- return this._client.get('/v1/networking/connect/routes', options);
21
+ list(
22
+ query: RouteListParams | null | undefined = {},
23
+ options?: RequestOptions,
24
+ ): PagePromise<ConnectRoutesCursor, ConnectAPI.ConnectRoute> {
25
+ return this._client.getAPIList('/v1/networking/connect/routes', Cursor<ConnectAPI.ConnectRoute>, {
26
+ query,
27
+ ...options,
28
+ });
20
29
  }
21
30
  }
31
+
32
+ export interface RouteListParams extends CursorParams {}
33
+
34
+ export declare namespace Routes {
35
+ export { type RouteListParams as RouteListParams };
36
+ }
37
+
38
+ export { type ConnectRoutesCursor };
@@ -4,6 +4,7 @@ import { APIResource } from '../../core/resource';
4
4
  import * as OperationsAPI from '../operations';
5
5
  import * as Shared from '../shared';
6
6
  import { APIPromise } from '../../core/api-promise';
7
+ import { Cursor, type CursorParams, PagePromise } from '../../core/pagination';
7
8
  import { RequestOptions } from '../../internal/request-options';
8
9
  import { path } from '../../internal/utils/path';
9
10
 
@@ -60,12 +61,23 @@ export class FirewallRules extends APIResource {
60
61
  *
61
62
  * @example
62
63
  * ```ts
63
- * const firewallRuleList =
64
- * await client.networking.firewallRules.list('vpc_id');
64
+ * // Automatically fetches more pages as needed.
65
+ * for await (const firewallRule of client.networking.firewallRules.list(
66
+ * 'vpc_id',
67
+ * )) {
68
+ * // ...
69
+ * }
65
70
  * ```
66
71
  */
67
- list(vpcID: string, options?: RequestOptions): APIPromise<FirewallRuleList> {
68
- return this._client.get(path`/v1/networking/vpcs/${vpcID}/firewall_rules`, options);
72
+ list(
73
+ vpcID: string,
74
+ query: FirewallRuleListParams | null | undefined = {},
75
+ options?: RequestOptions,
76
+ ): PagePromise<FirewallRulesCursor, FirewallRule> {
77
+ return this._client.getAPIList(path`/v1/networking/vpcs/${vpcID}/firewall_rules`, Cursor<FirewallRule>, {
78
+ query,
79
+ ...options,
80
+ });
69
81
  }
70
82
 
71
83
  /**
@@ -111,6 +123,8 @@ export class FirewallRules extends APIResource {
111
123
  }
112
124
  }
113
125
 
126
+ export type FirewallRulesCursor = Cursor<FirewallRule>;
127
+
114
128
  /**
115
129
  * Firewall rule details.
116
130
  */
@@ -174,6 +188,11 @@ export interface FirewallRule {
174
188
 
175
189
  export interface FirewallRuleList {
176
190
  items: Array<FirewallRule>;
191
+
192
+ /**
193
+ * Pagination response details.
194
+ */
195
+ pagination: Shared.Pagination;
177
196
  }
178
197
 
179
198
  export interface FirewallRuleCreateParams {
@@ -248,6 +267,8 @@ export interface FirewallRuleUpdateParams {
248
267
  tags?: Array<string>;
249
268
  }
250
269
 
270
+ export interface FirewallRuleListParams extends CursorParams {}
271
+
251
272
  export interface FirewallRuleDeleteParams {
252
273
  /**
253
274
  * VPC ID
@@ -266,8 +287,10 @@ export declare namespace FirewallRules {
266
287
  export {
267
288
  type FirewallRule as FirewallRule,
268
289
  type FirewallRuleList as FirewallRuleList,
290
+ type FirewallRulesCursor as FirewallRulesCursor,
269
291
  type FirewallRuleCreateParams as FirewallRuleCreateParams,
270
292
  type FirewallRuleUpdateParams as FirewallRuleUpdateParams,
293
+ type FirewallRuleListParams as FirewallRuleListParams,
271
294
  type FirewallRuleDeleteParams as FirewallRuleDeleteParams,
272
295
  type FirewallRuleGetParams as FirewallRuleGetParams,
273
296
  };
@@ -9,6 +9,8 @@ export {
9
9
  type ConnectConnectionList,
10
10
  type ConnectRoute,
11
11
  type ConnectRouteList,
12
+ type ConnectConnectionsCursor,
13
+ type ConnectRoutesCursor,
12
14
  } from './connect/index';
13
15
  export {
14
16
  FirewallRules,
@@ -16,8 +18,10 @@ export {
16
18
  type FirewallRuleList,
17
19
  type FirewallRuleCreateParams,
18
20
  type FirewallRuleUpdateParams,
21
+ type FirewallRuleListParams,
19
22
  type FirewallRuleDeleteParams,
20
23
  type FirewallRuleGetParams,
24
+ type FirewallRulesCursor,
21
25
  } from './firewall-rules';
22
26
  export { Networking } from './networking';
23
27
  export {
@@ -27,4 +31,6 @@ export {
27
31
  type VPCList,
28
32
  type VPCCreateParams,
29
33
  type VPCUpdateParams,
34
+ type VPCListParams,
35
+ type VPCsCursor,
30
36
  } from './vpcs/index';
@@ -8,8 +8,10 @@ import {
8
8
  FirewallRuleDeleteParams,
9
9
  FirewallRuleGetParams,
10
10
  FirewallRuleList,
11
+ FirewallRuleListParams,
11
12
  FirewallRuleUpdateParams,
12
13
  FirewallRules,
14
+ FirewallRulesCursor,
13
15
  } from './firewall-rules';
14
16
  import * as ConnectAPI from './connect/connect';
15
17
  import {
@@ -23,7 +25,16 @@ import {
23
25
  ConnectRouteList,
24
26
  } from './connect/connect';
25
27
  import * as VPCsAPI from './vpcs/vpcs';
26
- import { Subnet, VPC, VPCCreateParams, VPCList, VPCUpdateParams, VPCs } from './vpcs/vpcs';
28
+ import {
29
+ Subnet,
30
+ VPC,
31
+ VPCCreateParams,
32
+ VPCList,
33
+ VPCListParams,
34
+ VPCUpdateParams,
35
+ VPCs,
36
+ VPCsCursor,
37
+ } from './vpcs/vpcs';
27
38
 
28
39
  export class Networking extends APIResource {
29
40
  vpcs: VPCsAPI.VPCs = new VPCsAPI.VPCs(this._client);
@@ -41,16 +52,20 @@ export declare namespace Networking {
41
52
  type Subnet as Subnet,
42
53
  type VPC as VPC,
43
54
  type VPCList as VPCList,
55
+ type VPCsCursor as VPCsCursor,
44
56
  type VPCCreateParams as VPCCreateParams,
45
57
  type VPCUpdateParams as VPCUpdateParams,
58
+ type VPCListParams as VPCListParams,
46
59
  };
47
60
 
48
61
  export {
49
62
  FirewallRules as FirewallRules,
50
63
  type FirewallRule as FirewallRule,
51
64
  type FirewallRuleList as FirewallRuleList,
65
+ type FirewallRulesCursor as FirewallRulesCursor,
52
66
  type FirewallRuleCreateParams as FirewallRuleCreateParams,
53
67
  type FirewallRuleUpdateParams as FirewallRuleUpdateParams,
68
+ type FirewallRuleListParams as FirewallRuleListParams,
54
69
  type FirewallRuleDeleteParams as FirewallRuleDeleteParams,
55
70
  type FirewallRuleGetParams as FirewallRuleGetParams,
56
71
  };
@@ -14,4 +14,6 @@ export {
14
14
  type VPCList,
15
15
  type VPCCreateParams,
16
16
  type VPCUpdateParams,
17
+ type VPCListParams,
18
+ type VPCsCursor,
17
19
  } from './vpcs';
@@ -12,6 +12,7 @@ import {
12
12
  AvailabilityUpdateResponse,
13
13
  } from './availability';
14
14
  import { APIPromise } from '../../../core/api-promise';
15
+ import { Cursor, type CursorParams, PagePromise } from '../../../core/pagination';
15
16
  import { RequestOptions } from '../../../internal/request-options';
16
17
  import { path } from '../../../internal/utils/path';
17
18
 
@@ -57,11 +58,14 @@ export class VPCs extends APIResource {
57
58
  *
58
59
  * @example
59
60
  * ```ts
60
- * const vpcList = await client.networking.vpcs.list();
61
+ * // Automatically fetches more pages as needed.
62
+ * for await (const vpc of client.networking.vpcs.list()) {
63
+ * // ...
64
+ * }
61
65
  * ```
62
66
  */
63
- list(options?: RequestOptions): APIPromise<VPCList> {
64
- return this._client.get('/v1/networking/vpcs', options);
67
+ list(query: VPCListParams | null | undefined = {}, options?: RequestOptions): PagePromise<VPCsCursor, VPC> {
68
+ return this._client.getAPIList('/v1/networking/vpcs', Cursor<VPC>, { query, ...options });
65
69
  }
66
70
 
67
71
  /**
@@ -91,6 +95,8 @@ export class VPCs extends APIResource {
91
95
  }
92
96
  }
93
97
 
98
+ export type VPCsCursor = Cursor<VPC>;
99
+
94
100
  /**
95
101
  * Subnet of the VPC.
96
102
  */
@@ -173,6 +179,11 @@ export interface VPC {
173
179
 
174
180
  export interface VPCList {
175
181
  items: Array<VPC>;
182
+
183
+ /**
184
+ * Pagination response details.
185
+ */
186
+ pagination: Shared.Pagination;
176
187
  }
177
188
 
178
189
  export interface VPCCreateParams {
@@ -214,6 +225,8 @@ export interface VPCUpdateParams {
214
225
  tags?: Array<string>;
215
226
  }
216
227
 
228
+ export interface VPCListParams extends CursorParams {}
229
+
217
230
  VPCs.Availability = Availability;
218
231
 
219
232
  export declare namespace VPCs {
@@ -221,8 +234,10 @@ export declare namespace VPCs {
221
234
  type Subnet as Subnet,
222
235
  type VPC as VPC,
223
236
  type VPCList as VPCList,
237
+ type VPCsCursor as VPCsCursor,
224
238
  type VPCCreateParams as VPCCreateParams,
225
239
  type VPCUpdateParams as VPCUpdateParams,
240
+ type VPCListParams as VPCListParams,
226
241
  };
227
242
 
228
243
  export {
@@ -1,7 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../core/resource';
4
+ import * as Shared from './shared';
4
5
  import { APIPromise } from '../core/api-promise';
6
+ import { Cursor, type CursorParams, PagePromise } from '../core/pagination';
5
7
  import { RequestOptions } from '../internal/request-options';
6
8
  import { path } from '../internal/utils/path';
7
9
 
@@ -9,8 +11,11 @@ export class Operations extends APIResource {
9
11
  /**
10
12
  * List all operations
11
13
  */
12
- list(options?: RequestOptions): APIPromise<OperationList> {
13
- return this._client.get('/v1/operations', options);
14
+ list(
15
+ query: OperationListParams | null | undefined = {},
16
+ options?: RequestOptions,
17
+ ): PagePromise<OperationsCursor, Operation> {
18
+ return this._client.getAPIList('/v1/operations', Cursor<Operation>, { query, ...options });
14
19
  }
15
20
 
16
21
  /**
@@ -21,6 +26,8 @@ export class Operations extends APIResource {
21
26
  }
22
27
  }
23
28
 
29
+ export type OperationsCursor = Cursor<Operation>;
30
+
24
31
  /**
25
32
  * Operation details.
26
33
  */
@@ -68,6 +75,11 @@ export type OperationKind = 'vm' | 'volume' | 'vpc' | 'firewall_rule';
68
75
 
69
76
  export interface OperationList {
70
77
  items: Array<Operation>;
78
+
79
+ /**
80
+ * Pagination response details.
81
+ */
82
+ pagination: Shared.Pagination;
71
83
  }
72
84
 
73
85
  /**
@@ -80,6 +92,8 @@ export type OperationStatus = 'pending' | 'running' | 'done' | 'failed' | 'unkno
80
92
  */
81
93
  export type OperationType = 'create' | 'update' | 'delete' | 'restart';
82
94
 
95
+ export interface OperationListParams extends CursorParams {}
96
+
83
97
  export declare namespace Operations {
84
98
  export {
85
99
  type Operation as Operation,
@@ -87,5 +101,7 @@ export declare namespace Operations {
87
101
  type OperationList as OperationList,
88
102
  type OperationStatus as OperationStatus,
89
103
  type OperationType as OperationType,
104
+ type OperationsCursor as OperationsCursor,
105
+ type OperationListParams as OperationListParams,
90
106
  };
91
107
  }