@kite-sa/sdk 0.0.0-stage → 0.5.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.
@@ -0,0 +1,1247 @@
1
+ // This file is auto-generated by openapi-zod-ts — do not edit
2
+ import { getConfig } from "./client-config.js";
3
+ export class ApiError extends Error {
4
+ status;
5
+ body;
6
+ constructor(status, body) {
7
+ super(`API error ${status}`);
8
+ this.status = status;
9
+ this.body = body;
10
+ this.name = "ApiError";
11
+ }
12
+ }
13
+ function _buildSignal(signal, timeout) {
14
+ if (timeout === undefined)
15
+ return signal;
16
+ const _ts = AbortSignal.timeout(timeout);
17
+ if (signal === undefined)
18
+ return _ts;
19
+ if (typeof AbortSignal.any === "function")
20
+ return AbortSignal.any([signal, _ts]);
21
+ const _ctrl = new AbortController();
22
+ const _abort = (s) => () => {
23
+ if (!_ctrl.signal.aborted)
24
+ _ctrl.abort(s.reason);
25
+ };
26
+ signal.addEventListener("abort", _abort(signal), { once: true });
27
+ _ts.addEventListener("abort", _abort(_ts), { once: true });
28
+ return _ctrl.signal;
29
+ }
30
+ async function _request(method, path, opts, config) {
31
+ const { baseUrl, token, headers, onError, signal: _cfgSignal, timeout, onRequest, fetch: _configFetch, } = { ...getConfig(), ...config };
32
+ const resolvedToken = typeof token === "function" ? await token() : token;
33
+ const base = baseUrl ? baseUrl.replace(/\/$/, "") : "";
34
+ const qs = opts.searchParams?.toString() ?? "";
35
+ const url = qs ? `${base}${path}?${qs}` : `${base}${path}`;
36
+ const fetch = _configFetch ?? globalThis.fetch;
37
+ let _url = url;
38
+ let _init = {
39
+ method,
40
+ headers: {
41
+ Accept: "application/json",
42
+ ...(opts.body !== undefined ? { "Content-Type": "application/json" } : {}),
43
+ ...headers,
44
+ ...(resolvedToken ? { Authorization: `Bearer ${resolvedToken}` } : {}),
45
+ ...opts.extraHeaders,
46
+ },
47
+ ...(opts.body !== undefined ? { body: JSON.stringify(opts.body) } : {}),
48
+ };
49
+ if (onRequest) {
50
+ const _or = await onRequest({ url: _url, init: _init });
51
+ if (_or) {
52
+ if (_or.url !== undefined)
53
+ _url = _or.url;
54
+ if (_or.init !== undefined)
55
+ _init = { ..._init, ..._or.init };
56
+ }
57
+ }
58
+ const _rawSignal = opts.signal ?? _cfgSignal;
59
+ const _resolvedSignal = _buildSignal(_rawSignal, timeout);
60
+ if (_resolvedSignal !== undefined)
61
+ _init = { ..._init, signal: _resolvedSignal };
62
+ const res = await fetch(_url, _init);
63
+ if (!res.ok) {
64
+ const err = new ApiError(res.status, await res.json().catch(() => null));
65
+ onError?.(err);
66
+ throw err;
67
+ }
68
+ return res;
69
+ }
70
+ /**
71
+ * @throws {ApiError<400, Error>}
72
+ * @throws {ApiError<401, Error>}
73
+ * @throws {ApiError<403, Error>}
74
+ * @throws {ApiError<429, Error>}
75
+ * @throws {ApiError<500, Error>}
76
+ */
77
+ export async function referenceCities(config) {
78
+ const res = await _request("GET", "/cities", {}, config);
79
+ return res.json();
80
+ }
81
+ /**
82
+ * @throws {ApiError<400, Error>}
83
+ * @throws {ApiError<401, Error>}
84
+ * @throws {ApiError<403, Error>}
85
+ * @throws {ApiError<404, Error>}
86
+ * @throws {ApiError<429, Error>}
87
+ * @throws {ApiError<500, Error>}
88
+ */
89
+ export async function referenceNeighborhoods(city, config) {
90
+ const res = await _request("GET", `/cities/${encodeURIComponent(city)}/neighborhoods`, {}, config);
91
+ return res.json();
92
+ }
93
+ /**
94
+ * @throws {ApiError<400, Error>}
95
+ * @throws {ApiError<401, Error>}
96
+ * @throws {ApiError<403, Error>}
97
+ * @throws {ApiError<404, Error>}
98
+ * @throws {ApiError<429, Error>}
99
+ * @throws {ApiError<500, Error>}
100
+ */
101
+ export async function referenceDirections(city, config) {
102
+ const res = await _request("GET", `/cities/${encodeURIComponent(city)}/directions`, {}, config);
103
+ return res.json();
104
+ }
105
+ /**
106
+ * @throws {ApiError<400, Error>}
107
+ * @throws {ApiError<401, Error>}
108
+ * @throws {ApiError<403, Error>}
109
+ * @throws {ApiError<429, Error>}
110
+ * @throws {ApiError<500, Error>}
111
+ */
112
+ export async function referenceEnums(config) {
113
+ const res = await _request("GET", "/enums", {}, config);
114
+ return res.json();
115
+ }
116
+ /**
117
+ * @throws {ApiError<400, Error>}
118
+ * @throws {ApiError<401, Error>}
119
+ * @throws {ApiError<403, Error>}
120
+ * @throws {ApiError<429, Error>}
121
+ * @throws {ApiError<500, Error>}
122
+ */
123
+ export async function referenceLimits(config) {
124
+ const res = await _request("GET", "/limits", {}, config);
125
+ return res.json();
126
+ }
127
+ /**
128
+ * @throws {ApiError<400, Error>}
129
+ * @throws {ApiError<401, Error>}
130
+ * @throws {ApiError<403, Error>}
131
+ * @throws {ApiError<429, Error>}
132
+ * @throws {ApiError<500, Error>}
133
+ */
134
+ export async function listingsSearch(params, config) {
135
+ const searchParams = new URLSearchParams();
136
+ if (params?.city != null)
137
+ searchParams.set("city", String(params.city));
138
+ if (params?.listingType != null)
139
+ searchParams.set("listing_type", String(params.listingType));
140
+ if (params?.listingCategory != null)
141
+ searchParams.set("listing_category", String(params.listingCategory));
142
+ if (params?.propertyType != null) {
143
+ for (const v of params.propertyType)
144
+ searchParams.append("property_type", String(v));
145
+ }
146
+ if (params?.neighborhoodId != null) {
147
+ for (const v of params.neighborhoodId)
148
+ searchParams.append("neighborhood_id", String(v));
149
+ }
150
+ if (params?.beds != null)
151
+ searchParams.set("beds", String(params.beds));
152
+ if (params?.bedsMin != null)
153
+ searchParams.set("beds_min", String(params.bedsMin));
154
+ if (params?.bedsMax != null)
155
+ searchParams.set("beds_max", String(params.bedsMax));
156
+ if (params?.bathroomsMin != null)
157
+ searchParams.set("bathrooms_min", String(params.bathroomsMin));
158
+ if (params?.priceMin != null)
159
+ searchParams.set("price_min", String(params.priceMin));
160
+ if (params?.priceMax != null)
161
+ searchParams.set("price_max", String(params.priceMax));
162
+ if (params?.areaMin != null)
163
+ searchParams.set("area_min", String(params.areaMin));
164
+ if (params?.areaMax != null)
165
+ searchParams.set("area_max", String(params.areaMax));
166
+ if (params?.furnished != null)
167
+ searchParams.set("furnished", String(params.furnished));
168
+ if (params?.source != null) {
169
+ for (const v of params.source)
170
+ searchParams.append("source", String(v));
171
+ }
172
+ if (params?.bbox != null)
173
+ searchParams.set("bbox", String(params.bbox));
174
+ if (params?.updatedSince != null)
175
+ searchParams.set("updated_since", String(params.updatedSince));
176
+ if (params?.bathrooms != null)
177
+ searchParams.set("bathrooms", String(params.bathrooms));
178
+ if (params?.bathroomsMax != null)
179
+ searchParams.set("bathrooms_max", String(params.bathroomsMax));
180
+ if (params?.livingsMin != null)
181
+ searchParams.set("livings_min", String(params.livingsMin));
182
+ if (params?.neighborhoodIdExclude != null) {
183
+ for (const v of params.neighborhoodIdExclude)
184
+ searchParams.append("neighborhood_id_exclude", String(v));
185
+ }
186
+ if (params?.q != null)
187
+ searchParams.set("q", String(params.q));
188
+ if (params?.amenities != null) {
189
+ for (const v of params.amenities)
190
+ searchParams.append("amenities", String(v));
191
+ }
192
+ if (params?.amenitiesExclude != null) {
193
+ for (const v of params.amenitiesExclude)
194
+ searchParams.append("amenities_exclude", String(v));
195
+ }
196
+ if (params?.floor != null)
197
+ searchParams.set("floor", String(params.floor));
198
+ if (params?.sourceExclude != null) {
199
+ for (const v of params.sourceExclude)
200
+ searchParams.append("source_exclude", String(v));
201
+ }
202
+ if (params?.maxAge != null)
203
+ searchParams.set("max_age", String(params.maxAge));
204
+ if (params?.verified != null)
205
+ searchParams.set("verified", String(params.verified));
206
+ if (params?.advertiserType != null)
207
+ searchParams.set("advertiser_type", String(params.advertiserType));
208
+ if (params?.compound != null)
209
+ searchParams.set("compound", String(params.compound));
210
+ if (params?.inCompound != null)
211
+ searchParams.set("in_compound", String(params.inCompound));
212
+ if (params?.rentFrequency != null)
213
+ searchParams.set("rent_frequency", String(params.rentFrequency));
214
+ if (params?.daysOnMarketMin != null)
215
+ searchParams.set("days_on_market_min", String(params.daysOnMarketMin));
216
+ if (params?.daysOnMarketMax != null)
217
+ searchParams.set("days_on_market_max", String(params.daysOnMarketMax));
218
+ if (params?.sort != null)
219
+ searchParams.set("sort", String(params.sort));
220
+ if (params?.limit != null)
221
+ searchParams.set("limit", String(params.limit));
222
+ if (params?.cursor != null)
223
+ searchParams.set("cursor", String(params.cursor));
224
+ const res = await _request("GET", "/listings", { searchParams }, config);
225
+ return res.json();
226
+ }
227
+ /**
228
+ * @throws {ApiError<400, Error>}
229
+ * @throws {ApiError<401, Error>}
230
+ * @throws {ApiError<403, Error>}
231
+ * @throws {ApiError<429, Error>}
232
+ * @throws {ApiError<500, Error>}
233
+ */
234
+ export async function listingsCount(params, config) {
235
+ const searchParams = new URLSearchParams();
236
+ if (params?.city != null)
237
+ searchParams.set("city", String(params.city));
238
+ if (params?.listingType != null)
239
+ searchParams.set("listing_type", String(params.listingType));
240
+ if (params?.listingCategory != null)
241
+ searchParams.set("listing_category", String(params.listingCategory));
242
+ if (params?.propertyType != null) {
243
+ for (const v of params.propertyType)
244
+ searchParams.append("property_type", String(v));
245
+ }
246
+ if (params?.neighborhoodId != null) {
247
+ for (const v of params.neighborhoodId)
248
+ searchParams.append("neighborhood_id", String(v));
249
+ }
250
+ if (params?.beds != null)
251
+ searchParams.set("beds", String(params.beds));
252
+ if (params?.bedsMin != null)
253
+ searchParams.set("beds_min", String(params.bedsMin));
254
+ if (params?.bedsMax != null)
255
+ searchParams.set("beds_max", String(params.bedsMax));
256
+ if (params?.bathroomsMin != null)
257
+ searchParams.set("bathrooms_min", String(params.bathroomsMin));
258
+ if (params?.priceMin != null)
259
+ searchParams.set("price_min", String(params.priceMin));
260
+ if (params?.priceMax != null)
261
+ searchParams.set("price_max", String(params.priceMax));
262
+ if (params?.areaMin != null)
263
+ searchParams.set("area_min", String(params.areaMin));
264
+ if (params?.areaMax != null)
265
+ searchParams.set("area_max", String(params.areaMax));
266
+ if (params?.furnished != null)
267
+ searchParams.set("furnished", String(params.furnished));
268
+ if (params?.source != null) {
269
+ for (const v of params.source)
270
+ searchParams.append("source", String(v));
271
+ }
272
+ if (params?.bbox != null)
273
+ searchParams.set("bbox", String(params.bbox));
274
+ if (params?.updatedSince != null)
275
+ searchParams.set("updated_since", String(params.updatedSince));
276
+ if (params?.bathrooms != null)
277
+ searchParams.set("bathrooms", String(params.bathrooms));
278
+ if (params?.bathroomsMax != null)
279
+ searchParams.set("bathrooms_max", String(params.bathroomsMax));
280
+ if (params?.livingsMin != null)
281
+ searchParams.set("livings_min", String(params.livingsMin));
282
+ if (params?.neighborhoodIdExclude != null) {
283
+ for (const v of params.neighborhoodIdExclude)
284
+ searchParams.append("neighborhood_id_exclude", String(v));
285
+ }
286
+ if (params?.q != null)
287
+ searchParams.set("q", String(params.q));
288
+ if (params?.amenities != null) {
289
+ for (const v of params.amenities)
290
+ searchParams.append("amenities", String(v));
291
+ }
292
+ if (params?.amenitiesExclude != null) {
293
+ for (const v of params.amenitiesExclude)
294
+ searchParams.append("amenities_exclude", String(v));
295
+ }
296
+ if (params?.floor != null)
297
+ searchParams.set("floor", String(params.floor));
298
+ if (params?.sourceExclude != null) {
299
+ for (const v of params.sourceExclude)
300
+ searchParams.append("source_exclude", String(v));
301
+ }
302
+ if (params?.maxAge != null)
303
+ searchParams.set("max_age", String(params.maxAge));
304
+ if (params?.verified != null)
305
+ searchParams.set("verified", String(params.verified));
306
+ if (params?.advertiserType != null)
307
+ searchParams.set("advertiser_type", String(params.advertiserType));
308
+ if (params?.compound != null)
309
+ searchParams.set("compound", String(params.compound));
310
+ if (params?.inCompound != null)
311
+ searchParams.set("in_compound", String(params.inCompound));
312
+ if (params?.rentFrequency != null)
313
+ searchParams.set("rent_frequency", String(params.rentFrequency));
314
+ if (params?.daysOnMarketMin != null)
315
+ searchParams.set("days_on_market_min", String(params.daysOnMarketMin));
316
+ if (params?.daysOnMarketMax != null)
317
+ searchParams.set("days_on_market_max", String(params.daysOnMarketMax));
318
+ const res = await _request("GET", "/listings/count", { searchParams }, config);
319
+ return res.json();
320
+ }
321
+ /**
322
+ * @throws {ApiError<400, Error>}
323
+ * @throws {ApiError<401, Error>}
324
+ * @throws {ApiError<403, Error>}
325
+ * @throws {ApiError<429, Error>}
326
+ * @throws {ApiError<500, Error>}
327
+ */
328
+ export async function listingsBatch(params, config) {
329
+ const searchParams = new URLSearchParams();
330
+ if (params?.ids != null) {
331
+ for (const v of params.ids)
332
+ searchParams.append("ids", String(v));
333
+ }
334
+ const res = await _request("GET", "/listings/batch", { searchParams }, config);
335
+ return res.json();
336
+ }
337
+ /**
338
+ * @throws {ApiError<400, Error>}
339
+ * @throws {ApiError<401, Error>}
340
+ * @throws {ApiError<403, Error>}
341
+ * @throws {ApiError<404, Error>}
342
+ * @throws {ApiError<429, Error>}
343
+ * @throws {ApiError<500, Error>}
344
+ */
345
+ export async function listingsGet(id, config) {
346
+ const res = await _request("GET", `/listings/${encodeURIComponent(id)}`, {}, config);
347
+ return res.json();
348
+ }
349
+ /**
350
+ * @throws {ApiError<400, Error>}
351
+ * @throws {ApiError<401, Error>}
352
+ * @throws {ApiError<403, Error>}
353
+ * @throws {ApiError<404, Error>}
354
+ * @throws {ApiError<429, Error>}
355
+ * @throws {ApiError<500, Error>}
356
+ */
357
+ export async function listingsPriceHistory(id, config) {
358
+ const res = await _request("GET", `/listings/${encodeURIComponent(id)}/price-history`, {}, config);
359
+ return res.json();
360
+ }
361
+ /**
362
+ * @throws {ApiError<400, Error>}
363
+ * @throws {ApiError<401, Error>}
364
+ * @throws {ApiError<403, Error>}
365
+ * @throws {ApiError<429, Error>}
366
+ * @throws {ApiError<500, Error>}
367
+ */
368
+ export async function marketSummary(params, config) {
369
+ const searchParams = new URLSearchParams();
370
+ if (params?.city != null)
371
+ searchParams.set("city", String(params.city));
372
+ if (params?.listingType != null)
373
+ searchParams.set("listing_type", String(params.listingType));
374
+ if (params?.listingCategory != null)
375
+ searchParams.set("listing_category", String(params.listingCategory));
376
+ if (params?.propertyType != null)
377
+ searchParams.set("property_type", String(params.propertyType));
378
+ if (params?.beds != null)
379
+ searchParams.set("beds", String(params.beds));
380
+ if (params?.neighborhoodId != null) {
381
+ for (const v of params.neighborhoodId)
382
+ searchParams.append("neighborhood_id", String(v));
383
+ }
384
+ const res = await _request("GET", "/market/summary", { searchParams }, config);
385
+ return res.json();
386
+ }
387
+ /**
388
+ * @throws {ApiError<400, Error>}
389
+ * @throws {ApiError<401, Error>}
390
+ * @throws {ApiError<403, Error>}
391
+ * @throws {ApiError<429, Error>}
392
+ * @throws {ApiError<500, Error>}
393
+ */
394
+ export async function marketPriceDistribution(params, config) {
395
+ const searchParams = new URLSearchParams();
396
+ if (params?.city != null)
397
+ searchParams.set("city", String(params.city));
398
+ if (params?.listingType != null)
399
+ searchParams.set("listing_type", String(params.listingType));
400
+ if (params?.listingCategory != null)
401
+ searchParams.set("listing_category", String(params.listingCategory));
402
+ if (params?.propertyType != null)
403
+ searchParams.set("property_type", String(params.propertyType));
404
+ if (params?.beds != null)
405
+ searchParams.set("beds", String(params.beds));
406
+ if (params?.neighborhoodId != null) {
407
+ for (const v of params.neighborhoodId)
408
+ searchParams.append("neighborhood_id", String(v));
409
+ }
410
+ if (params?.bucketCount != null)
411
+ searchParams.set("bucket_count", String(params.bucketCount));
412
+ const res = await _request("GET", "/market/price-distribution", { searchParams }, config);
413
+ return res.json();
414
+ }
415
+ /**
416
+ * @throws {ApiError<400, Error>}
417
+ * @throws {ApiError<401, Error>}
418
+ * @throws {ApiError<403, Error>}
419
+ * @throws {ApiError<429, Error>}
420
+ * @throws {ApiError<500, Error>}
421
+ */
422
+ export async function marketAreaDistribution(params, config) {
423
+ const searchParams = new URLSearchParams();
424
+ if (params?.city != null)
425
+ searchParams.set("city", String(params.city));
426
+ if (params?.listingType != null)
427
+ searchParams.set("listing_type", String(params.listingType));
428
+ if (params?.listingCategory != null)
429
+ searchParams.set("listing_category", String(params.listingCategory));
430
+ if (params?.propertyType != null)
431
+ searchParams.set("property_type", String(params.propertyType));
432
+ if (params?.beds != null)
433
+ searchParams.set("beds", String(params.beds));
434
+ if (params?.neighborhoodId != null) {
435
+ for (const v of params.neighborhoodId)
436
+ searchParams.append("neighborhood_id", String(v));
437
+ }
438
+ if (params?.bucketCount != null)
439
+ searchParams.set("bucket_count", String(params.bucketCount));
440
+ const res = await _request("GET", "/market/area-distribution", { searchParams }, config);
441
+ return res.json();
442
+ }
443
+ /**
444
+ * @throws {ApiError<400, Error>}
445
+ * @throws {ApiError<401, Error>}
446
+ * @throws {ApiError<403, Error>}
447
+ * @throws {ApiError<429, Error>}
448
+ * @throws {ApiError<500, Error>}
449
+ */
450
+ export async function marketSupply(params, config) {
451
+ const searchParams = new URLSearchParams();
452
+ if (params?.city != null)
453
+ searchParams.set("city", String(params.city));
454
+ if (params?.listingType != null)
455
+ searchParams.set("listing_type", String(params.listingType));
456
+ if (params?.listingCategory != null)
457
+ searchParams.set("listing_category", String(params.listingCategory));
458
+ if (params?.propertyType != null)
459
+ searchParams.set("property_type", String(params.propertyType));
460
+ if (params?.beds != null)
461
+ searchParams.set("beds", String(params.beds));
462
+ if (params?.neighborhoodId != null) {
463
+ for (const v of params.neighborhoodId)
464
+ searchParams.append("neighborhood_id", String(v));
465
+ }
466
+ const res = await _request("GET", "/market/supply", { searchParams }, config);
467
+ return res.json();
468
+ }
469
+ /**
470
+ * @throws {ApiError<400, Error>}
471
+ * @throws {ApiError<401, Error>}
472
+ * @throws {ApiError<403, Error>}
473
+ * @throws {ApiError<429, Error>}
474
+ * @throws {ApiError<500, Error>}
475
+ */
476
+ export async function marketVacancy(params, config) {
477
+ const searchParams = new URLSearchParams();
478
+ if (params?.city != null)
479
+ searchParams.set("city", String(params.city));
480
+ if (params?.listingType != null)
481
+ searchParams.set("listing_type", String(params.listingType));
482
+ if (params?.listingCategory != null)
483
+ searchParams.set("listing_category", String(params.listingCategory));
484
+ if (params?.propertyType != null)
485
+ searchParams.set("property_type", String(params.propertyType));
486
+ if (params?.beds != null)
487
+ searchParams.set("beds", String(params.beds));
488
+ if (params?.neighborhoodId != null) {
489
+ for (const v of params.neighborhoodId)
490
+ searchParams.append("neighborhood_id", String(v));
491
+ }
492
+ const res = await _request("GET", "/market/vacancy", { searchParams }, config);
493
+ return res.json();
494
+ }
495
+ /**
496
+ * @throws {ApiError<400, Error>}
497
+ * @throws {ApiError<401, Error>}
498
+ * @throws {ApiError<403, Error>}
499
+ * @throws {ApiError<429, Error>}
500
+ * @throws {ApiError<500, Error>}
501
+ */
502
+ export async function marketNeighborhoods(params, config) {
503
+ const searchParams = new URLSearchParams();
504
+ if (params?.city != null)
505
+ searchParams.set("city", String(params.city));
506
+ if (params?.listingType != null)
507
+ searchParams.set("listing_type", String(params.listingType));
508
+ if (params?.listingCategory != null)
509
+ searchParams.set("listing_category", String(params.listingCategory));
510
+ if (params?.propertyType != null)
511
+ searchParams.set("property_type", String(params.propertyType));
512
+ if (params?.beds != null)
513
+ searchParams.set("beds", String(params.beds));
514
+ if (params?.minSampleSize != null)
515
+ searchParams.set("min_sample_size", String(params.minSampleSize));
516
+ const res = await _request("GET", "/market/neighborhoods", { searchParams }, config);
517
+ return res.json();
518
+ }
519
+ /**
520
+ * @throws {ApiError<400, Error>}
521
+ * @throws {ApiError<401, Error>}
522
+ * @throws {ApiError<403, Error>}
523
+ * @throws {ApiError<429, Error>}
524
+ * @throws {ApiError<500, Error>}
525
+ */
526
+ export async function officialRegisteredRents(params, config) {
527
+ const searchParams = new URLSearchParams();
528
+ if (params?.city != null)
529
+ searchParams.set("city", String(params.city));
530
+ if (params?.neighborhoodId != null) {
531
+ for (const v of params.neighborhoodId)
532
+ searchParams.append("neighborhood_id", String(v));
533
+ }
534
+ if (params?.propertyType != null) {
535
+ for (const v of params.propertyType)
536
+ searchParams.append("property_type", String(v));
537
+ }
538
+ if (params?.period != null)
539
+ searchParams.set("period", String(params.period));
540
+ if (params?.minSampleSize != null)
541
+ searchParams.set("min_sample_size", String(params.minSampleSize));
542
+ const res = await _request("GET", "/market/registered-rents", { searchParams }, config);
543
+ return res.json();
544
+ }
545
+ /**
546
+ * @throws {ApiError<400, Error>}
547
+ * @throws {ApiError<401, Error>}
548
+ * @throws {ApiError<403, Error>}
549
+ * @throws {ApiError<429, Error>}
550
+ * @throws {ApiError<500, Error>}
551
+ */
552
+ export async function officialMarketIndex(params, config) {
553
+ const searchParams = new URLSearchParams();
554
+ if (params?.series != null) {
555
+ for (const v of params.series)
556
+ searchParams.append("series", String(v));
557
+ }
558
+ if (params?.city != null)
559
+ searchParams.set("city", String(params.city));
560
+ if (params?.release != null)
561
+ searchParams.set("release", String(params.release));
562
+ const res = await _request("GET", "/market/property-index", { searchParams }, config);
563
+ return res.json();
564
+ }
565
+ /**
566
+ * @throws {ApiError<400, Error>}
567
+ * @throws {ApiError<401, Error>}
568
+ * @throws {ApiError<403, Error>}
569
+ * @throws {ApiError<404, Error>}
570
+ * @throws {ApiError<429, Error>}
571
+ * @throws {ApiError<500, Error>}
572
+ */
573
+ export async function analyticsListingComparables(id, params, config) {
574
+ const searchParams = new URLSearchParams();
575
+ if (params?.limit != null)
576
+ searchParams.set("limit", String(params.limit));
577
+ const res = await _request("GET", `/listings/${encodeURIComponent(id)}/comparables`, { searchParams }, config);
578
+ return res.json();
579
+ }
580
+ /**
581
+ * @throws {ApiError<400, Error>}
582
+ * @throws {ApiError<401, Error>}
583
+ * @throws {ApiError<403, Error>}
584
+ * @throws {ApiError<404, Error>}
585
+ * @throws {ApiError<429, Error>}
586
+ * @throws {ApiError<500, Error>}
587
+ */
588
+ export async function analyticsListingMarketPosition(id, config) {
589
+ const res = await _request("GET", `/listings/${encodeURIComponent(id)}/market-position`, {}, config);
590
+ return res.json();
591
+ }
592
+ /**
593
+ * @throws {ApiError<400, Error>}
594
+ * @throws {ApiError<401, Error>}
595
+ * @throws {ApiError<403, Error>}
596
+ * @throws {ApiError<404, Error>}
597
+ * @throws {ApiError<429, Error>}
598
+ * @throws {ApiError<500, Error>}
599
+ */
600
+ export async function analyticsListingPriceBand(id, config) {
601
+ const res = await _request("GET", `/listings/${encodeURIComponent(id)}/price-band`, {}, config);
602
+ return res.json();
603
+ }
604
+ /**
605
+ * @throws {ApiError<400, Error>}
606
+ * @throws {ApiError<401, Error>}
607
+ * @throws {ApiError<403, Error>}
608
+ * @throws {ApiError<429, Error>}
609
+ * @throws {ApiError<500, Error>}
610
+ */
611
+ export async function analyticsDeals(params, config) {
612
+ const searchParams = new URLSearchParams();
613
+ if (params?.city != null)
614
+ searchParams.set("city", String(params.city));
615
+ if (params?.listingType != null)
616
+ searchParams.set("listing_type", String(params.listingType));
617
+ if (params?.propertyType != null)
618
+ searchParams.set("property_type", String(params.propertyType));
619
+ if (params?.beds != null)
620
+ searchParams.set("beds", String(params.beds));
621
+ if (params?.neighborhoodId != null) {
622
+ for (const v of params.neighborhoodId)
623
+ searchParams.append("neighborhood_id", String(v));
624
+ }
625
+ if (params?.minDiscountPct != null)
626
+ searchParams.set("min_discount_pct", String(params.minDiscountPct));
627
+ if (params?.maxDiscountPct != null)
628
+ searchParams.set("max_discount_pct", String(params.maxDiscountPct));
629
+ if (params?.limit != null)
630
+ searchParams.set("limit", String(params.limit));
631
+ if (params?.cursor != null)
632
+ searchParams.set("cursor", String(params.cursor));
633
+ const res = await _request("GET", "/market/deals", { searchParams }, config);
634
+ return res.json();
635
+ }
636
+ /**
637
+ * @throws {ApiError<400, Error>}
638
+ * @throws {ApiError<401, Error>}
639
+ * @throws {ApiError<403, Error>}
640
+ * @throws {ApiError<429, Error>}
641
+ * @throws {ApiError<500, Error>}
642
+ */
643
+ export async function analyticsRentalYield(params, config) {
644
+ const searchParams = new URLSearchParams();
645
+ if (params?.city != null)
646
+ searchParams.set("city", String(params.city));
647
+ if (params?.propertyType != null)
648
+ searchParams.set("property_type", String(params.propertyType));
649
+ if (params?.beds != null)
650
+ searchParams.set("beds", String(params.beds));
651
+ if (params?.neighborhoodId != null) {
652
+ for (const v of params.neighborhoodId)
653
+ searchParams.append("neighborhood_id", String(v));
654
+ }
655
+ if (params?.minSampleSize != null)
656
+ searchParams.set("min_sample_size", String(params.minSampleSize));
657
+ const res = await _request("GET", "/market/rental-yield", { searchParams }, config);
658
+ return res.json();
659
+ }
660
+ /**
661
+ * @throws {ApiError<400, Error>}
662
+ * @throws {ApiError<401, Error>}
663
+ * @throws {ApiError<403, Error>}
664
+ * @throws {ApiError<429, Error>}
665
+ * @throws {ApiError<500, Error>}
666
+ */
667
+ export async function analyticsTrends(params, config) {
668
+ const searchParams = new URLSearchParams();
669
+ if (params?.city != null)
670
+ searchParams.set("city", String(params.city));
671
+ if (params?.listingType != null)
672
+ searchParams.set("listing_type", String(params.listingType));
673
+ if (params?.listingCategory != null)
674
+ searchParams.set("listing_category", String(params.listingCategory));
675
+ if (params?.propertyType != null)
676
+ searchParams.set("property_type", String(params.propertyType));
677
+ if (params?.beds != null)
678
+ searchParams.set("beds", String(params.beds));
679
+ if (params?.neighborhoodId != null) {
680
+ for (const v of params.neighborhoodId)
681
+ searchParams.append("neighborhood_id", String(v));
682
+ }
683
+ if (params?.months != null)
684
+ searchParams.set("months", String(params.months));
685
+ if (params?.basis != null)
686
+ searchParams.set("basis", String(params.basis));
687
+ const res = await _request("GET", "/market/trends", { searchParams }, config);
688
+ return res.json();
689
+ }
690
+ /**
691
+ * @throws {ApiError<400, Error>}
692
+ * @throws {ApiError<401, Error>}
693
+ * @throws {ApiError<403, Error>}
694
+ * @throws {ApiError<429, Error>}
695
+ * @throws {ApiError<500, Error>}
696
+ */
697
+ export async function analyticsNeighborhoodsCompare(params, config) {
698
+ const searchParams = new URLSearchParams();
699
+ if (params?.city != null)
700
+ searchParams.set("city", String(params.city));
701
+ if (params?.listingType != null)
702
+ searchParams.set("listing_type", String(params.listingType));
703
+ if (params?.listingCategory != null)
704
+ searchParams.set("listing_category", String(params.listingCategory));
705
+ if (params?.propertyType != null)
706
+ searchParams.set("property_type", String(params.propertyType));
707
+ if (params?.beds != null)
708
+ searchParams.set("beds", String(params.beds));
709
+ if (params?.neighborhoodId != null) {
710
+ for (const v of params.neighborhoodId)
711
+ searchParams.append("neighborhood_id", String(v));
712
+ }
713
+ const res = await _request("GET", "/market/neighborhoods/compare", { searchParams }, config);
714
+ return res.json();
715
+ }
716
+ /**
717
+ * @throws {ApiError<400, Error>}
718
+ * @throws {ApiError<401, Error>}
719
+ * @throws {ApiError<403, Error>}
720
+ * @throws {ApiError<429, Error>}
721
+ * @throws {ApiError<500, Error>}
722
+ */
723
+ export async function transactionsSearch(params, config) {
724
+ const searchParams = new URLSearchParams();
725
+ if (params?.city != null)
726
+ searchParams.set("city", String(params.city));
727
+ if (params?.neighborhoodId != null) {
728
+ for (const v of params.neighborhoodId)
729
+ searchParams.append("neighborhood_id", String(v));
730
+ }
731
+ if (params?.landUse != null) {
732
+ for (const v of params.landUse)
733
+ searchParams.append("land_use", String(v));
734
+ }
735
+ if (params?.monthFrom != null)
736
+ searchParams.set("month_from", String(params.monthFrom));
737
+ if (params?.monthTo != null)
738
+ searchParams.set("month_to", String(params.monthTo));
739
+ if (params?.priceMin != null)
740
+ searchParams.set("price_min", String(params.priceMin));
741
+ if (params?.priceMax != null)
742
+ searchParams.set("price_max", String(params.priceMax));
743
+ if (params?.areaMin != null)
744
+ searchParams.set("area_min", String(params.areaMin));
745
+ if (params?.areaMax != null)
746
+ searchParams.set("area_max", String(params.areaMax));
747
+ if (params?.pricePerSqmMin != null)
748
+ searchParams.set("price_per_sqm_min", String(params.pricePerSqmMin));
749
+ if (params?.pricePerSqmMax != null)
750
+ searchParams.set("price_per_sqm_max", String(params.pricePerSqmMax));
751
+ if (params?.sort != null)
752
+ searchParams.set("sort", String(params.sort));
753
+ if (params?.limit != null)
754
+ searchParams.set("limit", String(params.limit));
755
+ if (params?.cursor != null)
756
+ searchParams.set("cursor", String(params.cursor));
757
+ const res = await _request("GET", "/transactions", { searchParams }, config);
758
+ return res.json();
759
+ }
760
+ /**
761
+ * @throws {ApiError<400, Error>}
762
+ * @throws {ApiError<401, Error>}
763
+ * @throws {ApiError<403, Error>}
764
+ * @throws {ApiError<429, Error>}
765
+ * @throws {ApiError<500, Error>}
766
+ */
767
+ export async function marketTransactions(params, config) {
768
+ const searchParams = new URLSearchParams();
769
+ if (params?.city != null)
770
+ searchParams.set("city", String(params.city));
771
+ if (params?.neighborhoodId != null) {
772
+ for (const v of params.neighborhoodId)
773
+ searchParams.append("neighborhood_id", String(v));
774
+ }
775
+ if (params?.groupBy != null)
776
+ searchParams.set("group_by", String(params.groupBy));
777
+ if (params?.landUse != null) {
778
+ for (const v of params.landUse)
779
+ searchParams.append("land_use", String(v));
780
+ }
781
+ if (params?.quarterFrom != null)
782
+ searchParams.set("quarter_from", String(params.quarterFrom));
783
+ if (params?.quarterTo != null)
784
+ searchParams.set("quarter_to", String(params.quarterTo));
785
+ if (params?.minSampleSize != null)
786
+ searchParams.set("min_sample_size", String(params.minSampleSize));
787
+ const res = await _request("GET", "/market/transactions", { searchParams }, config);
788
+ return res.json();
789
+ }
790
+ /**
791
+ * @throws {ApiError<400, Error>}
792
+ * @throws {ApiError<401, Error>}
793
+ * @throws {ApiError<403, Error>}
794
+ * @throws {ApiError<429, Error>}
795
+ * @throws {ApiError<500, Error>}
796
+ */
797
+ export async function marketLandPrices(params, config) {
798
+ const searchParams = new URLSearchParams();
799
+ if (params?.city != null)
800
+ searchParams.set("city", String(params.city));
801
+ if (params?.neighborhoodId != null) {
802
+ for (const v of params.neighborhoodId)
803
+ searchParams.append("neighborhood_id", String(v));
804
+ }
805
+ if (params?.landUse != null)
806
+ searchParams.set("land_use", String(params.landUse));
807
+ if (params?.quarterFrom != null)
808
+ searchParams.set("quarter_from", String(params.quarterFrom));
809
+ if (params?.quarterTo != null)
810
+ searchParams.set("quarter_to", String(params.quarterTo));
811
+ if (params?.minSampleSize != null)
812
+ searchParams.set("min_sample_size", String(params.minSampleSize));
813
+ const res = await _request("GET", "/market/land-prices", { searchParams }, config);
814
+ return res.json();
815
+ }
816
+ /**
817
+ * @throws {ApiError<400, Error>}
818
+ * @throws {ApiError<401, Error>}
819
+ * @throws {ApiError<403, Error>}
820
+ * @throws {ApiError<429, Error>}
821
+ * @throws {ApiError<500, Error>}
822
+ */
823
+ export async function projectsSearch(params, config) {
824
+ const searchParams = new URLSearchParams();
825
+ if (params?.city != null)
826
+ searchParams.set("city", String(params.city));
827
+ if (params?.neighborhoodId != null) {
828
+ for (const v of params.neighborhoodId)
829
+ searchParams.append("neighborhood_id", String(v));
830
+ }
831
+ if (params?.developer != null)
832
+ searchParams.set("developer", String(params.developer));
833
+ if (params?.status != null) {
834
+ for (const v of params.status)
835
+ searchParams.append("status", String(v));
836
+ }
837
+ if (params?.projectType != null)
838
+ searchParams.set("project_type", String(params.projectType));
839
+ if (params?.listingCategory != null)
840
+ searchParams.set("listing_category", String(params.listingCategory));
841
+ if (params?.features != null) {
842
+ for (const v of params.features)
843
+ searchParams.append("features", String(v));
844
+ }
845
+ if (params?.banks != null) {
846
+ for (const v of params.banks)
847
+ searchParams.append("banks", String(v));
848
+ }
849
+ if (params?.q != null)
850
+ searchParams.set("q", String(params.q));
851
+ if (params?.priceMin != null)
852
+ searchParams.set("price_min", String(params.priceMin));
853
+ if (params?.priceMax != null)
854
+ searchParams.set("price_max", String(params.priceMax));
855
+ if (params?.sort != null)
856
+ searchParams.set("sort", String(params.sort));
857
+ if (params?.limit != null)
858
+ searchParams.set("limit", String(params.limit));
859
+ if (params?.cursor != null)
860
+ searchParams.set("cursor", String(params.cursor));
861
+ const res = await _request("GET", "/projects", { searchParams }, config);
862
+ return res.json();
863
+ }
864
+ /**
865
+ * @throws {ApiError<400, Error>}
866
+ * @throws {ApiError<401, Error>}
867
+ * @throws {ApiError<403, Error>}
868
+ * @throws {ApiError<404, Error>}
869
+ * @throws {ApiError<429, Error>}
870
+ * @throws {ApiError<500, Error>}
871
+ */
872
+ export async function projectsGet(id, config) {
873
+ const res = await _request("GET", `/projects/${encodeURIComponent(id)}`, {}, config);
874
+ return res.json();
875
+ }
876
+ /**
877
+ * @throws {ApiError<400, Error>}
878
+ * @throws {ApiError<401, Error>}
879
+ * @throws {ApiError<403, Error>}
880
+ * @throws {ApiError<404, Error>}
881
+ * @throws {ApiError<429, Error>}
882
+ * @throws {ApiError<500, Error>}
883
+ */
884
+ export async function projectsUnits(id, params, config) {
885
+ const searchParams = new URLSearchParams();
886
+ if (params?.listingType != null)
887
+ searchParams.set("listing_type", String(params.listingType));
888
+ if (params?.propertyType != null) {
889
+ for (const v of params.propertyType)
890
+ searchParams.append("property_type", String(v));
891
+ }
892
+ if (params?.bedrooms != null)
893
+ searchParams.set("bedrooms", String(params.bedrooms));
894
+ if (params?.bedroomsMin != null)
895
+ searchParams.set("bedrooms_min", String(params.bedroomsMin));
896
+ if (params?.bedroomsMax != null)
897
+ searchParams.set("bedrooms_max", String(params.bedroomsMax));
898
+ if (params?.bathrooms != null)
899
+ searchParams.set("bathrooms", String(params.bathrooms));
900
+ if (params?.bathroomsMin != null)
901
+ searchParams.set("bathrooms_min", String(params.bathroomsMin));
902
+ if (params?.priceMin != null)
903
+ searchParams.set("price_min", String(params.priceMin));
904
+ if (params?.priceMax != null)
905
+ searchParams.set("price_max", String(params.priceMax));
906
+ if (params?.areaMin != null)
907
+ searchParams.set("area_min", String(params.areaMin));
908
+ if (params?.areaMax != null)
909
+ searchParams.set("area_max", String(params.areaMax));
910
+ if (params?.sort != null)
911
+ searchParams.set("sort", String(params.sort));
912
+ if (params?.limit != null)
913
+ searchParams.set("limit", String(params.limit));
914
+ if (params?.cursor != null)
915
+ searchParams.set("cursor", String(params.cursor));
916
+ const res = await _request("GET", `/projects/${encodeURIComponent(id)}/units`, { searchParams }, config);
917
+ return res.json();
918
+ }
919
+ /**
920
+ * @throws {ApiError<400, Error>}
921
+ * @throws {ApiError<401, Error>}
922
+ * @throws {ApiError<403, Error>}
923
+ * @throws {ApiError<429, Error>}
924
+ * @throws {ApiError<500, Error>}
925
+ */
926
+ export async function projectsUnitsSearch(params, config) {
927
+ const searchParams = new URLSearchParams();
928
+ if (params?.city != null)
929
+ searchParams.set("city", String(params.city));
930
+ if (params?.neighborhoodId != null) {
931
+ for (const v of params.neighborhoodId)
932
+ searchParams.append("neighborhood_id", String(v));
933
+ }
934
+ if (params?.developer != null)
935
+ searchParams.set("developer", String(params.developer));
936
+ if (params?.status != null) {
937
+ for (const v of params.status)
938
+ searchParams.append("status", String(v));
939
+ }
940
+ if (params?.projectType != null)
941
+ searchParams.set("project_type", String(params.projectType));
942
+ if (params?.listingCategory != null)
943
+ searchParams.set("listing_category", String(params.listingCategory));
944
+ if (params?.features != null) {
945
+ for (const v of params.features)
946
+ searchParams.append("features", String(v));
947
+ }
948
+ if (params?.banks != null) {
949
+ for (const v of params.banks)
950
+ searchParams.append("banks", String(v));
951
+ }
952
+ if (params?.listingType != null)
953
+ searchParams.set("listing_type", String(params.listingType));
954
+ if (params?.propertyType != null) {
955
+ for (const v of params.propertyType)
956
+ searchParams.append("property_type", String(v));
957
+ }
958
+ if (params?.bedrooms != null)
959
+ searchParams.set("bedrooms", String(params.bedrooms));
960
+ if (params?.bedroomsMin != null)
961
+ searchParams.set("bedrooms_min", String(params.bedroomsMin));
962
+ if (params?.bedroomsMax != null)
963
+ searchParams.set("bedrooms_max", String(params.bedroomsMax));
964
+ if (params?.bathrooms != null)
965
+ searchParams.set("bathrooms", String(params.bathrooms));
966
+ if (params?.bathroomsMin != null)
967
+ searchParams.set("bathrooms_min", String(params.bathroomsMin));
968
+ if (params?.priceMin != null)
969
+ searchParams.set("price_min", String(params.priceMin));
970
+ if (params?.priceMax != null)
971
+ searchParams.set("price_max", String(params.priceMax));
972
+ if (params?.areaMin != null)
973
+ searchParams.set("area_min", String(params.areaMin));
974
+ if (params?.areaMax != null)
975
+ searchParams.set("area_max", String(params.areaMax));
976
+ if (params?.sort != null)
977
+ searchParams.set("sort", String(params.sort));
978
+ if (params?.limit != null)
979
+ searchParams.set("limit", String(params.limit));
980
+ if (params?.cursor != null)
981
+ searchParams.set("cursor", String(params.cursor));
982
+ const res = await _request("GET", "/project-units", { searchParams }, config);
983
+ return res.json();
984
+ }
985
+ /**
986
+ * @throws {ApiError<400, Error>}
987
+ * @throws {ApiError<401, Error>}
988
+ * @throws {ApiError<403, Error>}
989
+ * @throws {ApiError<429, Error>}
990
+ * @throws {ApiError<500, Error>}
991
+ */
992
+ export async function projectsDevelopers(params, config) {
993
+ const searchParams = new URLSearchParams();
994
+ if (params?.city != null)
995
+ searchParams.set("city", String(params.city));
996
+ if (params?.limit != null)
997
+ searchParams.set("limit", String(params.limit));
998
+ if (params?.cursor != null)
999
+ searchParams.set("cursor", String(params.cursor));
1000
+ const res = await _request("GET", "/developers", { searchParams }, config);
1001
+ return res.json();
1002
+ }
1003
+ /**
1004
+ * @throws {ApiError<400, Error>}
1005
+ * @throws {ApiError<401, Error>}
1006
+ * @throws {ApiError<403, Error>}
1007
+ * @throws {ApiError<429, Error>}
1008
+ * @throws {ApiError<500, Error>}
1009
+ */
1010
+ export async function exportsList(params, config) {
1011
+ const searchParams = new URLSearchParams();
1012
+ if (params?.limit != null)
1013
+ searchParams.set("limit", String(params.limit));
1014
+ const res = await _request("GET", "/exports", { searchParams }, config);
1015
+ return res.json();
1016
+ }
1017
+ /**
1018
+ * @throws {ApiError<400, Error>}
1019
+ * @throws {ApiError<401, Error>}
1020
+ * @throws {ApiError<403, Error>}
1021
+ * @throws {ApiError<409, Error>}
1022
+ * @throws {ApiError<429, Error>}
1023
+ * @throws {ApiError<500, Error>}
1024
+ */
1025
+ export async function exportsCreate(body, params, config) {
1026
+ const extraHeaders = {
1027
+ ...(params?.idempotencyKey != null ? { "Idempotency-Key": String(params.idempotencyKey) } : {}),
1028
+ };
1029
+ const res = await _request("POST", "/exports", { body, extraHeaders }, config);
1030
+ return res.json();
1031
+ }
1032
+ /**
1033
+ * @throws {ApiError<400, Error>}
1034
+ * @throws {ApiError<401, Error>}
1035
+ * @throws {ApiError<403, Error>}
1036
+ * @throws {ApiError<404, Error>}
1037
+ * @throws {ApiError<429, Error>}
1038
+ * @throws {ApiError<500, Error>}
1039
+ */
1040
+ export async function exportsGet(exportId, config) {
1041
+ const res = await _request("GET", `/exports/${encodeURIComponent(exportId)}`, {}, config);
1042
+ return res.json();
1043
+ }
1044
+ /**
1045
+ * @throws {ApiError<400, Error>}
1046
+ * @throws {ApiError<401, Error>}
1047
+ * @throws {ApiError<403, Error>}
1048
+ * @throws {ApiError<429, Error>}
1049
+ * @throws {ApiError<500, Error>}
1050
+ */
1051
+ export async function organizationGet(config) {
1052
+ const res = await _request("GET", "/organization", {}, config);
1053
+ return res.json();
1054
+ }
1055
+ /**
1056
+ * @throws {ApiError<400, Error>}
1057
+ * @throws {ApiError<401, Error>}
1058
+ * @throws {ApiError<403, Error>}
1059
+ * @throws {ApiError<429, Error>}
1060
+ * @throws {ApiError<500, Error>}
1061
+ */
1062
+ export async function organizationKeysList(config) {
1063
+ const res = await _request("GET", "/organization/keys", {}, config);
1064
+ return res.json();
1065
+ }
1066
+ /**
1067
+ * @throws {ApiError<400, Error>}
1068
+ * @throws {ApiError<401, Error>}
1069
+ * @throws {ApiError<403, Error>}
1070
+ * @throws {ApiError<409, Error>}
1071
+ * @throws {ApiError<429, Error>}
1072
+ * @throws {ApiError<500, Error>}
1073
+ */
1074
+ export async function organizationKeysCreate(body, params, config) {
1075
+ const extraHeaders = {
1076
+ ...(params?.idempotencyKey != null ? { "Idempotency-Key": String(params.idempotencyKey) } : {}),
1077
+ };
1078
+ const res = await _request("POST", "/organization/keys", { body, extraHeaders }, config);
1079
+ return res.json();
1080
+ }
1081
+ /**
1082
+ * @throws {ApiError<400, Error>}
1083
+ * @throws {ApiError<401, Error>}
1084
+ * @throws {ApiError<403, Error>}
1085
+ * @throws {ApiError<404, Error>}
1086
+ * @throws {ApiError<409, Error>}
1087
+ * @throws {ApiError<429, Error>}
1088
+ * @throws {ApiError<500, Error>}
1089
+ */
1090
+ export async function organizationKeysRevoke(keyId, params, config) {
1091
+ const extraHeaders = {
1092
+ ...(params?.idempotencyKey != null ? { "Idempotency-Key": String(params.idempotencyKey) } : {}),
1093
+ };
1094
+ const res = await _request("POST", `/organization/keys/${encodeURIComponent(keyId)}/revoke`, { extraHeaders }, config);
1095
+ return res.json();
1096
+ }
1097
+ /**
1098
+ * @throws {ApiError<400, Error>}
1099
+ * @throws {ApiError<401, Error>}
1100
+ * @throws {ApiError<403, Error>}
1101
+ * @throws {ApiError<429, Error>}
1102
+ * @throws {ApiError<500, Error>}
1103
+ */
1104
+ export async function organizationProjectsList(config) {
1105
+ const res = await _request("GET", "/organization/projects", {}, config);
1106
+ return res.json();
1107
+ }
1108
+ /**
1109
+ * @throws {ApiError<400, Error>}
1110
+ * @throws {ApiError<401, Error>}
1111
+ * @throws {ApiError<403, Error>}
1112
+ * @throws {ApiError<429, Error>}
1113
+ * @throws {ApiError<500, Error>}
1114
+ */
1115
+ export async function organizationUsage(params, config) {
1116
+ const searchParams = new URLSearchParams();
1117
+ if (params?.days != null)
1118
+ searchParams.set("days", String(params.days));
1119
+ const res = await _request("GET", "/organization/usage", { searchParams }, config);
1120
+ return res.json();
1121
+ }
1122
+ /**
1123
+ * @throws {ApiError<400, Error>}
1124
+ * @throws {ApiError<401, Error>}
1125
+ * @throws {ApiError<403, Error>}
1126
+ * @throws {ApiError<429, Error>}
1127
+ * @throws {ApiError<500, Error>}
1128
+ */
1129
+ export async function organizationMembersList(config) {
1130
+ const res = await _request("GET", "/organization/members", {}, config);
1131
+ return res.json();
1132
+ }
1133
+ /**
1134
+ * @throws {ApiError<400, Error>}
1135
+ * @throws {ApiError<401, Error>}
1136
+ * @throws {ApiError<403, Error>}
1137
+ * @throws {ApiError<429, Error>}
1138
+ * @throws {ApiError<500, Error>}
1139
+ */
1140
+ export async function organizationAuditEventsList(params, config) {
1141
+ const searchParams = new URLSearchParams();
1142
+ if (params?.cursor != null)
1143
+ searchParams.set("cursor", String(params.cursor));
1144
+ const res = await _request("GET", "/organization/audit-events", { searchParams }, config);
1145
+ return res.json();
1146
+ }
1147
+ /**
1148
+ * @throws {ApiError<400, Error>}
1149
+ * @throws {ApiError<401, Error>}
1150
+ * @throws {ApiError<403, Error>}
1151
+ * @throws {ApiError<429, Error>}
1152
+ * @throws {ApiError<500, Error>}
1153
+ */
1154
+ export async function organizationRequestLogsList(params, config) {
1155
+ const searchParams = new URLSearchParams();
1156
+ if (params?.requestId != null)
1157
+ searchParams.set("request_id", String(params.requestId));
1158
+ if (params?.keyId != null)
1159
+ searchParams.set("key_id", String(params.keyId));
1160
+ if (params?.route != null)
1161
+ searchParams.set("route", String(params.route));
1162
+ if (params?.status != null)
1163
+ searchParams.set("status", String(params.status));
1164
+ if (params?.since != null)
1165
+ searchParams.set("since", String(params.since));
1166
+ if (params?.until != null)
1167
+ searchParams.set("until", String(params.until));
1168
+ if (params?.limit != null)
1169
+ searchParams.set("limit", String(params.limit));
1170
+ if (params?.cursor != null)
1171
+ searchParams.set("cursor", String(params.cursor));
1172
+ const res = await _request("GET", "/organization/request-logs", { searchParams }, config);
1173
+ return res.json();
1174
+ }
1175
+ /**
1176
+ * @throws {ApiError<400, Error>}
1177
+ * @throws {ApiError<401, Error>}
1178
+ * @throws {ApiError<403, Error>}
1179
+ * @throws {ApiError<429, Error>}
1180
+ * @throws {ApiError<500, Error>}
1181
+ */
1182
+ export async function organizationWebhooksList(config) {
1183
+ const res = await _request("GET", "/organization/webhooks", {}, config);
1184
+ return res.json();
1185
+ }
1186
+ /**
1187
+ * @throws {ApiError<400, Error>}
1188
+ * @throws {ApiError<401, Error>}
1189
+ * @throws {ApiError<403, Error>}
1190
+ * @throws {ApiError<409, Error>}
1191
+ * @throws {ApiError<429, Error>}
1192
+ * @throws {ApiError<500, Error>}
1193
+ */
1194
+ export async function organizationWebhooksCreate(body, params, config) {
1195
+ const extraHeaders = {
1196
+ ...(params?.idempotencyKey != null ? { "Idempotency-Key": String(params.idempotencyKey) } : {}),
1197
+ };
1198
+ const res = await _request("POST", "/organization/webhooks", { body, extraHeaders }, config);
1199
+ return res.json();
1200
+ }
1201
+ /**
1202
+ * @throws {ApiError<400, Error>}
1203
+ * @throws {ApiError<401, Error>}
1204
+ * @throws {ApiError<403, Error>}
1205
+ * @throws {ApiError<404, Error>}
1206
+ * @throws {ApiError<409, Error>}
1207
+ * @throws {ApiError<429, Error>}
1208
+ * @throws {ApiError<500, Error>}
1209
+ */
1210
+ export async function organizationWebhooksDelete(webhookId, params, config) {
1211
+ const extraHeaders = {
1212
+ ...(params?.idempotencyKey != null ? { "Idempotency-Key": String(params.idempotencyKey) } : {}),
1213
+ };
1214
+ const res = await _request("POST", `/organization/webhooks/${encodeURIComponent(webhookId)}/delete`, { extraHeaders }, config);
1215
+ return res.json();
1216
+ }
1217
+ /**
1218
+ * @throws {ApiError<400, Error>}
1219
+ * @throws {ApiError<401, Error>}
1220
+ * @throws {ApiError<403, Error>}
1221
+ * @throws {ApiError<404, Error>}
1222
+ * @throws {ApiError<429, Error>}
1223
+ * @throws {ApiError<500, Error>}
1224
+ */
1225
+ export async function organizationWebhooksDeliveries(webhookId, params, config) {
1226
+ const searchParams = new URLSearchParams();
1227
+ if (params?.limit != null)
1228
+ searchParams.set("limit", String(params.limit));
1229
+ const res = await _request("GET", `/organization/webhooks/${encodeURIComponent(webhookId)}/deliveries`, { searchParams }, config);
1230
+ return res.json();
1231
+ }
1232
+ /**
1233
+ * @throws {ApiError<400, Error>}
1234
+ * @throws {ApiError<401, Error>}
1235
+ * @throws {ApiError<403, Error>}
1236
+ * @throws {ApiError<404, Error>}
1237
+ * @throws {ApiError<409, Error>}
1238
+ * @throws {ApiError<429, Error>}
1239
+ * @throws {ApiError<500, Error>}
1240
+ */
1241
+ export async function organizationWebhooksReplay(webhookId, deliveryId, params, config) {
1242
+ const extraHeaders = {
1243
+ ...(params?.idempotencyKey != null ? { "Idempotency-Key": String(params.idempotencyKey) } : {}),
1244
+ };
1245
+ const res = await _request("POST", `/organization/webhooks/${encodeURIComponent(webhookId)}/deliveries/${encodeURIComponent(deliveryId)}/replay`, { extraHeaders }, config);
1246
+ return res.json();
1247
+ }