@roarkanalytics/sdk 5.16.0 → 5.18.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 (59) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/client.d.mts +3 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +3 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/agent.d.mts +22 -1
  12. package/resources/agent.d.mts.map +1 -1
  13. package/resources/agent.d.ts +22 -1
  14. package/resources/agent.d.ts.map +1 -1
  15. package/resources/call.d.mts +2 -2
  16. package/resources/call.d.mts.map +1 -1
  17. package/resources/call.d.ts +2 -2
  18. package/resources/call.d.ts.map +1 -1
  19. package/resources/index.d.mts +1 -0
  20. package/resources/index.d.mts.map +1 -1
  21. package/resources/index.d.ts +1 -0
  22. package/resources/index.d.ts.map +1 -1
  23. package/resources/index.js +3 -1
  24. package/resources/index.js.map +1 -1
  25. package/resources/index.mjs +1 -0
  26. package/resources/index.mjs.map +1 -1
  27. package/resources/metric.d.mts +638 -52
  28. package/resources/metric.d.mts.map +1 -1
  29. package/resources/metric.d.ts +638 -52
  30. package/resources/metric.d.ts.map +1 -1
  31. package/resources/phone-number.d.mts +367 -0
  32. package/resources/phone-number.d.mts.map +1 -0
  33. package/resources/phone-number.d.ts +367 -0
  34. package/resources/phone-number.d.ts.map +1 -0
  35. package/resources/phone-number.js +88 -0
  36. package/resources/phone-number.js.map +1 -0
  37. package/resources/phone-number.mjs +84 -0
  38. package/resources/phone-number.mjs.map +1 -0
  39. package/resources/simulation-run-plan-job.d.mts +2 -2
  40. package/resources/simulation-run-plan-job.d.mts.map +1 -1
  41. package/resources/simulation-run-plan-job.d.ts +2 -2
  42. package/resources/simulation-run-plan-job.d.ts.map +1 -1
  43. package/resources/usage.d.mts +1 -1
  44. package/resources/usage.d.mts.map +1 -1
  45. package/resources/usage.d.ts +1 -1
  46. package/resources/usage.d.ts.map +1 -1
  47. package/src/client.ts +29 -0
  48. package/src/resources/agent.ts +25 -1
  49. package/src/resources/call.ts +4 -2
  50. package/src/resources/index.ts +13 -0
  51. package/src/resources/metric.ts +742 -64
  52. package/src/resources/phone-number.ts +472 -0
  53. package/src/resources/simulation-run-plan-job.ts +4 -2
  54. package/src/resources/usage.ts +2 -1
  55. package/src/version.ts +1 -1
  56. package/version.d.mts +1 -1
  57. package/version.d.ts +1 -1
  58. package/version.js +1 -1
  59. package/version.mjs +1 -1
@@ -0,0 +1,367 @@
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 PhoneNumber extends APIResource {
5
+ /**
6
+ * Buys a number from the carrier for this project. Free inside the plan allowance;
7
+ * past it, the first month of rent is charged now and monthly after that.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const phoneNumber = await client.phoneNumber.create({
12
+ * e164: '+14155550123',
13
+ * });
14
+ * ```
15
+ */
16
+ create(body: PhoneNumberCreateParams, options?: RequestOptions): APIPromise<PhoneNumberCreateResponse>;
17
+ /**
18
+ * Relabels a number or changes which agent it is assigned to. A field left out is
19
+ * untouched; null clears it.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const phoneNumber = await client.phoneNumber.update(
24
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
25
+ * );
26
+ * ```
27
+ */
28
+ update(phoneNumberID: string, body?: PhoneNumberUpdateParams | null | undefined, options?: RequestOptions): APIPromise<PhoneNumberUpdateResponse>;
29
+ /**
30
+ * Returns the phone numbers the project owns, oldest first, with the agent each is
31
+ * assigned to.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const phoneNumbers = await client.phoneNumber.list();
36
+ * ```
37
+ */
38
+ list(query?: PhoneNumberListParams | null | undefined, options?: RequestOptions): APIPromise<PhoneNumberListResponse>;
39
+ /**
40
+ * Gives the number back to the carrier. This cannot be undone: rent stops today
41
+ * and nothing is refunded.
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * const phoneNumber = await client.phoneNumber.delete(
46
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
47
+ * );
48
+ * ```
49
+ */
50
+ delete(phoneNumberID: string, options?: RequestOptions): APIPromise<PhoneNumberDeleteResponse>;
51
+ /**
52
+ * Returns how many numbers the organization gets for free, how many it holds, what
53
+ * a paid number costs a month, and whether a purchase would be admitted right now.
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * const response = await client.phoneNumber.getAllowance();
58
+ * ```
59
+ */
60
+ getAllowance(options?: RequestOptions): APIPromise<PhoneNumberGetAllowanceResponse>;
61
+ /**
62
+ * Returns US numbers the carrier has for sale, narrowed by area code or by digits
63
+ * the number must contain. Buy one with POST /v1/phone-number.
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * const response = await client.phoneNumber.listAvailable();
68
+ * ```
69
+ */
70
+ listAvailable(query?: PhoneNumberListAvailableParams | null | undefined, options?: RequestOptions): APIPromise<PhoneNumberListAvailableResponse>;
71
+ }
72
+ export interface PhoneNumberCreateResponse {
73
+ /**
74
+ * A phone number the project owns
75
+ */
76
+ data: PhoneNumberCreateResponse.Data;
77
+ }
78
+ export declare namespace PhoneNumberCreateResponse {
79
+ /**
80
+ * A phone number the project owns
81
+ */
82
+ interface Data {
83
+ /**
84
+ * Phone number ID
85
+ */
86
+ id: string;
87
+ /**
88
+ * The agent the number is assigned to, if any
89
+ */
90
+ agentId: string | null;
91
+ /**
92
+ * The number in E.164 format
93
+ */
94
+ e164: string;
95
+ /**
96
+ * Whether the number sits inside the plan free allowance right now
97
+ */
98
+ isFree: boolean;
99
+ /**
100
+ * ISO 3166-2 code of the region the number is from, when the carrier gave one
101
+ */
102
+ localityCode: string | null;
103
+ /**
104
+ * What a month of this number costs in micro-dollars; 0 while it is free
105
+ */
106
+ monthlyRentMicros: number;
107
+ /**
108
+ * Label the project gave the number
109
+ */
110
+ name: string | null;
111
+ /**
112
+ * When the number was bought (ISO 8601)
113
+ */
114
+ purchasedAt: string;
115
+ /**
116
+ * When the next month of rent is due (ISO 8601)
117
+ */
118
+ rentNextChargeAt: string;
119
+ }
120
+ }
121
+ export interface PhoneNumberUpdateResponse {
122
+ /**
123
+ * A phone number the project owns
124
+ */
125
+ data: PhoneNumberUpdateResponse.Data;
126
+ }
127
+ export declare namespace PhoneNumberUpdateResponse {
128
+ /**
129
+ * A phone number the project owns
130
+ */
131
+ interface Data {
132
+ /**
133
+ * Phone number ID
134
+ */
135
+ id: string;
136
+ /**
137
+ * The agent the number is assigned to, if any
138
+ */
139
+ agentId: string | null;
140
+ /**
141
+ * The number in E.164 format
142
+ */
143
+ e164: string;
144
+ /**
145
+ * Whether the number sits inside the plan free allowance right now
146
+ */
147
+ isFree: boolean;
148
+ /**
149
+ * ISO 3166-2 code of the region the number is from, when the carrier gave one
150
+ */
151
+ localityCode: string | null;
152
+ /**
153
+ * What a month of this number costs in micro-dollars; 0 while it is free
154
+ */
155
+ monthlyRentMicros: number;
156
+ /**
157
+ * Label the project gave the number
158
+ */
159
+ name: string | null;
160
+ /**
161
+ * When the number was bought (ISO 8601)
162
+ */
163
+ purchasedAt: string;
164
+ /**
165
+ * When the next month of rent is due (ISO 8601)
166
+ */
167
+ rentNextChargeAt: string;
168
+ }
169
+ }
170
+ export interface PhoneNumberListResponse {
171
+ data: Array<PhoneNumberListResponse.Data>;
172
+ }
173
+ export declare namespace PhoneNumberListResponse {
174
+ /**
175
+ * A phone number the project owns
176
+ */
177
+ interface Data {
178
+ /**
179
+ * Phone number ID
180
+ */
181
+ id: string;
182
+ /**
183
+ * The agent the number is assigned to, if any
184
+ */
185
+ agentId: string | null;
186
+ /**
187
+ * The number in E.164 format
188
+ */
189
+ e164: string;
190
+ /**
191
+ * Whether the number sits inside the plan free allowance right now
192
+ */
193
+ isFree: boolean;
194
+ /**
195
+ * ISO 3166-2 code of the region the number is from, when the carrier gave one
196
+ */
197
+ localityCode: string | null;
198
+ /**
199
+ * What a month of this number costs in micro-dollars; 0 while it is free
200
+ */
201
+ monthlyRentMicros: number;
202
+ /**
203
+ * Label the project gave the number
204
+ */
205
+ name: string | null;
206
+ /**
207
+ * When the number was bought (ISO 8601)
208
+ */
209
+ purchasedAt: string;
210
+ /**
211
+ * When the next month of rent is due (ISO 8601)
212
+ */
213
+ rentNextChargeAt: string;
214
+ }
215
+ }
216
+ export interface PhoneNumberDeleteResponse {
217
+ /**
218
+ * Confirmation that a phone number was released
219
+ */
220
+ data: PhoneNumberDeleteResponse.Data;
221
+ }
222
+ export declare namespace PhoneNumberDeleteResponse {
223
+ /**
224
+ * Confirmation that a phone number was released
225
+ */
226
+ interface Data {
227
+ /**
228
+ * Phone number ID
229
+ */
230
+ id: string;
231
+ /**
232
+ * Always true; the number is gone and rent has stopped
233
+ */
234
+ released: true;
235
+ }
236
+ }
237
+ export interface PhoneNumberGetAllowanceResponse {
238
+ /**
239
+ * How many numbers the organization gets for free and whether it may buy the next
240
+ * one
241
+ */
242
+ data: PhoneNumberGetAllowanceResponse.Data;
243
+ }
244
+ export declare namespace PhoneNumberGetAllowanceResponse {
245
+ /**
246
+ * How many numbers the organization gets for free and whether it may buy the next
247
+ * one
248
+ */
249
+ interface Data {
250
+ /**
251
+ * Why a purchase would be refused; null when canPurchase is true
252
+ */
253
+ blockedReason: 'PAYMENT_METHOD_REQUIRED' | 'INSUFFICIENT_CREDITS' | 'SPEND_CAP_REACHED' | 'PLAN_LIMIT_REACHED' | null;
254
+ /**
255
+ * Whether a purchase would be admitted right now
256
+ */
257
+ canPurchase: boolean;
258
+ /**
259
+ * Numbers included at no charge
260
+ */
261
+ freeLimit: number;
262
+ /**
263
+ * True when the free allowance comes from a per-organization override
264
+ */
265
+ isOverridden: boolean;
266
+ /**
267
+ * What one paid number costs a month, in micro-dollars
268
+ */
269
+ monthlyRentMicros: number;
270
+ /**
271
+ * Whether the next number would be free
272
+ */
273
+ nextIsFree: boolean;
274
+ /**
275
+ * How many of those sit outside the free allowance
276
+ */
277
+ paidCount: number;
278
+ /**
279
+ * The billing plan the allowance comes from
280
+ */
281
+ plan: 'PAYG' | 'TEAM' | 'ENTERPRISE';
282
+ /**
283
+ * Numbers the organization holds right now
284
+ */
285
+ used: number;
286
+ }
287
+ }
288
+ export interface PhoneNumberListAvailableResponse {
289
+ data: Array<PhoneNumberListAvailableResponse.Data>;
290
+ }
291
+ export declare namespace PhoneNumberListAvailableResponse {
292
+ /**
293
+ * A number the carrier has for sale
294
+ */
295
+ interface Data {
296
+ /**
297
+ * The number in E.164 format
298
+ */
299
+ e164: string;
300
+ /**
301
+ * Locality the carrier lists, e.g. a city
302
+ */
303
+ locality: string | null;
304
+ /**
305
+ * Region the carrier lists, e.g. a state code
306
+ */
307
+ region: string | null;
308
+ }
309
+ }
310
+ export interface PhoneNumberCreateParams {
311
+ /**
312
+ * The number to buy, in E.164 format, from a search result
313
+ */
314
+ e164: string;
315
+ /**
316
+ * The agent to assign the number to
317
+ */
318
+ agentId?: string;
319
+ /**
320
+ * Whether you expect this number to be free (from the allowance). The purchase is
321
+ * refused with 409 if that has changed since you checked.
322
+ */
323
+ expectFree?: boolean;
324
+ /**
325
+ * The monthly rent you expect for a paid number, in micros (from the allowance).
326
+ * The purchase is refused with 409 if that has changed since you checked.
327
+ */
328
+ expectMonthlyRentMicros?: number;
329
+ /**
330
+ * A label for the number
331
+ */
332
+ name?: string;
333
+ }
334
+ export interface PhoneNumberUpdateParams {
335
+ /**
336
+ * Agent to assign the number to; null unassigns, omit to leave it alone
337
+ */
338
+ agentId?: string | null;
339
+ /**
340
+ * New label; null clears it, omit to leave it alone
341
+ */
342
+ name?: string | null;
343
+ }
344
+ export interface PhoneNumberListParams {
345
+ /**
346
+ * Only the numbers assigned to this agent
347
+ */
348
+ agentId?: string;
349
+ }
350
+ export interface PhoneNumberListAvailableParams {
351
+ /**
352
+ * Three-digit US area code
353
+ */
354
+ areaCode?: string;
355
+ /**
356
+ * Digits or letters the number must contain (1 to 7, \* matches any digit)
357
+ */
358
+ contains?: string;
359
+ /**
360
+ * Maximum number of results (default: 20, max: 50)
361
+ */
362
+ limit?: number;
363
+ }
364
+ export declare namespace PhoneNumber {
365
+ export { type PhoneNumberCreateResponse as PhoneNumberCreateResponse, type PhoneNumberUpdateResponse as PhoneNumberUpdateResponse, type PhoneNumberListResponse as PhoneNumberListResponse, type PhoneNumberDeleteResponse as PhoneNumberDeleteResponse, type PhoneNumberGetAllowanceResponse as PhoneNumberGetAllowanceResponse, type PhoneNumberListAvailableResponse as PhoneNumberListAvailableResponse, type PhoneNumberCreateParams as PhoneNumberCreateParams, type PhoneNumberUpdateParams as PhoneNumberUpdateParams, type PhoneNumberListParams as PhoneNumberListParams, type PhoneNumberListAvailableParams as PhoneNumberListAvailableParams, };
366
+ }
367
+ //# sourceMappingURL=phone-number.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phone-number.d.ts","sourceRoot":"","sources":["../src/resources/phone-number.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAI,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,yBAAyB,CAAC;IAItG;;;;;;;;;;OAUG;IACH,MAAM,CACJ,aAAa,EAAE,MAAM,EACrB,IAAI,GAAE,uBAAuB,GAAG,IAAI,GAAG,SAAc,EACrD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,yBAAyB,CAAC;IAIxC;;;;;;;;OAQG;IACH,IAAI,CACF,KAAK,GAAE,qBAAqB,GAAG,IAAI,GAAG,SAAc,EACpD,OAAO,CAAC,EAAE,c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AAG,IAAI,CAAC;IAExB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,8BAA8B,IAAI,8BAA8B,GACtE,CAAC;CACH"}
@@ -0,0 +1,88 @@
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.PhoneNumber = void 0;
5
+ const resource_1 = require("../core/resource.js");
6
+ const path_1 = require("../internal/utils/path.js");
7
+ class PhoneNumber extends resource_1.APIResource {
8
+ /**
9
+ * Buys a number from the carrier for this project. Free inside the plan allowance;
10
+ * past it, the first month of rent is charged now and monthly after that.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const phoneNumber = await client.phoneNumber.create({
15
+ * e164: '+14155550123',
16
+ * });
17
+ * ```
18
+ */
19
+ create(body, options) {
20
+ return this._client.post('/v1/phone-number', { body, ...options });
21
+ }
22
+ /**
23
+ * Relabels a number or changes which agent it is assigned to. A field left out is
24
+ * untouched; null clears it.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * const phoneNumber = await client.phoneNumber.update(
29
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
30
+ * );
31
+ * ```
32
+ */
33
+ update(phoneNumberID, body = {}, options) {
34
+ return this._client.put((0, path_1.path) `/v1/phone-number/${phoneNumberID}`, { body, ...options });
35
+ }
36
+ /**
37
+ * Returns the phone numbers the project owns, oldest first, with the agent each is
38
+ * assigned to.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const phoneNumbers = await client.phoneNumber.list();
43
+ * ```
44
+ */
45
+ list(query = {}, options) {
46
+ return this._client.get('/v1/phone-number', { query, ...options });
47
+ }
48
+ /**
49
+ * Gives the number back to the carrier. This cannot be undone: rent stops today
50
+ * and nothing is refunded.
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * const phoneNumber = await client.phoneNumber.delete(
55
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
56
+ * );
57
+ * ```
58
+ */
59
+ delete(phoneNumberID, options) {
60
+ return this._client.delete((0, path_1.path) `/v1/phone-number/${phoneNumberID}`, options);
61
+ }
62
+ /**
63
+ * Returns how many numbers the organization gets for free, how many it holds, what
64
+ * a paid number costs a month, and whether a purchase would be admitted right now.
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * const response = await client.phoneNumber.getAllowance();
69
+ * ```
70
+ */
71
+ getAllowance(options) {
72
+ return this._client.get('/v1/phone-number/allowance', options);
73
+ }
74
+ /**
75
+ * Returns US numbers the carrier has for sale, narrowed by area code or by digits
76
+ * the number must contain. Buy one with POST /v1/phone-number.
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * const response = await client.phoneNumber.listAvailable();
81
+ * ```
82
+ */
83
+ listAvailable(query = {}, options) {
84
+ return this._client.get('/v1/phone-number/available', { query, ...options });
85
+ }
86
+ }
87
+ exports.PhoneNumber = PhoneNumber;
88
+ //# sourceMappingURL=phone-number.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phone-number.js","sourceRoot":"","sources":["../src/resources/phone-number.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAA6B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CACJ,aAAqB,EACrB,OAAmD,EAAE,EACrD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,oBAAoB,aAAa,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CACF,QAAkD,EAAE,EACpD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,aAAqB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,oBAAoB,aAAa,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;OAQG;IACH,YAAY,CAAC,OAAwB;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;OAQG;IACH,aAAa,CACX,QAA2D,EAAE,EAC7D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF;AA9FD,kCA8FC"}
@@ -0,0 +1,84 @@
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 PhoneNumber extends APIResource {
5
+ /**
6
+ * Buys a number from the carrier for this project. Free inside the plan allowance;
7
+ * past it, the first month of rent is charged now and monthly after that.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const phoneNumber = await client.phoneNumber.create({
12
+ * e164: '+14155550123',
13
+ * });
14
+ * ```
15
+ */
16
+ create(body, options) {
17
+ return this._client.post('/v1/phone-number', { body, ...options });
18
+ }
19
+ /**
20
+ * Relabels a number or changes which agent it is assigned to. A field left out is
21
+ * untouched; null clears it.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const phoneNumber = await client.phoneNumber.update(
26
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
27
+ * );
28
+ * ```
29
+ */
30
+ update(phoneNumberID, body = {}, options) {
31
+ return this._client.put(path `/v1/phone-number/${phoneNumberID}`, { body, ...options });
32
+ }
33
+ /**
34
+ * Returns the phone numbers the project owns, oldest first, with the agent each is
35
+ * assigned to.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * const phoneNumbers = await client.phoneNumber.list();
40
+ * ```
41
+ */
42
+ list(query = {}, options) {
43
+ return this._client.get('/v1/phone-number', { query, ...options });
44
+ }
45
+ /**
46
+ * Gives the number back to the carrier. This cannot be undone: rent stops today
47
+ * and nothing is refunded.
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * const phoneNumber = await client.phoneNumber.delete(
52
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
53
+ * );
54
+ * ```
55
+ */
56
+ delete(phoneNumberID, options) {
57
+ return this._client.delete(path `/v1/phone-number/${phoneNumberID}`, options);
58
+ }
59
+ /**
60
+ * Returns how many numbers the organization gets for free, how many it holds, what
61
+ * a paid number costs a month, and whether a purchase would be admitted right now.
62
+ *
63
+ * @example
64
+ * ```ts
65
+ * const response = await client.phoneNumber.getAllowance();
66
+ * ```
67
+ */
68
+ getAllowance(options) {
69
+ return this._client.get('/v1/phone-number/allowance', options);
70
+ }
71
+ /**
72
+ * Returns US numbers the carrier has for sale, narrowed by area code or by digits
73
+ * the number must contain. Buy one with POST /v1/phone-number.
74
+ *
75
+ * @example
76
+ * ```ts
77
+ * const response = await client.phoneNumber.listAvailable();
78
+ * ```
79
+ */
80
+ listAvailable(query = {}, options) {
81
+ return this._client.get('/v1/phone-number/available', { query, ...options });
82
+ }
83
+ }
84
+ //# sourceMappingURL=phone-number.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phone-number.mjs","sourceRoot":"","sources":["../src/resources/phone-number.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAG/C,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAA6B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CACJ,aAAqB,EACrB,OAAmD,EAAE,EACrD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,oBAAoB,aAAa,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CACF,QAAkD,EAAE,EACpD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,aAAqB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,oBAAoB,aAAa,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;OAQG;IACH,YAAY,CAAC,OAAwB;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;OAQG;IACH,aAAa,CACX,QAA2D,EAAE,EAC7D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF"}
@@ -1150,7 +1150,7 @@ export declare namespace SimulationRunPlanJobGetCostResponse {
1150
1150
  /**
1151
1151
  * The cost source, e.g. SIM_PLATFORM_FEE, SIM_LLM, METRIC.
1152
1152
  */
1153
- source: 'SIM_PLATFORM_FEE' | 'SIM_TTS' | 'SIM_STT' | 'SIM_LLM' | 'SIM_TELEPHONY' | 'METRIC' | 'TRANSCRIPTION' | 'INTERNAL_LLM' | 'INTERNAL_STT';
1153
+ source: 'SIM_PLATFORM_FEE' | 'SIM_TTS' | 'SIM_STT' | 'SIM_LLM' | 'SIM_TELEPHONY' | 'METRIC' | 'TRANSCRIPTION' | 'INTERNAL_LLM' | 'INTERNAL_STT' | 'PHONE_NUMBER';
1154
1154
  /**
1155
1155
  * SIMULATION or POST_CALL.
1156
1156
  */
@@ -1185,7 +1185,7 @@ export declare namespace SimulationRunPlanJobGetCostResponse {
1185
1185
  /**
1186
1186
  * The cost source, e.g. SIM_PLATFORM_FEE, SIM_LLM, METRIC.
1187
1187
  */
1188
- source: 'SIM_PLATFORM_FEE' | 'SIM_TTS' | 'SIM_STT' | 'SIM_LLM' | 'SIM_TELEPHONY' | 'METRIC' | 'TRANSCRIPTION' | 'INTERNAL_LLM' | 'INTERNAL_STT';
1188
+ source: 'SIM_PLATFORM_FEE' | 'SIM_TTS' | 'SIM_STT' | 'SIM_LLM' | 'SIM_TELEPHONY' | 'METRIC' | 'TRANSCRIPTION' | 'INTERNAL_LLM' | 'INTERNAL_STT' | 'PHONE_NUMBER';
1189
1189
  /**
1190
1190
  * SIMULATION or POST_CALL.
1191
1191
  */