agentphone 1.0.12 → 1.0.14

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 (158) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +6 -0
  3. package/dist/cjs/Client.js +20 -10
  4. package/dist/cjs/api/resources/agents/client/Client.js +11 -11
  5. package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +2 -0
  6. package/dist/cjs/api/resources/agents/client/requests/DeleteAgentV1AgentsAgentIdDeleteRequest.d.ts +2 -0
  7. package/dist/cjs/api/resources/agents/client/requests/GetAgentV1AgentsAgentIdGetRequest.d.ts +2 -0
  8. package/dist/cjs/api/resources/agents/client/requests/ListAgentsV1AgentsGetRequest.d.ts +2 -1
  9. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +2 -0
  10. package/dist/cjs/api/resources/calls/client/Client.js +16 -5
  11. package/dist/cjs/api/resources/calls/client/requests/CreateOutboundCallRequest.d.ts +2 -0
  12. package/dist/cjs/api/resources/calls/client/requests/ListCallsV1CallsGetRequest.d.ts +2 -1
  13. package/dist/cjs/api/resources/contactCards/client/Client.d.ts +1 -4
  14. package/dist/cjs/api/resources/contactCards/client/Client.js +1 -4
  15. package/dist/cjs/api/resources/contactCards/client/requests/ContactCardWriteRequest.d.ts +4 -7
  16. package/dist/cjs/api/resources/contacts/client/Client.js +2 -3
  17. package/dist/cjs/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.d.ts +2 -1
  18. package/dist/cjs/api/resources/conversations/client/Client.d.ts +5 -3
  19. package/dist/cjs/api/resources/conversations/client/Client.js +7 -6
  20. package/dist/cjs/api/resources/conversations/client/requests/ListConversationsV1ConversationsGetRequest.d.ts +2 -1
  21. package/dist/cjs/api/resources/index.d.ts +4 -0
  22. package/dist/cjs/api/resources/index.js +5 -1
  23. package/dist/cjs/api/resources/location/client/Client.d.ts +34 -0
  24. package/dist/cjs/api/resources/location/client/Client.js +146 -0
  25. package/dist/cjs/api/resources/location/client/index.d.ts +1 -0
  26. package/dist/cjs/api/resources/location/client/index.js +17 -0
  27. package/dist/cjs/api/resources/location/client/requests/GetLocationV1LocationPhoneNumberGetRequest.d.ts +9 -0
  28. package/dist/cjs/api/resources/location/client/requests/GetLocationV1LocationPhoneNumberGetRequest.js +3 -0
  29. package/dist/cjs/api/resources/location/client/requests/index.d.ts +1 -0
  30. package/dist/cjs/api/resources/location/client/requests/index.js +2 -0
  31. package/dist/cjs/api/resources/location/index.d.ts +1 -0
  32. package/dist/cjs/api/resources/location/index.js +17 -0
  33. package/dist/cjs/api/resources/messages/client/Client.d.ts +0 -1
  34. package/dist/cjs/api/resources/messages/client/Client.js +0 -1
  35. package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.d.ts +2 -2
  36. package/dist/cjs/api/resources/numbers/client/Client.d.ts +29 -7
  37. package/dist/cjs/api/resources/numbers/client/Client.js +93 -24
  38. package/dist/cjs/api/resources/numbers/client/requests/CreateNumberRequest.d.ts +2 -0
  39. package/dist/cjs/api/resources/numbers/client/requests/DeleteNumberV1NumbersNumberIdDeleteRequest.d.ts +2 -0
  40. package/dist/cjs/api/resources/numbers/client/requests/GetNumberV1NumbersNumberIdGetRequest.d.ts +9 -0
  41. package/dist/cjs/api/resources/numbers/client/requests/GetNumberV1NumbersNumberIdGetRequest.js +3 -0
  42. package/dist/cjs/api/resources/numbers/client/requests/ListNumbersV1NumbersGetRequest.d.ts +2 -1
  43. package/dist/cjs/api/resources/numbers/client/requests/index.d.ts +1 -0
  44. package/dist/cjs/api/resources/subAccounts/client/Client.d.ts +61 -0
  45. package/dist/cjs/api/resources/subAccounts/client/Client.js +261 -0
  46. package/dist/cjs/api/resources/subAccounts/client/index.d.ts +1 -0
  47. package/dist/cjs/api/resources/subAccounts/client/index.js +17 -0
  48. package/dist/cjs/api/resources/subAccounts/client/requests/CreateSubAccountRequest.d.ts +9 -0
  49. package/dist/cjs/api/resources/subAccounts/client/requests/CreateSubAccountRequest.js +3 -0
  50. package/dist/cjs/api/resources/subAccounts/client/requests/DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.d.ts +9 -0
  51. package/dist/cjs/api/resources/subAccounts/client/requests/DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.js +3 -0
  52. package/dist/cjs/api/resources/subAccounts/client/requests/UpdateSubAccountRequest.d.ts +11 -0
  53. package/dist/cjs/api/resources/subAccounts/client/requests/UpdateSubAccountRequest.js +3 -0
  54. package/dist/cjs/api/resources/subAccounts/client/requests/index.d.ts +3 -0
  55. package/dist/cjs/api/resources/subAccounts/client/requests/index.js +2 -0
  56. package/dist/cjs/api/resources/subAccounts/index.d.ts +1 -0
  57. package/dist/cjs/api/resources/subAccounts/index.js +17 -0
  58. package/dist/cjs/api/resources/webhooks/client/Client.d.ts +7 -4
  59. package/dist/cjs/api/resources/webhooks/client/Client.js +14 -9
  60. package/dist/cjs/api/resources/webhooks/client/requests/CreateOrUpdateWebhookV1WebhooksPostRequest.d.ts +14 -0
  61. package/dist/cjs/api/resources/webhooks/client/requests/CreateOrUpdateWebhookV1WebhooksPostRequest.js +3 -0
  62. package/dist/cjs/api/resources/webhooks/client/requests/GetWebhookV1WebhooksGetRequest.d.ts +8 -0
  63. package/dist/cjs/api/resources/webhooks/client/requests/GetWebhookV1WebhooksGetRequest.js +3 -0
  64. package/dist/cjs/api/resources/webhooks/client/requests/index.d.ts +2 -0
  65. package/dist/cjs/api/types/AgentVerifyRequest.d.ts +1 -0
  66. package/dist/cjs/api/types/AppRoutesConversationsConversationSummary.d.ts +6 -0
  67. package/dist/cjs/api/types/ConversationDetail.d.ts +5 -0
  68. package/dist/cjs/api/types/GroupParticipant.d.ts +7 -0
  69. package/dist/cjs/api/types/GroupParticipant.js +3 -0
  70. package/dist/cjs/api/types/LocationRefreshResponse.d.ts +4 -0
  71. package/dist/cjs/api/types/LocationRefreshResponse.js +3 -0
  72. package/dist/cjs/api/types/LocationResponse.d.ts +7 -0
  73. package/dist/cjs/api/types/LocationResponse.js +3 -0
  74. package/dist/cjs/api/types/MessageInConversation.d.ts +1 -0
  75. package/dist/cjs/api/types/index.d.ts +3 -0
  76. package/dist/cjs/api/types/index.js +3 -0
  77. package/dist/cjs/version.d.ts +1 -1
  78. package/dist/cjs/version.js +1 -1
  79. package/dist/esm/BaseClient.mjs +2 -2
  80. package/dist/esm/Client.d.mts +6 -0
  81. package/dist/esm/Client.mjs +10 -0
  82. package/dist/esm/api/resources/agents/client/Client.mjs +12 -12
  83. package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +2 -0
  84. package/dist/esm/api/resources/agents/client/requests/DeleteAgentV1AgentsAgentIdDeleteRequest.d.mts +2 -0
  85. package/dist/esm/api/resources/agents/client/requests/GetAgentV1AgentsAgentIdGetRequest.d.mts +2 -0
  86. package/dist/esm/api/resources/agents/client/requests/ListAgentsV1AgentsGetRequest.d.mts +2 -1
  87. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +2 -0
  88. package/dist/esm/api/resources/calls/client/Client.mjs +17 -6
  89. package/dist/esm/api/resources/calls/client/requests/CreateOutboundCallRequest.d.mts +2 -0
  90. package/dist/esm/api/resources/calls/client/requests/ListCallsV1CallsGetRequest.d.mts +2 -1
  91. package/dist/esm/api/resources/contactCards/client/Client.d.mts +1 -4
  92. package/dist/esm/api/resources/contactCards/client/Client.mjs +1 -4
  93. package/dist/esm/api/resources/contactCards/client/requests/ContactCardWriteRequest.d.mts +4 -7
  94. package/dist/esm/api/resources/contacts/client/Client.mjs +3 -4
  95. package/dist/esm/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.d.mts +2 -1
  96. package/dist/esm/api/resources/conversations/client/Client.d.mts +5 -3
  97. package/dist/esm/api/resources/conversations/client/Client.mjs +8 -7
  98. package/dist/esm/api/resources/conversations/client/requests/ListConversationsV1ConversationsGetRequest.d.mts +2 -1
  99. package/dist/esm/api/resources/index.d.mts +4 -0
  100. package/dist/esm/api/resources/index.mjs +4 -0
  101. package/dist/esm/api/resources/location/client/Client.d.mts +34 -0
  102. package/dist/esm/api/resources/location/client/Client.mjs +109 -0
  103. package/dist/esm/api/resources/location/client/index.d.mts +1 -0
  104. package/dist/esm/api/resources/location/client/index.mjs +1 -0
  105. package/dist/esm/api/resources/location/client/requests/GetLocationV1LocationPhoneNumberGetRequest.d.mts +9 -0
  106. package/dist/esm/api/resources/location/client/requests/GetLocationV1LocationPhoneNumberGetRequest.mjs +2 -0
  107. package/dist/esm/api/resources/location/client/requests/index.d.mts +1 -0
  108. package/dist/esm/api/resources/location/client/requests/index.mjs +1 -0
  109. package/dist/esm/api/resources/location/index.d.mts +1 -0
  110. package/dist/esm/api/resources/location/index.mjs +1 -0
  111. package/dist/esm/api/resources/messages/client/Client.d.mts +0 -1
  112. package/dist/esm/api/resources/messages/client/Client.mjs +0 -1
  113. package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.d.mts +2 -2
  114. package/dist/esm/api/resources/numbers/client/Client.d.mts +29 -7
  115. package/dist/esm/api/resources/numbers/client/Client.mjs +94 -25
  116. package/dist/esm/api/resources/numbers/client/requests/CreateNumberRequest.d.mts +2 -0
  117. package/dist/esm/api/resources/numbers/client/requests/DeleteNumberV1NumbersNumberIdDeleteRequest.d.mts +2 -0
  118. package/dist/esm/api/resources/numbers/client/requests/GetNumberV1NumbersNumberIdGetRequest.d.mts +9 -0
  119. package/dist/esm/api/resources/numbers/client/requests/GetNumberV1NumbersNumberIdGetRequest.mjs +2 -0
  120. package/dist/esm/api/resources/numbers/client/requests/ListNumbersV1NumbersGetRequest.d.mts +2 -1
  121. package/dist/esm/api/resources/numbers/client/requests/index.d.mts +1 -0
  122. package/dist/esm/api/resources/subAccounts/client/Client.d.mts +61 -0
  123. package/dist/esm/api/resources/subAccounts/client/Client.mjs +224 -0
  124. package/dist/esm/api/resources/subAccounts/client/index.d.mts +1 -0
  125. package/dist/esm/api/resources/subAccounts/client/index.mjs +1 -0
  126. package/dist/esm/api/resources/subAccounts/client/requests/CreateSubAccountRequest.d.mts +9 -0
  127. package/dist/esm/api/resources/subAccounts/client/requests/CreateSubAccountRequest.mjs +2 -0
  128. package/dist/esm/api/resources/subAccounts/client/requests/DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.d.mts +9 -0
  129. package/dist/esm/api/resources/subAccounts/client/requests/DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.mjs +2 -0
  130. package/dist/esm/api/resources/subAccounts/client/requests/UpdateSubAccountRequest.d.mts +11 -0
  131. package/dist/esm/api/resources/subAccounts/client/requests/UpdateSubAccountRequest.mjs +2 -0
  132. package/dist/esm/api/resources/subAccounts/client/requests/index.d.mts +3 -0
  133. package/dist/esm/api/resources/subAccounts/client/requests/index.mjs +1 -0
  134. package/dist/esm/api/resources/subAccounts/index.d.mts +1 -0
  135. package/dist/esm/api/resources/subAccounts/index.mjs +1 -0
  136. package/dist/esm/api/resources/webhooks/client/Client.d.mts +7 -4
  137. package/dist/esm/api/resources/webhooks/client/Client.mjs +15 -10
  138. package/dist/esm/api/resources/webhooks/client/requests/CreateOrUpdateWebhookV1WebhooksPostRequest.d.mts +14 -0
  139. package/dist/esm/api/resources/webhooks/client/requests/CreateOrUpdateWebhookV1WebhooksPostRequest.mjs +2 -0
  140. package/dist/esm/api/resources/webhooks/client/requests/GetWebhookV1WebhooksGetRequest.d.mts +8 -0
  141. package/dist/esm/api/resources/webhooks/client/requests/GetWebhookV1WebhooksGetRequest.mjs +2 -0
  142. package/dist/esm/api/resources/webhooks/client/requests/index.d.mts +2 -0
  143. package/dist/esm/api/types/AgentVerifyRequest.d.mts +1 -0
  144. package/dist/esm/api/types/AppRoutesConversationsConversationSummary.d.mts +6 -0
  145. package/dist/esm/api/types/ConversationDetail.d.mts +5 -0
  146. package/dist/esm/api/types/GroupParticipant.d.mts +7 -0
  147. package/dist/esm/api/types/GroupParticipant.mjs +2 -0
  148. package/dist/esm/api/types/LocationRefreshResponse.d.mts +4 -0
  149. package/dist/esm/api/types/LocationRefreshResponse.mjs +2 -0
  150. package/dist/esm/api/types/LocationResponse.d.mts +7 -0
  151. package/dist/esm/api/types/LocationResponse.mjs +2 -0
  152. package/dist/esm/api/types/MessageInConversation.d.mts +1 -0
  153. package/dist/esm/api/types/index.d.mts +3 -0
  154. package/dist/esm/api/types/index.mjs +3 -0
  155. package/dist/esm/version.d.mts +1 -1
  156. package/dist/esm/version.mjs +1 -1
  157. package/package.json +1 -1
  158. package/reference.md +386 -17
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.LocationClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
48
+ const headers_js_1 = require("../../../../core/headers.js");
49
+ const core = __importStar(require("../../../../core/index.js"));
50
+ const environments = __importStar(require("../../../../environments.js"));
51
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
52
+ const errors = __importStar(require("../../../../errors/index.js"));
53
+ const AgentPhone = __importStar(require("../../../index.js"));
54
+ class LocationClient {
55
+ constructor(options = {}) {
56
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
+ }
58
+ /**
59
+ * @param {AgentPhone.GetLocationV1LocationPhoneNumberGetRequest} request
60
+ * @param {LocationClient.RequestOptions} requestOptions - Request-specific configuration.
61
+ *
62
+ * @throws {@link AgentPhone.UnprocessableEntityError}
63
+ *
64
+ * @example
65
+ * await client.location.getLocation({
66
+ * phone_number: "phone_number"
67
+ * })
68
+ */
69
+ getLocation(request, requestOptions) {
70
+ return core.HttpResponsePromise.fromPromise(this.__getLocation(request, requestOptions));
71
+ }
72
+ __getLocation(request, requestOptions) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
75
+ const { phone_number: phoneNumber } = request;
76
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
77
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
78
+ const _response = yield core.fetcher({
79
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/location/${core.url.encodePathParam(phoneNumber)}`),
80
+ method: "GET",
81
+ headers: _headers,
82
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
83
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
84
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
85
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
86
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
87
+ logging: this._options.logging,
88
+ });
89
+ if (_response.ok) {
90
+ return { data: _response.body, rawResponse: _response.rawResponse };
91
+ }
92
+ if (_response.error.reason === "status-code") {
93
+ switch (_response.error.statusCode) {
94
+ case 422:
95
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
96
+ default:
97
+ throw new errors.AgentPhoneError({
98
+ statusCode: _response.error.statusCode,
99
+ body: _response.error.body,
100
+ rawResponse: _response.rawResponse,
101
+ });
102
+ }
103
+ }
104
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/location/{phone_number}");
105
+ });
106
+ }
107
+ /**
108
+ * @param {LocationClient.RequestOptions} requestOptions - Request-specific configuration.
109
+ *
110
+ * @example
111
+ * await client.location.refreshLocations()
112
+ */
113
+ refreshLocations(requestOptions) {
114
+ return core.HttpResponsePromise.fromPromise(this.__refreshLocations(requestOptions));
115
+ }
116
+ __refreshLocations(requestOptions) {
117
+ return __awaiter(this, void 0, void 0, function* () {
118
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
119
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
120
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
121
+ const _response = yield core.fetcher({
122
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "v1/location/refresh"),
123
+ method: "POST",
124
+ headers: _headers,
125
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
126
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
127
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
128
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
129
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
130
+ logging: this._options.logging,
131
+ });
132
+ if (_response.ok) {
133
+ return { data: _response.body, rawResponse: _response.rawResponse };
134
+ }
135
+ if (_response.error.reason === "status-code") {
136
+ throw new errors.AgentPhoneError({
137
+ statusCode: _response.error.statusCode,
138
+ body: _response.error.body,
139
+ rawResponse: _response.rawResponse,
140
+ });
141
+ }
142
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/location/refresh");
143
+ });
144
+ }
145
+ }
146
+ exports.LocationClient = LocationClient;
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests/index.js"), exports);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * phone_number: "phone_number"
5
+ * }
6
+ */
7
+ export interface GetLocationV1LocationPhoneNumberGetRequest {
8
+ phone_number: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type { GetLocationV1LocationPhoneNumberGetRequest } from "./GetLocationV1LocationPhoneNumberGetRequest.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
@@ -36,7 +36,6 @@ export declare class MessagesClient {
36
36
  *
37
37
  * @example
38
38
  * await client.messages.sendMessage({
39
- * agent_id: "agent_id",
40
39
  * to_number: "to_number",
41
40
  * body: "body"
42
41
  * })
@@ -92,7 +92,6 @@ class MessagesClient {
92
92
  *
93
93
  * @example
94
94
  * await client.messages.sendMessage({
95
- * agent_id: "agent_id",
96
95
  * to_number: "to_number",
97
96
  * body: "body"
98
97
  * })
@@ -1,18 +1,18 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * agent_id: "agent_id",
5
4
  * to_number: "to_number",
6
5
  * body: "body"
7
6
  * }
8
7
  */
9
8
  export interface SendMessageRequest {
10
- agent_id: string;
9
+ agent_id?: string | null;
11
10
  to_number: string;
12
11
  body: string;
13
12
  media_url?: string | null;
14
13
  media_urls?: string[] | null;
15
14
  number_id?: string | null;
15
+ from_number?: string | null;
16
16
  /** Optional iMessage expressive effect. Only valid on iMessage-capable numbers. Supported values: celebration, fireworks, lasers, love, confetti, balloons, spotlight, echo, invisible, gentle, loud, slam. */
17
17
  send_style?: SendMessageRequest.SendStyle;
18
18
  /** Optional parent message ID (AgentPhone Message.id) to send this message as an inline reply in iMessage. */
@@ -11,7 +11,11 @@ export declare class NumbersClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<NumbersClient.Options>;
12
12
  constructor(options?: NumbersClient.Options);
13
13
  /**
14
- * List all phone numbers for this account.
14
+ * List the active phone numbers for this account.
15
+ *
16
+ * Released (deleted) numbers are excluded so the count reflects the numbers
17
+ * the account actually holds. Fetch a single number via GET /{number_id}
18
+ * (which returns it regardless of status).
15
19
  *
16
20
  * @param {AgentPhone.ListNumbersV1NumbersGetRequest} request
17
21
  * @param {NumbersClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -43,22 +47,23 @@ export declare class NumbersClient {
43
47
  createNumber(request?: AgentPhone.CreateNumberRequest, requestOptions?: NumbersClient.RequestOptions): core.HttpResponsePromise<AgentPhone.PhoneNumberResponse>;
44
48
  private __createNumber;
45
49
  /**
46
- * Get messages for a specific phone number.
50
+ * Get a single phone number owned by this account.
47
51
  *
48
- * Supports cursor-based pagination via before/after timestamps.
52
+ * Returns the number regardless of status (including released) so detail
53
+ * pages still load for numbers that are no longer active.
49
54
  *
50
- * @param {AgentPhone.GetMessagesV1NumbersNumberIdMessagesGetRequest} request
55
+ * @param {AgentPhone.GetNumberV1NumbersNumberIdGetRequest} request
51
56
  * @param {NumbersClient.RequestOptions} requestOptions - Request-specific configuration.
52
57
  *
53
58
  * @throws {@link AgentPhone.UnprocessableEntityError}
54
59
  *
55
60
  * @example
56
- * await client.numbers.getMessages({
61
+ * await client.numbers.getNumber({
57
62
  * number_id: "number_id"
58
63
  * })
59
64
  */
60
- getMessages(request: AgentPhone.GetMessagesV1NumbersNumberIdMessagesGetRequest, requestOptions?: NumbersClient.RequestOptions): core.HttpResponsePromise<AgentPhone.MessageListResponse>;
61
- private __getMessages;
65
+ getNumber(request: AgentPhone.GetNumberV1NumbersNumberIdGetRequest, requestOptions?: NumbersClient.RequestOptions): core.HttpResponsePromise<AgentPhone.PhoneNumberResponse>;
66
+ private __getNumber;
62
67
  /**
63
68
  * Release (delete) a phone number.
64
69
  *
@@ -81,4 +86,21 @@ export declare class NumbersClient {
81
86
  */
82
87
  deleteNumber(request: AgentPhone.DeleteNumberV1NumbersNumberIdDeleteRequest, requestOptions?: NumbersClient.RequestOptions): core.HttpResponsePromise<unknown>;
83
88
  private __deleteNumber;
89
+ /**
90
+ * Get messages for a specific phone number.
91
+ *
92
+ * Supports cursor-based pagination via before/after timestamps.
93
+ *
94
+ * @param {AgentPhone.GetMessagesV1NumbersNumberIdMessagesGetRequest} request
95
+ * @param {NumbersClient.RequestOptions} requestOptions - Request-specific configuration.
96
+ *
97
+ * @throws {@link AgentPhone.UnprocessableEntityError}
98
+ *
99
+ * @example
100
+ * await client.numbers.getMessages({
101
+ * number_id: "number_id"
102
+ * })
103
+ */
104
+ getMessages(request: AgentPhone.GetMessagesV1NumbersNumberIdMessagesGetRequest, requestOptions?: NumbersClient.RequestOptions): core.HttpResponsePromise<AgentPhone.MessageListResponse>;
105
+ private __getMessages;
84
106
  }
@@ -42,6 +42,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
42
42
  step((generator = generator.apply(thisArg, _arguments || [])).next());
43
43
  });
44
44
  };
45
+ var __rest = (this && this.__rest) || function (s, e) {
46
+ var t = {};
47
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
48
+ t[p] = s[p];
49
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
50
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
51
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
52
+ t[p[i]] = s[p[i]];
53
+ }
54
+ return t;
55
+ };
45
56
  Object.defineProperty(exports, "__esModule", { value: true });
46
57
  exports.NumbersClient = void 0;
47
58
  const BaseClient_js_1 = require("../../../../BaseClient.js");
@@ -56,7 +67,11 @@ class NumbersClient {
56
67
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
68
  }
58
69
  /**
59
- * List all phone numbers for this account.
70
+ * List the active phone numbers for this account.
71
+ *
72
+ * Released (deleted) numbers are excluded so the count reflects the numbers
73
+ * the account actually holds. Fetch a single number via GET /{number_id}
74
+ * (which returns it regardless of status).
60
75
  *
61
76
  * @param {AgentPhone.ListNumbersV1NumbersGetRequest} request
62
77
  * @param {NumbersClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -72,13 +87,12 @@ class NumbersClient {
72
87
  __listNumbers() {
73
88
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
74
89
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
75
- const { limit, offset } = request;
90
+ const { offset, "X-Sub-Account-Id": subAccountId } = request;
76
91
  const _queryParams = {
77
- limit,
78
92
  offset,
79
93
  };
80
94
  const _authRequest = yield this._options.authProvider.getAuthRequest();
81
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
95
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
82
96
  const _response = yield core.fetcher({
83
97
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "v1/numbers"),
84
98
  method: "GET",
@@ -131,8 +145,9 @@ class NumbersClient {
131
145
  __createNumber() {
132
146
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
133
147
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
148
+ const { "X-Sub-Account-Id": subAccountId } = request, _body = __rest(request, ["X-Sub-Account-Id"]);
134
149
  const _authRequest = yield this._options.authProvider.getAuthRequest();
135
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
150
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
136
151
  const _response = yield core.fetcher({
137
152
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "v1/numbers"),
138
153
  method: "POST",
@@ -140,7 +155,7 @@ class NumbersClient {
140
155
  contentType: "application/json",
141
156
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
142
157
  requestType: "json",
143
- body: request,
158
+ body: _body,
144
159
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
145
160
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
146
161
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -166,39 +181,35 @@ class NumbersClient {
166
181
  });
167
182
  }
168
183
  /**
169
- * Get messages for a specific phone number.
184
+ * Get a single phone number owned by this account.
170
185
  *
171
- * Supports cursor-based pagination via before/after timestamps.
186
+ * Returns the number regardless of status (including released) so detail
187
+ * pages still load for numbers that are no longer active.
172
188
  *
173
- * @param {AgentPhone.GetMessagesV1NumbersNumberIdMessagesGetRequest} request
189
+ * @param {AgentPhone.GetNumberV1NumbersNumberIdGetRequest} request
174
190
  * @param {NumbersClient.RequestOptions} requestOptions - Request-specific configuration.
175
191
  *
176
192
  * @throws {@link AgentPhone.UnprocessableEntityError}
177
193
  *
178
194
  * @example
179
- * await client.numbers.getMessages({
195
+ * await client.numbers.getNumber({
180
196
  * number_id: "number_id"
181
197
  * })
182
198
  */
183
- getMessages(request, requestOptions) {
184
- return core.HttpResponsePromise.fromPromise(this.__getMessages(request, requestOptions));
199
+ getNumber(request, requestOptions) {
200
+ return core.HttpResponsePromise.fromPromise(this.__getNumber(request, requestOptions));
185
201
  }
186
- __getMessages(request, requestOptions) {
202
+ __getNumber(request, requestOptions) {
187
203
  return __awaiter(this, void 0, void 0, function* () {
188
204
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
189
- const { number_id: numberId, limit, before, after } = request;
190
- const _queryParams = {
191
- limit,
192
- before: before !== undefined ? before : undefined,
193
- after: after !== undefined ? after : undefined,
194
- };
205
+ const { number_id: numberId } = request;
195
206
  const _authRequest = yield this._options.authProvider.getAuthRequest();
196
207
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
197
208
  const _response = yield core.fetcher({
198
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/numbers/${core.url.encodePathParam(numberId)}/messages`),
209
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/numbers/${core.url.encodePathParam(numberId)}`),
199
210
  method: "GET",
200
211
  headers: _headers,
201
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
212
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
202
213
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
203
214
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
204
215
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -220,7 +231,7 @@ class NumbersClient {
220
231
  });
221
232
  }
222
233
  }
223
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/numbers/{number_id}/messages");
234
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/numbers/{number_id}");
224
235
  });
225
236
  }
226
237
  /**
@@ -249,9 +260,9 @@ class NumbersClient {
249
260
  __deleteNumber(request, requestOptions) {
250
261
  return __awaiter(this, void 0, void 0, function* () {
251
262
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
252
- const { number_id: numberId } = request;
263
+ const { number_id: numberId, "X-Sub-Account-Id": subAccountId } = request;
253
264
  const _authRequest = yield this._options.authProvider.getAuthRequest();
254
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
265
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
255
266
  const _response = yield core.fetcher({
256
267
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/numbers/${core.url.encodePathParam(numberId)}`),
257
268
  method: "DELETE",
@@ -281,5 +292,63 @@ class NumbersClient {
281
292
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v1/numbers/{number_id}");
282
293
  });
283
294
  }
295
+ /**
296
+ * Get messages for a specific phone number.
297
+ *
298
+ * Supports cursor-based pagination via before/after timestamps.
299
+ *
300
+ * @param {AgentPhone.GetMessagesV1NumbersNumberIdMessagesGetRequest} request
301
+ * @param {NumbersClient.RequestOptions} requestOptions - Request-specific configuration.
302
+ *
303
+ * @throws {@link AgentPhone.UnprocessableEntityError}
304
+ *
305
+ * @example
306
+ * await client.numbers.getMessages({
307
+ * number_id: "number_id"
308
+ * })
309
+ */
310
+ getMessages(request, requestOptions) {
311
+ return core.HttpResponsePromise.fromPromise(this.__getMessages(request, requestOptions));
312
+ }
313
+ __getMessages(request, requestOptions) {
314
+ return __awaiter(this, void 0, void 0, function* () {
315
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
316
+ const { number_id: numberId, limit, before, after } = request;
317
+ const _queryParams = {
318
+ limit,
319
+ before: before !== undefined ? before : undefined,
320
+ after: after !== undefined ? after : undefined,
321
+ };
322
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
323
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
324
+ const _response = yield core.fetcher({
325
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/numbers/${core.url.encodePathParam(numberId)}/messages`),
326
+ method: "GET",
327
+ headers: _headers,
328
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
329
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
330
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
331
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
332
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
333
+ logging: this._options.logging,
334
+ });
335
+ if (_response.ok) {
336
+ return { data: _response.body, rawResponse: _response.rawResponse };
337
+ }
338
+ if (_response.error.reason === "status-code") {
339
+ switch (_response.error.statusCode) {
340
+ case 422:
341
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
342
+ default:
343
+ throw new errors.AgentPhoneError({
344
+ statusCode: _response.error.statusCode,
345
+ body: _response.error.body,
346
+ rawResponse: _response.rawResponse,
347
+ });
348
+ }
349
+ }
350
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/numbers/{number_id}/messages");
351
+ });
352
+ }
284
353
  }
285
354
  exports.NumbersClient = NumbersClient;
@@ -3,6 +3,8 @@
3
3
  * {}
4
4
  */
5
5
  export interface CreateNumberRequest {
6
+ /** Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account. */
7
+ "X-Sub-Account-Id"?: string;
6
8
  country?: string;
7
9
  areaCode?: string | null;
8
10
  agentId?: string | null;
@@ -6,4 +6,6 @@
6
6
  */
7
7
  export interface DeleteNumberV1NumbersNumberIdDeleteRequest {
8
8
  number_id: string;
9
+ /** Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account. */
10
+ "X-Sub-Account-Id"?: string;
9
11
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * number_id: "number_id"
5
+ * }
6
+ */
7
+ export interface GetNumberV1NumbersNumberIdGetRequest {
8
+ number_id: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,6 +3,7 @@
3
3
  * {}
4
4
  */
5
5
  export interface ListNumbersV1NumbersGetRequest {
6
- limit?: number;
7
6
  offset?: number;
7
+ /** Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account. */
8
+ "X-Sub-Account-Id"?: string;
8
9
  }
@@ -1,4 +1,5 @@
1
1
  export type { CreateNumberRequest } from "./CreateNumberRequest.js";
2
2
  export type { DeleteNumberV1NumbersNumberIdDeleteRequest } from "./DeleteNumberV1NumbersNumberIdDeleteRequest.js";
3
3
  export type { GetMessagesV1NumbersNumberIdMessagesGetRequest } from "./GetMessagesV1NumbersNumberIdMessagesGetRequest.js";
4
+ export type { GetNumberV1NumbersNumberIdGetRequest } from "./GetNumberV1NumbersNumberIdGetRequest.js";
4
5
  export type { ListNumbersV1NumbersGetRequest } from "./ListNumbersV1NumbersGetRequest.js";
@@ -0,0 +1,61 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
+ import * as core from "../../../../core/index.js";
4
+ import * as AgentPhone from "../../../index.js";
5
+ export declare namespace SubAccountsClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class SubAccountsClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<SubAccountsClient.Options>;
12
+ constructor(options?: SubAccountsClient.Options);
13
+ /**
14
+ * @param {SubAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
15
+ *
16
+ * @example
17
+ * await client.subAccounts.listSubAccounts()
18
+ */
19
+ listSubAccounts(requestOptions?: SubAccountsClient.RequestOptions): core.HttpResponsePromise<unknown>;
20
+ private __listSubAccounts;
21
+ /**
22
+ * @param {AgentPhone.CreateSubAccountRequest} request
23
+ * @param {SubAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
24
+ *
25
+ * @throws {@link AgentPhone.UnprocessableEntityError}
26
+ *
27
+ * @example
28
+ * await client.subAccounts.createSubAccount({
29
+ * name: "name"
30
+ * })
31
+ */
32
+ createSubAccount(request: AgentPhone.CreateSubAccountRequest, requestOptions?: SubAccountsClient.RequestOptions): core.HttpResponsePromise<unknown>;
33
+ private __createSubAccount;
34
+ /**
35
+ * @param {AgentPhone.DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest} request
36
+ * @param {SubAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
37
+ *
38
+ * @throws {@link AgentPhone.UnprocessableEntityError}
39
+ *
40
+ * @example
41
+ * await client.subAccounts.deleteSubAccount({
42
+ * sub_account_id: "sub_account_id"
43
+ * })
44
+ */
45
+ deleteSubAccount(request: AgentPhone.DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest, requestOptions?: SubAccountsClient.RequestOptions): core.HttpResponsePromise<unknown>;
46
+ private __deleteSubAccount;
47
+ /**
48
+ * @param {AgentPhone.UpdateSubAccountRequest} request
49
+ * @param {SubAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
50
+ *
51
+ * @throws {@link AgentPhone.UnprocessableEntityError}
52
+ *
53
+ * @example
54
+ * await client.subAccounts.updateSubAccount({
55
+ * sub_account_id: "sub_account_id",
56
+ * name: "name"
57
+ * })
58
+ */
59
+ updateSubAccount(request: AgentPhone.UpdateSubAccountRequest, requestOptions?: SubAccountsClient.RequestOptions): core.HttpResponsePromise<unknown>;
60
+ private __updateSubAccount;
61
+ }