1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
//! `phone-system` data models for GoHighLevel API V3 (8 types).
//!
//! Generated from HighLevel's official OpenAPI spec for the
//! **Phone System** module. Every endpoint that uses these types, with its
//! parameters, required scopes and enum values, is documented in the
//! [`phone-system` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/phone-system.md).
//!
//! Enable with `features = ["phone-system"]`.
// @generated by xtask/generate_models.py — do not edit by hand.
// Source: https://github.com/GoHighLevel/highlevel-api-docs
// Doc comments are HighLevel's own field descriptions, reflowed verbatim, so
// they aren't held to rustdoc's markdown conventions.
#![allow(
missing_docs,
clippy::doc_lazy_continuation,
clippy::doc_overindented_list_items
)]
use serde::{Deserialize, Serialize};
/// `ListNumberItemResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct ListNumberItemResponseDto {
/// Phone number in E.164 format
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(
rename = "phoneNumber",
default,
skip_serializing_if = "Option::is_none"
)]
pub phone_number: Option<String>,
/// Human-friendly label for the number
#[serde(
rename = "friendlyName",
default,
skip_serializing_if = "Option::is_none"
)]
pub friendly_name: Option<String>,
/// Provider number identifier
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sid: Option<String>,
/// ISO country code for the number
#[serde(
rename = "countryCode",
default,
skip_serializing_if = "Option::is_none"
)]
pub country_code: Option<String>,
/// Phone number capabilities
#[serde(default, skip_serializing_if = "Option::is_none")]
pub capabilities: Option<NumberCapabilitiesDto>,
/// Phone number type
#[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
/// Whether this is the default outbound number
#[serde(
rename = "isDefaultNumber",
default,
skip_serializing_if = "Option::is_none"
)]
pub is_default_number: Option<bool>,
/// Linked user ID if the number is assigned
#[serde(
rename = "linkedUser",
default,
skip_serializing_if = "Option::is_none"
)]
pub linked_user: Option<String>,
/// Ring-all user IDs linked to the number
#[serde(
rename = "linkedRingAllUsers",
default,
skip_serializing_if = "Vec::is_empty"
)]
pub linked_ring_all_users: Vec<String>,
/// Inbound call service metadata
#[serde(
rename = "inboundCallService",
default,
skip_serializing_if = "Option::is_none"
)]
pub inbound_call_service: Option<serde_json::Value>,
/// Forwarding number in E.164 format
#[serde(
rename = "forwardingNumber",
default,
skip_serializing_if = "Option::is_none"
)]
pub forwarding_number: Option<String>,
/// Whether group conversations are enabled
#[serde(
rename = "isGroupConversationEnabled",
default,
skip_serializing_if = "Option::is_none"
)]
pub is_group_conversation_enabled: Option<bool>,
/// Address SID used for regulated number purchases
#[serde(
rename = "addressSid",
default,
skip_serializing_if = "Option::is_none"
)]
pub address_sid: Option<String>,
/// Bundle SID used for regulated number purchases
#[serde(rename = "bundleSid", default, skip_serializing_if = "Option::is_none")]
pub bundle_sid: Option<String>,
/// Date the number was added
#[serde(rename = "dateAdded", default, skip_serializing_if = "Option::is_none")]
pub date_added: Option<serde_json::Value>,
/// Date the number was last updated
#[serde(
rename = "dateUpdated",
default,
skip_serializing_if = "Option::is_none"
)]
pub date_updated: Option<serde_json::Value>,
/// Legacy created-at field returned by some providers
#[serde(
rename = "dateCreated",
default,
skip_serializing_if = "Option::is_none"
)]
pub date_created: Option<serde_json::Value>,
/// Provider origin for the number
#[serde(default, skip_serializing_if = "Option::is_none")]
pub origin: Option<String>,
}
/// `ListNumbersV3Http200ResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct ListNumbersV3Http200ResponseDto {
/// Outcome indicator from the shared success helper.
/// Allowed values: `success`.
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
/// V3 list payload: numbers, pagination fields, isUnderLc (renamed from isUnderGhl), etc.
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(default, skip_serializing_if = "Option::is_none")]
pub data: Option<ListNumbersV3ResponseDto>,
/// Human-readable success message.
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
/// HTTP status echoed in the response body.
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(
rename = "statusCode",
default,
skip_serializing_if = "Option::is_none"
)]
pub status_code: Option<f64>,
}
/// `ListNumbersV3ResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct ListNumbersV3ResponseDto {
/// Active numbers available for the location
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub numbers: Vec<ListNumberItemResponseDto>,
/// Whether the account is managed under LC. Renamed from isUnderGhl.
#[serde(rename = "isUnderLc", default, skip_serializing_if = "Option::is_none")]
pub is_under_lc: Option<bool>,
/// The page size requested
#[serde(rename = "pageSize", default, skip_serializing_if = "Option::is_none")]
pub page_size: Option<f64>,
/// The zero-based page index requested
#[serde(default, skip_serializing_if = "Option::is_none")]
pub page: Option<f64>,
/// Twilio account status for the location
#[serde(
rename = "accountStatus",
default,
skip_serializing_if = "Option::is_none"
)]
pub account_status: Option<String>,
/// Optional RCS sender IDs returned with the number list
#[serde(
rename = "rcsSenderIds",
default,
skip_serializing_if = "Vec::is_empty"
)]
pub rcs_sender_ids: Vec<RcsSenderIdResponseDto>,
/// Total number of active numbers when available
#[serde(default, skip_serializing_if = "Option::is_none")]
pub total: Option<f64>,
}
/// `NumberCapabilitiesDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct NumberCapabilitiesDto {
/// Whether the number supports voice calls
#[serde(default, skip_serializing_if = "Option::is_none")]
pub voice: Option<bool>,
/// Whether the number supports SMS
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sms: Option<bool>,
/// Whether the number supports MMS
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mms: Option<bool>,
/// Whether the number supports fax
#[serde(default, skip_serializing_if = "Option::is_none")]
pub fax: Option<bool>,
}
/// `PurchaseNumberForLocationV3Http201ResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct PurchaseNumberForLocationV3Http201ResponseDto {
/// Outcome indicator from the shared success helper.
/// Allowed values: `success`.
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
/// V3 purchase payload: purchased number, location, Twilio account id, and underLcAccount.
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(default, skip_serializing_if = "Option::is_none")]
pub data: Option<PurchaseNumberForLocationV3ResponseDto>,
/// Human-readable success message.
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
/// HTTP status echoed in the response body.
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(
rename = "statusCode",
default,
skip_serializing_if = "Option::is_none"
)]
pub status_code: Option<f64>,
}
/// `PurchaseNumberForLocationV3ResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct PurchaseNumberForLocationV3ResponseDto {
/// E.164 phone number that was purchased (from the request body)
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(default, skip_serializing_if = "Option::is_none")]
pub number: Option<String>,
/// Location that owns the Twilio / numbers account
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(
rename = "locationId",
default,
skip_serializing_if = "Option::is_none"
)]
pub location_id: Option<String>,
/// Twilio account document identifier
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
/// Whether the account is managed under LC. Renamed from under_ghl_account in the legacy
/// document.
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(
rename = "underLcAccount",
default,
skip_serializing_if = "Option::is_none"
)]
pub under_lc_account: Option<bool>,
}
/// `PurchasePhoneNumberBodyDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct PurchasePhoneNumberBodyDto {
/// phoneNumber to purchase
/// Required by the API.
#[serde(rename = "phoneNumber")]
pub phone_number: String,
/// addressSid twilio address id
/// Required by the API.
#[serde(rename = "addressSid")]
pub address_sid: String,
/// bundleSid twilio bundle id
/// Required by the API.
#[serde(rename = "bundleSid")]
pub bundle_sid: String,
/// country for which the phone numbers are being requested
/// Required by the API.
#[serde(rename = "countryCode")]
pub country_code: String,
/// type of phone number to be purchased
/// Required by the API.
#[serde(rename = "numberType")]
pub number_type: serde_json::Value,
/// stripe payment intent id
/// Required by the API.
#[serde(rename = "paymentIntentId")]
pub payment_intent_id: String,
/// stripe account id
/// Required by the API.
#[serde(rename = "stripeAccountId")]
pub stripe_account_id: String,
/// stripe registered payment method id
/// Required by the API.
#[serde(rename = "paymentMethodId")]
pub payment_method_id: String,
/// locality of the user in which number is being purchased
/// Required by the API.
pub locality: String,
/// region of the user in which number is being purchased
/// Required by the API.
pub region: String,
/// fingerprintId is request id which is unique for every purchase number request
/// Required by the API.
#[serde(rename = "fingerprintId")]
pub fingerprint_id: String,
/// Skip location-level KYC verification if agency-level compliance has already been
/// verified
/// Required by the API.
#[serde(rename = "skipLocationKYC")]
pub skip_location_kyc: bool,
}
/// `RcsSenderIdResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct RcsSenderIdResponseDto {
/// RCS sender ID
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(default, skip_serializing_if = "Option::is_none")]
pub number: Option<String>,
/// Entry type
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(
rename = "numberType",
default,
skip_serializing_if = "Option::is_none"
)]
pub number_type: Option<String>,
/// Human-friendly label for the sender ID
#[serde(
rename = "friendlyName",
default,
skip_serializing_if = "Option::is_none"
)]
pub friendly_name: Option<String>,
/// RCS sender metadata
#[serde(rename = "rcsMeta", default, skip_serializing_if = "Option::is_none")]
pub rcs_meta: Option<serde_json::Value>,
}