openai 6.47.0 → 6.49.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 (212) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/azure.d.mts.map +1 -1
  3. package/azure.d.ts.map +1 -1
  4. package/azure.js +5 -1
  5. package/azure.js.map +1 -1
  6. package/azure.mjs +5 -1
  7. package/azure.mjs.map +1 -1
  8. package/helpers/standard-schema.d.mts +104 -0
  9. package/helpers/standard-schema.d.mts.map +1 -0
  10. package/helpers/standard-schema.d.ts +104 -0
  11. package/helpers/standard-schema.d.ts.map +1 -0
  12. package/helpers/standard-schema.js +320 -0
  13. package/helpers/standard-schema.js.map +1 -0
  14. package/helpers/standard-schema.mjs +314 -0
  15. package/helpers/standard-schema.mjs.map +1 -0
  16. package/helpers/zod.d.mts +26 -3
  17. package/helpers/zod.d.mts.map +1 -1
  18. package/helpers/zod.d.ts +26 -3
  19. package/helpers/zod.d.ts.map +1 -1
  20. package/helpers/zod.js +97 -7
  21. package/helpers/zod.js.map +1 -1
  22. package/helpers/zod.mjs +96 -7
  23. package/helpers/zod.mjs.map +1 -1
  24. package/internal/headers.d.mts.map +1 -1
  25. package/internal/headers.d.ts.map +1 -1
  26. package/internal/headers.js +7 -3
  27. package/internal/headers.js.map +1 -1
  28. package/internal/headers.mjs +7 -3
  29. package/internal/headers.mjs.map +1 -1
  30. package/lib/AbstractChatCompletionRunner.d.mts.map +1 -1
  31. package/lib/AbstractChatCompletionRunner.d.ts.map +1 -1
  32. package/lib/AbstractChatCompletionRunner.js +43 -1
  33. package/lib/AbstractChatCompletionRunner.js.map +1 -1
  34. package/lib/AbstractChatCompletionRunner.mjs +43 -1
  35. package/lib/AbstractChatCompletionRunner.mjs.map +1 -1
  36. package/lib/ChatCompletionStream.d.mts +2 -1
  37. package/lib/ChatCompletionStream.d.mts.map +1 -1
  38. package/lib/ChatCompletionStream.d.ts +2 -1
  39. package/lib/ChatCompletionStream.d.ts.map +1 -1
  40. package/lib/ChatCompletionStream.js +53 -14
  41. package/lib/ChatCompletionStream.js.map +1 -1
  42. package/lib/ChatCompletionStream.mjs +53 -14
  43. package/lib/ChatCompletionStream.mjs.map +1 -1
  44. package/lib/ResponsesParser.d.mts.map +1 -1
  45. package/lib/ResponsesParser.d.ts.map +1 -1
  46. package/lib/ResponsesParser.js +3 -5
  47. package/lib/ResponsesParser.js.map +1 -1
  48. package/lib/ResponsesParser.mjs +3 -5
  49. package/lib/ResponsesParser.mjs.map +1 -1
  50. package/lib/jsonschema.d.mts +3 -0
  51. package/lib/jsonschema.d.mts.map +1 -1
  52. package/lib/jsonschema.d.ts +3 -0
  53. package/lib/jsonschema.d.ts.map +1 -1
  54. package/lib/transform.d.mts +25 -1
  55. package/lib/transform.d.mts.map +1 -1
  56. package/lib/transform.d.ts +25 -1
  57. package/lib/transform.d.ts.map +1 -1
  58. package/lib/transform.js +1521 -82
  59. package/lib/transform.js.map +1 -1
  60. package/lib/transform.mjs +1515 -82
  61. package/lib/transform.mjs.map +1 -1
  62. package/package.json +1 -1
  63. package/resources/admin/organization/audit-logs.d.mts +2 -2
  64. package/resources/admin/organization/audit-logs.d.mts.map +1 -1
  65. package/resources/admin/organization/audit-logs.d.ts +2 -2
  66. package/resources/admin/organization/audit-logs.d.ts.map +1 -1
  67. package/resources/admin/organization/index.d.mts +1 -0
  68. package/resources/admin/organization/index.d.mts.map +1 -1
  69. package/resources/admin/organization/index.d.ts +1 -0
  70. package/resources/admin/organization/index.d.ts.map +1 -1
  71. package/resources/admin/organization/index.js +3 -1
  72. package/resources/admin/organization/index.js.map +1 -1
  73. package/resources/admin/organization/index.mjs +1 -0
  74. package/resources/admin/organization/index.mjs.map +1 -1
  75. package/resources/admin/organization/organization.d.mts +4 -0
  76. package/resources/admin/organization/organization.d.mts.map +1 -1
  77. package/resources/admin/organization/organization.d.ts +4 -0
  78. package/resources/admin/organization/organization.d.ts.map +1 -1
  79. package/resources/admin/organization/organization.js +4 -0
  80. package/resources/admin/organization/organization.js.map +1 -1
  81. package/resources/admin/organization/organization.mjs +4 -0
  82. package/resources/admin/organization/organization.mjs.map +1 -1
  83. package/resources/admin/organization/projects/index.d.mts +2 -1
  84. package/resources/admin/organization/projects/index.d.mts.map +1 -1
  85. package/resources/admin/organization/projects/index.d.ts +2 -1
  86. package/resources/admin/organization/projects/index.d.ts.map +1 -1
  87. package/resources/admin/organization/projects/index.js +7 -5
  88. package/resources/admin/organization/projects/index.js.map +1 -1
  89. package/resources/admin/organization/projects/index.mjs +2 -1
  90. package/resources/admin/organization/projects/index.mjs.map +1 -1
  91. package/resources/admin/organization/projects/projects.d.mts +6 -2
  92. package/resources/admin/organization/projects/projects.d.mts.map +1 -1
  93. package/resources/admin/organization/projects/projects.d.ts +6 -2
  94. package/resources/admin/organization/projects/projects.d.ts.map +1 -1
  95. package/resources/admin/organization/projects/projects.js +6 -2
  96. package/resources/admin/organization/projects/projects.js.map +1 -1
  97. package/resources/admin/organization/projects/projects.mjs +6 -2
  98. package/resources/admin/organization/projects/projects.mjs.map +1 -1
  99. package/resources/admin/organization/projects/service-accounts/api-keys.d.mts +58 -0
  100. package/resources/admin/organization/projects/service-accounts/api-keys.d.mts.map +1 -0
  101. package/resources/admin/organization/projects/service-accounts/api-keys.d.ts +58 -0
  102. package/resources/admin/organization/projects/service-accounts/api-keys.d.ts.map +1 -0
  103. package/resources/admin/organization/projects/service-accounts/api-keys.js +26 -0
  104. package/resources/admin/organization/projects/service-accounts/api-keys.js.map +1 -0
  105. package/resources/admin/organization/projects/service-accounts/api-keys.mjs +22 -0
  106. package/resources/admin/organization/projects/service-accounts/api-keys.mjs.map +1 -0
  107. package/resources/admin/organization/projects/service-accounts/index.d.mts +3 -0
  108. package/resources/admin/organization/projects/service-accounts/index.d.mts.map +1 -0
  109. package/resources/admin/organization/projects/service-accounts/index.d.ts +3 -0
  110. package/resources/admin/organization/projects/service-accounts/index.d.ts.map +1 -0
  111. package/resources/admin/organization/projects/service-accounts/index.js +9 -0
  112. package/resources/admin/organization/projects/service-accounts/index.js.map +1 -0
  113. package/resources/admin/organization/projects/service-accounts/index.mjs +4 -0
  114. package/resources/admin/organization/projects/service-accounts/index.mjs.map +1 -0
  115. package/resources/admin/organization/projects/service-accounts/service-accounts.d.mts +177 -0
  116. package/resources/admin/organization/projects/service-accounts/service-accounts.d.mts.map +1 -0
  117. package/resources/admin/organization/projects/service-accounts/service-accounts.d.ts +177 -0
  118. package/resources/admin/organization/projects/service-accounts/service-accounts.d.ts.map +1 -0
  119. package/resources/admin/organization/projects/service-accounts/service-accounts.js +109 -0
  120. package/resources/admin/organization/projects/service-accounts/service-accounts.js.map +1 -0
  121. package/resources/admin/organization/projects/service-accounts/service-accounts.mjs +104 -0
  122. package/resources/admin/organization/projects/service-accounts/service-accounts.mjs.map +1 -0
  123. package/resources/admin/organization/projects/service-accounts.d.mts +1 -167
  124. package/resources/admin/organization/projects/service-accounts.d.mts.map +1 -1
  125. package/resources/admin/organization/projects/service-accounts.d.ts +1 -167
  126. package/resources/admin/organization/projects/service-accounts.d.ts.map +1 -1
  127. package/resources/admin/organization/projects/service-accounts.js +2 -97
  128. package/resources/admin/organization/projects/service-accounts.js.map +1 -1
  129. package/resources/admin/organization/projects/service-accounts.mjs +1 -95
  130. package/resources/admin/organization/projects/service-accounts.mjs.map +1 -1
  131. package/resources/admin/organization/projects/spend-limit.d.mts +115 -0
  132. package/resources/admin/organization/projects/spend-limit.d.mts.map +1 -0
  133. package/resources/admin/organization/projects/spend-limit.d.ts +115 -0
  134. package/resources/admin/organization/projects/spend-limit.d.ts.map +1 -0
  135. package/resources/admin/organization/projects/spend-limit.js +67 -0
  136. package/resources/admin/organization/projects/spend-limit.js.map +1 -0
  137. package/resources/admin/organization/projects/spend-limit.mjs +63 -0
  138. package/resources/admin/organization/projects/spend-limit.mjs.map +1 -0
  139. package/resources/admin/organization/spend-limit.d.mts +108 -0
  140. package/resources/admin/organization/spend-limit.d.mts.map +1 -0
  141. package/resources/admin/organization/spend-limit.d.ts +108 -0
  142. package/resources/admin/organization/spend-limit.d.ts.map +1 -0
  143. package/resources/admin/organization/spend-limit.js +59 -0
  144. package/resources/admin/organization/spend-limit.js.map +1 -0
  145. package/resources/admin/organization/spend-limit.mjs +55 -0
  146. package/resources/admin/organization/spend-limit.mjs.map +1 -0
  147. package/resources/admin/organization/usage.d.mts +517 -88
  148. package/resources/admin/organization/usage.d.mts.map +1 -1
  149. package/resources/admin/organization/usage.d.ts +517 -88
  150. package/resources/admin/organization/usage.d.ts.map +1 -1
  151. package/resources/beta/responses/input-tokens.d.mts +6 -2
  152. package/resources/beta/responses/input-tokens.d.mts.map +1 -1
  153. package/resources/beta/responses/input-tokens.d.ts +6 -2
  154. package/resources/beta/responses/input-tokens.d.ts.map +1 -1
  155. package/resources/beta/responses/responses.d.mts +25 -15
  156. package/resources/beta/responses/responses.d.mts.map +1 -1
  157. package/resources/beta/responses/responses.d.ts +25 -15
  158. package/resources/beta/responses/responses.d.ts.map +1 -1
  159. package/resources/beta/responses/responses.js.map +1 -1
  160. package/resources/beta/responses/responses.mjs.map +1 -1
  161. package/resources/chat/completions/completions.d.mts +4 -3
  162. package/resources/chat/completions/completions.d.mts.map +1 -1
  163. package/resources/chat/completions/completions.d.ts +4 -3
  164. package/resources/chat/completions/completions.d.ts.map +1 -1
  165. package/resources/chat/completions/completions.js.map +1 -1
  166. package/resources/chat/completions/completions.mjs.map +1 -1
  167. package/resources/responses/input-tokens.d.mts +2 -1
  168. package/resources/responses/input-tokens.d.mts.map +1 -1
  169. package/resources/responses/input-tokens.d.ts +2 -1
  170. package/resources/responses/input-tokens.d.ts.map +1 -1
  171. package/resources/responses/responses.d.mts +9 -8
  172. package/resources/responses/responses.d.mts.map +1 -1
  173. package/resources/responses/responses.d.ts +9 -8
  174. package/resources/responses/responses.d.ts.map +1 -1
  175. package/resources/responses/responses.js.map +1 -1
  176. package/resources/responses/responses.mjs.map +1 -1
  177. package/resources/shared.d.mts +4 -1
  178. package/resources/shared.d.mts.map +1 -1
  179. package/resources/shared.d.ts +4 -1
  180. package/resources/shared.d.ts.map +1 -1
  181. package/src/azure.ts +5 -1
  182. package/src/helpers/standard-schema.ts +570 -0
  183. package/src/helpers/zod.ts +158 -29
  184. package/src/internal/headers.ts +7 -3
  185. package/src/lib/AbstractChatCompletionRunner.ts +43 -1
  186. package/src/lib/ChatCompletionStream.ts +56 -8
  187. package/src/lib/ResponsesParser.ts +7 -5
  188. package/src/lib/jsonschema.ts +3 -0
  189. package/src/lib/transform.ts +1930 -103
  190. package/src/resources/admin/organization/audit-logs.ts +169 -1
  191. package/src/resources/admin/organization/index.ts +6 -0
  192. package/src/resources/admin/organization/organization.ts +16 -0
  193. package/src/resources/admin/organization/projects/index.ts +7 -1
  194. package/src/resources/admin/organization/projects/projects.ts +29 -13
  195. package/src/resources/admin/organization/projects/service-accounts/api-keys.ts +80 -0
  196. package/src/resources/admin/organization/projects/service-accounts/index.ts +15 -0
  197. package/src/resources/admin/organization/projects/service-accounts/service-accounts.ts +284 -0
  198. package/src/resources/admin/organization/projects/service-accounts.ts +1 -264
  199. package/src/resources/admin/organization/projects/spend-limit.ts +156 -0
  200. package/src/resources/admin/organization/spend-limit.ts +144 -0
  201. package/src/resources/admin/organization/usage.ts +616 -88
  202. package/src/resources/beta/responses/input-tokens.ts +6 -2
  203. package/src/resources/beta/responses/responses.ts +25 -14
  204. package/src/resources/chat/completions/completions.ts +4 -3
  205. package/src/resources/responses/input-tokens.ts +2 -1
  206. package/src/resources/responses/responses.ts +9 -7
  207. package/src/resources/shared.ts +4 -1
  208. package/src/version.ts +1 -1
  209. package/version.d.mts +1 -1
  210. package/version.d.ts +1 -1
  211. package/version.js +1 -1
  212. package/version.mjs +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"service-accounts.mjs","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/service-accounts.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,sCAAkC;AAExD,OAAO,EACL,sBAAsB,GAGvB,wCAAoC;AAErC,OAAO,EAAE,IAAI,EAAE,4CAAwC;AAEvD,MAAM,OAAO,eAAgB,SAAQ,WAAW;IAC9C;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,SAAiB,EACjB,IAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,0BAA0B,SAAS,mBAAmB,EAAE;YACnF,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,QAAQ,CACN,gBAAwB,EACxB,MAAoC,EACpC,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,0BAA0B,UAAU,qBAAqB,gBAAgB,EAAE,EAAE;YACvG,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,gBAAwB,EACxB,MAAkC,EAClC,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,IAAI,CAAA,0BAA0B,UAAU,qBAAqB,gBAAgB,EAAE,EAC/E,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAC5D,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,SAAiB,EACjB,QAAqD,EAAE,EACvD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,0BAA0B,SAAS,mBAAmB,EAC1D,CAAA,sBAA6C,CAAA,EAC7C,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAC7D,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,MAAM,CACJ,gBAAwB,EACxB,MAAkC,EAClC,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CACxB,IAAI,CAAA,0BAA0B,UAAU,qBAAqB,gBAAgB,EAAE,EAC/E,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CACtD,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"service-accounts.mjs","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/service-accounts.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,6CAAyC"}
@@ -0,0 +1,115 @@
1
+ import { APIResource } from "../../../../core/resource.mjs";
2
+ import { APIPromise } from "../../../../core/api-promise.mjs";
3
+ import { RequestOptions } from "../../../../internal/request-options.mjs";
4
+ export declare class SpendLimit extends APIResource {
5
+ /**
6
+ * Get a project's hard spend limit.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const projectSpendLimit =
11
+ * await client.admin.organization.projects.spendLimit.retrieve(
12
+ * 'proj_123',
13
+ * );
14
+ * ```
15
+ */
16
+ retrieve(projectID: string, options?: RequestOptions): APIPromise<ProjectSpendLimit>;
17
+ /**
18
+ * Create or replace a project's hard spend limit.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const projectSpendLimit =
23
+ * await client.admin.organization.projects.spendLimit.update(
24
+ * 'proj_123',
25
+ * {
26
+ * currency: 'USD',
27
+ * interval: 'month',
28
+ * threshold_amount: 1,
29
+ * },
30
+ * );
31
+ * ```
32
+ */
33
+ update(projectID: string, body: SpendLimitUpdateParams, options?: RequestOptions): APIPromise<ProjectSpendLimit>;
34
+ /**
35
+ * Delete a project's hard spend limit.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * const projectSpendLimitDeleted =
40
+ * await client.admin.organization.projects.spendLimit.delete(
41
+ * 'proj_123',
42
+ * );
43
+ * ```
44
+ */
45
+ delete(projectID: string, options?: RequestOptions): APIPromise<ProjectSpendLimitDeleted>;
46
+ }
47
+ /**
48
+ * Represents a hard spend limit configured at the project level.
49
+ */
50
+ export interface ProjectSpendLimit {
51
+ /**
52
+ * The currency for the threshold amount. Currently, only `USD` is supported.
53
+ */
54
+ currency: (string & {}) | 'USD';
55
+ /**
56
+ * The current enforcement state of the hard spend limit.
57
+ */
58
+ enforcement: ProjectSpendLimit.Enforcement;
59
+ /**
60
+ * The time interval for evaluating spend against the threshold. Currently, only
61
+ * `month` is supported.
62
+ */
63
+ interval: (string & {}) | 'month';
64
+ /**
65
+ * The object type, which is always `project.spend_limit`.
66
+ */
67
+ object: 'project.spend_limit';
68
+ /**
69
+ * The hard spend limit amount, in cents.
70
+ */
71
+ threshold_amount: number;
72
+ }
73
+ export declare namespace ProjectSpendLimit {
74
+ /**
75
+ * The current enforcement state of the hard spend limit.
76
+ */
77
+ interface Enforcement {
78
+ /**
79
+ * Whether the hard spend limit is currently enforcing.
80
+ */
81
+ status: (string & {}) | 'inactive' | 'enforcing';
82
+ }
83
+ }
84
+ /**
85
+ * Confirmation payload returned after deleting a project hard spend limit.
86
+ */
87
+ export interface ProjectSpendLimitDeleted {
88
+ /**
89
+ * Whether the hard spend limit was deleted.
90
+ */
91
+ deleted: boolean;
92
+ /**
93
+ * The object type, which is always `project.spend_limit.deleted`.
94
+ */
95
+ object: 'project.spend_limit.deleted';
96
+ }
97
+ export interface SpendLimitUpdateParams {
98
+ /**
99
+ * The currency for the threshold amount. Currently, only `USD` is supported.
100
+ */
101
+ currency: 'USD';
102
+ /**
103
+ * The time interval for evaluating spend against the threshold. Currently, only
104
+ * `month` is supported.
105
+ */
106
+ interval: 'month';
107
+ /**
108
+ * The hard spend limit amount, in cents.
109
+ */
110
+ threshold_amount: number;
111
+ }
112
+ export declare namespace SpendLimit {
113
+ export { type ProjectSpendLimit as ProjectSpendLimit, type ProjectSpendLimitDeleted as ProjectSpendLimitDeleted, type SpendLimitUpdateParams as SpendLimitUpdateParams, };
114
+ }
115
+ //# sourceMappingURL=spend-limit.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spend-limit.d.mts","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/spend-limit.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,sCAAkC;AACxD,OAAO,EAAE,UAAU,EAAE,yCAAqC;AAC1D,OAAO,EAAE,cAAc,EAAE,iDAA6C;AAGtE,qBAAa,UAAW,SAAQ,WAAW;IACzC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC;IAOpF;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iBAAiB,CAAC;IAQhC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;CAM1F;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,QAAQ,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC;IAEhC;;OAEG;IACH,WAAW,EAAE,iBAAiB,CAAC,WAAW,CAAC;IAE3C;;;OAGG;IACH,QAAQ,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC;IAElC;;OAEG;IACH,MAAM,EAAE,qBAAqB,CAAC;IAE9B;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,yBAAiB,iBAAiB,CAAC;IACjC;;OAEG;IACH,UAAiB,WAAW;QAC1B;;WAEG;QACH,MAAM,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,UAAU,GAAG,WAAW,CAAC;KAClD;CACF;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,6BAA6B,CAAC;CACvC;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC;IAEhB;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EACL,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -0,0 +1,115 @@
1
+ import { APIResource } from "../../../../core/resource.js";
2
+ import { APIPromise } from "../../../../core/api-promise.js";
3
+ import { RequestOptions } from "../../../../internal/request-options.js";
4
+ export declare class SpendLimit extends APIResource {
5
+ /**
6
+ * Get a project's hard spend limit.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const projectSpendLimit =
11
+ * await client.admin.organization.projects.spendLimit.retrieve(
12
+ * 'proj_123',
13
+ * );
14
+ * ```
15
+ */
16
+ retrieve(projectID: string, options?: RequestOptions): APIPromise<ProjectSpendLimit>;
17
+ /**
18
+ * Create or replace a project's hard spend limit.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const projectSpendLimit =
23
+ * await client.admin.organization.projects.spendLimit.update(
24
+ * 'proj_123',
25
+ * {
26
+ * currency: 'USD',
27
+ * interval: 'month',
28
+ * threshold_amount: 1,
29
+ * },
30
+ * );
31
+ * ```
32
+ */
33
+ update(projectID: string, body: SpendLimitUpdateParams, options?: RequestOptions): APIPromise<ProjectSpendLimit>;
34
+ /**
35
+ * Delete a project's hard spend limit.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * const projectSpendLimitDeleted =
40
+ * await client.admin.organization.projects.spendLimit.delete(
41
+ * 'proj_123',
42
+ * );
43
+ * ```
44
+ */
45
+ delete(projectID: string, options?: RequestOptions): APIPromise<ProjectSpendLimitDeleted>;
46
+ }
47
+ /**
48
+ * Represents a hard spend limit configured at the project level.
49
+ */
50
+ export interface ProjectSpendLimit {
51
+ /**
52
+ * The currency for the threshold amount. Currently, only `USD` is supported.
53
+ */
54
+ currency: (string & {}) | 'USD';
55
+ /**
56
+ * The current enforcement state of the hard spend limit.
57
+ */
58
+ enforcement: ProjectSpendLimit.Enforcement;
59
+ /**
60
+ * The time interval for evaluating spend against the threshold. Currently, only
61
+ * `month` is supported.
62
+ */
63
+ interval: (string & {}) | 'month';
64
+ /**
65
+ * The object type, which is always `project.spend_limit`.
66
+ */
67
+ object: 'project.spend_limit';
68
+ /**
69
+ * The hard spend limit amount, in cents.
70
+ */
71
+ threshold_amount: number;
72
+ }
73
+ export declare namespace ProjectSpendLimit {
74
+ /**
75
+ * The current enforcement state of the hard spend limit.
76
+ */
77
+ interface Enforcement {
78
+ /**
79
+ * Whether the hard spend limit is currently enforcing.
80
+ */
81
+ status: (string & {}) | 'inactive' | 'enforcing';
82
+ }
83
+ }
84
+ /**
85
+ * Confirmation payload returned after deleting a project hard spend limit.
86
+ */
87
+ export interface ProjectSpendLimitDeleted {
88
+ /**
89
+ * Whether the hard spend limit was deleted.
90
+ */
91
+ deleted: boolean;
92
+ /**
93
+ * The object type, which is always `project.spend_limit.deleted`.
94
+ */
95
+ object: 'project.spend_limit.deleted';
96
+ }
97
+ export interface SpendLimitUpdateParams {
98
+ /**
99
+ * The currency for the threshold amount. Currently, only `USD` is supported.
100
+ */
101
+ currency: 'USD';
102
+ /**
103
+ * The time interval for evaluating spend against the threshold. Currently, only
104
+ * `month` is supported.
105
+ */
106
+ interval: 'month';
107
+ /**
108
+ * The hard spend limit amount, in cents.
109
+ */
110
+ threshold_amount: number;
111
+ }
112
+ export declare namespace SpendLimit {
113
+ export { type ProjectSpendLimit as ProjectSpendLimit, type ProjectSpendLimitDeleted as ProjectSpendLimitDeleted, type SpendLimitUpdateParams as SpendLimitUpdateParams, };
114
+ }
115
+ //# sourceMappingURL=spend-limit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spend-limit.d.ts","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/spend-limit.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,qCAAkC;AACxD,OAAO,EAAE,UAAU,EAAE,wCAAqC;AAC1D,OAAO,EAAE,cAAc,EAAE,gDAA6C;AAGtE,qBAAa,UAAW,SAAQ,WAAW;IACzC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC;IAOpF;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iBAAiB,CAAC;IAQhC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;CAM1F;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,QAAQ,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC;IAEhC;;OAEG;IACH,WAAW,EAAE,iBAAiB,CAAC,WAAW,CAAC;IAE3C;;;OAGG;IACH,QAAQ,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC;IAElC;;OAEG;IACH,MAAM,EAAE,qBAAqB,CAAC;IAE9B;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,yBAAiB,iBAAiB,CAAC;IACjC;;OAEG;IACH,UAAiB,WAAW;QAC1B;;WAEG;QACH,MAAM,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,UAAU,GAAG,WAAW,CAAC;KAClD;CACF;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,6BAA6B,CAAC;CACvC;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC;IAEhB;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EACL,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.SpendLimit = void 0;
5
+ const resource_1 = require("../../../../core/resource.js");
6
+ const path_1 = require("../../../../internal/utils/path.js");
7
+ class SpendLimit extends resource_1.APIResource {
8
+ /**
9
+ * Get a project's hard spend limit.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const projectSpendLimit =
14
+ * await client.admin.organization.projects.spendLimit.retrieve(
15
+ * 'proj_123',
16
+ * );
17
+ * ```
18
+ */
19
+ retrieve(projectID, options) {
20
+ return this._client.get((0, path_1.path) `/organization/projects/${projectID}/spend_limit`, {
21
+ ...options,
22
+ __security: { adminAPIKeyAuth: true },
23
+ });
24
+ }
25
+ /**
26
+ * Create or replace a project's hard spend limit.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const projectSpendLimit =
31
+ * await client.admin.organization.projects.spendLimit.update(
32
+ * 'proj_123',
33
+ * {
34
+ * currency: 'USD',
35
+ * interval: 'month',
36
+ * threshold_amount: 1,
37
+ * },
38
+ * );
39
+ * ```
40
+ */
41
+ update(projectID, body, options) {
42
+ return this._client.post((0, path_1.path) `/organization/projects/${projectID}/spend_limit`, {
43
+ body,
44
+ ...options,
45
+ __security: { adminAPIKeyAuth: true },
46
+ });
47
+ }
48
+ /**
49
+ * Delete a project's hard spend limit.
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * const projectSpendLimitDeleted =
54
+ * await client.admin.organization.projects.spendLimit.delete(
55
+ * 'proj_123',
56
+ * );
57
+ * ```
58
+ */
59
+ delete(projectID, options) {
60
+ return this._client.delete((0, path_1.path) `/organization/projects/${projectID}/spend_limit`, {
61
+ ...options,
62
+ __security: { adminAPIKeyAuth: true },
63
+ });
64
+ }
65
+ }
66
+ exports.SpendLimit = SpendLimit;
67
+ //# sourceMappingURL=spend-limit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spend-limit.js","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/spend-limit.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,2DAAwD;AAGxD,6DAAuD;AAEvD,MAAa,UAAW,SAAQ,sBAAW;IACzC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAiB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,0BAA0B,SAAS,cAAc,EAAE;YAC7E,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CACJ,SAAiB,EACjB,IAA4B,EAC5B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,0BAA0B,SAAS,cAAc,EAAE;YAC9E,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,SAAiB,EAAE,OAAwB;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,0BAA0B,SAAS,cAAc,EAAE;YAChF,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF;AAhED,gCAgEC"}
@@ -0,0 +1,63 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../../../core/resource.mjs";
3
+ import { path } from "../../../../internal/utils/path.mjs";
4
+ export class SpendLimit extends APIResource {
5
+ /**
6
+ * Get a project's hard spend limit.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const projectSpendLimit =
11
+ * await client.admin.organization.projects.spendLimit.retrieve(
12
+ * 'proj_123',
13
+ * );
14
+ * ```
15
+ */
16
+ retrieve(projectID, options) {
17
+ return this._client.get(path `/organization/projects/${projectID}/spend_limit`, {
18
+ ...options,
19
+ __security: { adminAPIKeyAuth: true },
20
+ });
21
+ }
22
+ /**
23
+ * Create or replace a project's hard spend limit.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const projectSpendLimit =
28
+ * await client.admin.organization.projects.spendLimit.update(
29
+ * 'proj_123',
30
+ * {
31
+ * currency: 'USD',
32
+ * interval: 'month',
33
+ * threshold_amount: 1,
34
+ * },
35
+ * );
36
+ * ```
37
+ */
38
+ update(projectID, body, options) {
39
+ return this._client.post(path `/organization/projects/${projectID}/spend_limit`, {
40
+ body,
41
+ ...options,
42
+ __security: { adminAPIKeyAuth: true },
43
+ });
44
+ }
45
+ /**
46
+ * Delete a project's hard spend limit.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const projectSpendLimitDeleted =
51
+ * await client.admin.organization.projects.spendLimit.delete(
52
+ * 'proj_123',
53
+ * );
54
+ * ```
55
+ */
56
+ delete(projectID, options) {
57
+ return this._client.delete(path `/organization/projects/${projectID}/spend_limit`, {
58
+ ...options,
59
+ __security: { adminAPIKeyAuth: true },
60
+ });
61
+ }
62
+ }
63
+ //# sourceMappingURL=spend-limit.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spend-limit.mjs","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/spend-limit.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,sCAAkC;AAGxD,OAAO,EAAE,IAAI,EAAE,4CAAwC;AAEvD,MAAM,OAAO,UAAW,SAAQ,WAAW;IACzC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAiB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,0BAA0B,SAAS,cAAc,EAAE;YAC7E,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CACJ,SAAiB,EACjB,IAA4B,EAC5B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,0BAA0B,SAAS,cAAc,EAAE;YAC9E,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,SAAiB,EAAE,OAAwB;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,0BAA0B,SAAS,cAAc,EAAE;YAChF,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,108 @@
1
+ import { APIResource } from "../../../core/resource.mjs";
2
+ import { APIPromise } from "../../../core/api-promise.mjs";
3
+ import { RequestOptions } from "../../../internal/request-options.mjs";
4
+ export declare class SpendLimit extends APIResource {
5
+ /**
6
+ * Get the organization's hard spend limit.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const organizationSpendLimit =
11
+ * await client.admin.organization.spendLimit.retrieve();
12
+ * ```
13
+ */
14
+ retrieve(options?: RequestOptions): APIPromise<OrganizationSpendLimit>;
15
+ /**
16
+ * Create or replace the organization's hard spend limit.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const organizationSpendLimit =
21
+ * await client.admin.organization.spendLimit.update({
22
+ * currency: 'USD',
23
+ * interval: 'month',
24
+ * threshold_amount: 1,
25
+ * });
26
+ * ```
27
+ */
28
+ update(body: SpendLimitUpdateParams, options?: RequestOptions): APIPromise<OrganizationSpendLimit>;
29
+ /**
30
+ * Delete the organization's hard spend limit.
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const organizationSpendLimitDeleted =
35
+ * await client.admin.organization.spendLimit.delete();
36
+ * ```
37
+ */
38
+ delete(options?: RequestOptions): APIPromise<OrganizationSpendLimitDeleted>;
39
+ }
40
+ /**
41
+ * Represents a hard spend limit configured at the organization level.
42
+ */
43
+ export interface OrganizationSpendLimit {
44
+ /**
45
+ * The currency for the threshold amount. Currently, only `USD` is supported.
46
+ */
47
+ currency: (string & {}) | 'USD';
48
+ /**
49
+ * The current enforcement state of the hard spend limit.
50
+ */
51
+ enforcement: OrganizationSpendLimit.Enforcement;
52
+ /**
53
+ * The time interval for evaluating spend against the threshold. Currently, only
54
+ * `month` is supported.
55
+ */
56
+ interval: (string & {}) | 'month';
57
+ /**
58
+ * The object type, which is always `organization.spend_limit`.
59
+ */
60
+ object: 'organization.spend_limit';
61
+ /**
62
+ * The hard spend limit amount, in cents.
63
+ */
64
+ threshold_amount: number;
65
+ }
66
+ export declare namespace OrganizationSpendLimit {
67
+ /**
68
+ * The current enforcement state of the hard spend limit.
69
+ */
70
+ interface Enforcement {
71
+ /**
72
+ * Whether the hard spend limit is currently enforcing.
73
+ */
74
+ status: (string & {}) | 'inactive' | 'enforcing';
75
+ }
76
+ }
77
+ /**
78
+ * Confirmation payload returned after deleting an organization hard spend limit.
79
+ */
80
+ export interface OrganizationSpendLimitDeleted {
81
+ /**
82
+ * Whether the hard spend limit was deleted.
83
+ */
84
+ deleted: boolean;
85
+ /**
86
+ * The object type, which is always `organization.spend_limit.deleted`.
87
+ */
88
+ object: 'organization.spend_limit.deleted';
89
+ }
90
+ export interface SpendLimitUpdateParams {
91
+ /**
92
+ * The currency for the threshold amount. Currently, only `USD` is supported.
93
+ */
94
+ currency: 'USD';
95
+ /**
96
+ * The time interval for evaluating spend against the threshold. Currently, only
97
+ * `month` is supported.
98
+ */
99
+ interval: 'month';
100
+ /**
101
+ * The hard spend limit amount, in cents.
102
+ */
103
+ threshold_amount: number;
104
+ }
105
+ export declare namespace SpendLimit {
106
+ export { type OrganizationSpendLimit as OrganizationSpendLimit, type OrganizationSpendLimitDeleted as OrganizationSpendLimitDeleted, type SpendLimitUpdateParams as SpendLimitUpdateParams, };
107
+ }
108
+ //# sourceMappingURL=spend-limit.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spend-limit.d.mts","sourceRoot":"","sources":["../../../src/resources/admin/organization/spend-limit.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,sCAAkC;AACvD,OAAO,EAAE,cAAc,EAAE,8CAA0C;AAEnE,qBAAa,UAAW,SAAQ,WAAW;IACzC;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,sBAAsB,CAAC;IAOtE;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,sBAAsB,CAAC;IAQlG;;;;;;;;OAQG;IACH,MAAM,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,6BAA6B,CAAC;CAM5E;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,QAAQ,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC;IAEhC;;OAEG;IACH,WAAW,EAAE,sBAAsB,CAAC,WAAW,CAAC;IAEhD;;;OAGG;IACH,QAAQ,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC;IAElC;;OAEG;IACH,MAAM,EAAE,0BAA0B,CAAC;IAEnC;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,yBAAiB,sBAAsB,CAAC;IACtC;;OAEG;IACH,UAAiB,WAAW;QAC1B;;WAEG;QACH,MAAM,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,UAAU,GAAG,WAAW,CAAC;KAClD;CACF;AAED;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,kCAAkC,CAAC;CAC5C;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC;IAEhB;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EACL,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -0,0 +1,108 @@
1
+ import { APIResource } from "../../../core/resource.js";
2
+ import { APIPromise } from "../../../core/api-promise.js";
3
+ import { RequestOptions } from "../../../internal/request-options.js";
4
+ export declare class SpendLimit extends APIResource {
5
+ /**
6
+ * Get the organization's hard spend limit.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const organizationSpendLimit =
11
+ * await client.admin.organization.spendLimit.retrieve();
12
+ * ```
13
+ */
14
+ retrieve(options?: RequestOptions): APIPromise<OrganizationSpendLimit>;
15
+ /**
16
+ * Create or replace the organization's hard spend limit.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const organizationSpendLimit =
21
+ * await client.admin.organization.spendLimit.update({
22
+ * currency: 'USD',
23
+ * interval: 'month',
24
+ * threshold_amount: 1,
25
+ * });
26
+ * ```
27
+ */
28
+ update(body: SpendLimitUpdateParams, options?: RequestOptions): APIPromise<OrganizationSpendLimit>;
29
+ /**
30
+ * Delete the organization's hard spend limit.
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const organizationSpendLimitDeleted =
35
+ * await client.admin.organization.spendLimit.delete();
36
+ * ```
37
+ */
38
+ delete(options?: RequestOptions): APIPromise<OrganizationSpendLimitDeleted>;
39
+ }
40
+ /**
41
+ * Represents a hard spend limit configured at the organization level.
42
+ */
43
+ export interface OrganizationSpendLimit {
44
+ /**
45
+ * The currency for the threshold amount. Currently, only `USD` is supported.
46
+ */
47
+ currency: (string & {}) | 'USD';
48
+ /**
49
+ * The current enforcement state of the hard spend limit.
50
+ */
51
+ enforcement: OrganizationSpendLimit.Enforcement;
52
+ /**
53
+ * The time interval for evaluating spend against the threshold. Currently, only
54
+ * `month` is supported.
55
+ */
56
+ interval: (string & {}) | 'month';
57
+ /**
58
+ * The object type, which is always `organization.spend_limit`.
59
+ */
60
+ object: 'organization.spend_limit';
61
+ /**
62
+ * The hard spend limit amount, in cents.
63
+ */
64
+ threshold_amount: number;
65
+ }
66
+ export declare namespace OrganizationSpendLimit {
67
+ /**
68
+ * The current enforcement state of the hard spend limit.
69
+ */
70
+ interface Enforcement {
71
+ /**
72
+ * Whether the hard spend limit is currently enforcing.
73
+ */
74
+ status: (string & {}) | 'inactive' | 'enforcing';
75
+ }
76
+ }
77
+ /**
78
+ * Confirmation payload returned after deleting an organization hard spend limit.
79
+ */
80
+ export interface OrganizationSpendLimitDeleted {
81
+ /**
82
+ * Whether the hard spend limit was deleted.
83
+ */
84
+ deleted: boolean;
85
+ /**
86
+ * The object type, which is always `organization.spend_limit.deleted`.
87
+ */
88
+ object: 'organization.spend_limit.deleted';
89
+ }
90
+ export interface SpendLimitUpdateParams {
91
+ /**
92
+ * The currency for the threshold amount. Currently, only `USD` is supported.
93
+ */
94
+ currency: 'USD';
95
+ /**
96
+ * The time interval for evaluating spend against the threshold. Currently, only
97
+ * `month` is supported.
98
+ */
99
+ interval: 'month';
100
+ /**
101
+ * The hard spend limit amount, in cents.
102
+ */
103
+ threshold_amount: number;
104
+ }
105
+ export declare namespace SpendLimit {
106
+ export { type OrganizationSpendLimit as OrganizationSpendLimit, type OrganizationSpendLimitDeleted as OrganizationSpendLimitDeleted, type SpendLimitUpdateParams as SpendLimitUpdateParams, };
107
+ }
108
+ //# sourceMappingURL=spend-limit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spend-limit.d.ts","sourceRoot":"","sources":["../../../src/resources/admin/organization/spend-limit.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,qCAAkC;AACvD,OAAO,EAAE,cAAc,EAAE,6CAA0C;AAEnE,qBAAa,UAAW,SAAQ,WAAW;IACzC;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,sBAAsB,CAAC;IAOtE;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,sBAAsB,CAAC;IAQlG;;;;;;;;OAQG;IACH,MAAM,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,6BAA6B,CAAC;CAM5E;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,QAAQ,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC;IAEhC;;OAEG;IACH,WAAW,EAAE,sBAAsB,CAAC,WAAW,CAAC;IAEhD;;;OAGG;IACH,QAAQ,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC;IAElC;;OAEG;IACH,MAAM,EAAE,0BAA0B,CAAC;IAEnC;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,yBAAiB,sBAAsB,CAAC;IACtC;;OAEG;IACH,UAAiB,WAAW;QAC1B;;WAEG;QACH,MAAM,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,UAAU,GAAG,WAAW,CAAC;KAClD;CACF;AAED;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,kCAAkC,CAAC;CAC5C;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC;IAEhB;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EACL,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.SpendLimit = void 0;
5
+ const resource_1 = require("../../../core/resource.js");
6
+ class SpendLimit extends resource_1.APIResource {
7
+ /**
8
+ * Get the organization's hard spend limit.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const organizationSpendLimit =
13
+ * await client.admin.organization.spendLimit.retrieve();
14
+ * ```
15
+ */
16
+ retrieve(options) {
17
+ return this._client.get('/organization/spend_limit', {
18
+ ...options,
19
+ __security: { adminAPIKeyAuth: true },
20
+ });
21
+ }
22
+ /**
23
+ * Create or replace the organization's hard spend limit.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const organizationSpendLimit =
28
+ * await client.admin.organization.spendLimit.update({
29
+ * currency: 'USD',
30
+ * interval: 'month',
31
+ * threshold_amount: 1,
32
+ * });
33
+ * ```
34
+ */
35
+ update(body, options) {
36
+ return this._client.post('/organization/spend_limit', {
37
+ body,
38
+ ...options,
39
+ __security: { adminAPIKeyAuth: true },
40
+ });
41
+ }
42
+ /**
43
+ * Delete the organization's hard spend limit.
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const organizationSpendLimitDeleted =
48
+ * await client.admin.organization.spendLimit.delete();
49
+ * ```
50
+ */
51
+ delete(options) {
52
+ return this._client.delete('/organization/spend_limit', {
53
+ ...options,
54
+ __security: { adminAPIKeyAuth: true },
55
+ });
56
+ }
57
+ }
58
+ exports.SpendLimit = SpendLimit;
59
+ //# sourceMappingURL=spend-limit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spend-limit.js","sourceRoot":"","sources":["../../../src/resources/admin/organization/spend-limit.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAIrD,MAAa,UAAW,SAAQ,sBAAW;IACzC;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAwB;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE;YACnD,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE;YACpD,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,OAAwB;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,2BAA2B,EAAE;YACtD,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF;AArDD,gCAqDC"}