@quba/sensitive-data-protection 0.0.12 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +59 -6
  2. package/dist/index.cjs +2908 -560
  3. package/dist/index.d.cts +3092 -764
  4. package/dist/index.d.mts +3092 -764
  5. package/dist/index.mjs +2593 -526
  6. package/docs/Action.md +33 -0
  7. package/docs/AnonymizeFileResponseBody.md +43 -0
  8. package/docs/AnonymizeRequestBody.md +4 -4
  9. package/docs/AnonymizeResponseBody.md +3 -1
  10. package/docs/{AnonymizeResponseBodySpansInner.md → Applied.md} +7 -4
  11. package/docs/At.md +37 -0
  12. package/docs/AttributeSegment.md +37 -0
  13. package/docs/{ValidationErrorLocInner.md → CellKind.md} +5 -4
  14. package/docs/CellNoteSegment.md +35 -0
  15. package/docs/CellSegment.md +43 -0
  16. package/docs/CommentKind.md +33 -0
  17. package/docs/CommentSegment.md +39 -0
  18. package/docs/ComponentSegment.md +39 -0
  19. package/docs/DetectRule.md +3 -1
  20. package/docs/ElementSegment.md +39 -0
  21. package/docs/EncryptRule.md +3 -1
  22. package/docs/{DetectRuleEntitiesInner.md → EndnoteSegment.md} +7 -6
  23. package/docs/{EntitiesAnyOfInner.md → EntityBody.md} +5 -4
  24. package/docs/ErrorCode.md +33 -0
  25. package/docs/ErrorInfo.md +39 -0
  26. package/docs/FieldError.md +51 -0
  27. package/docs/FieldErrorCode.md +33 -0
  28. package/docs/{HTTPValidationError.md → FieldErrorPathInner.md} +5 -6
  29. package/docs/FieldSegment.md +39 -0
  30. package/docs/FileAttributeResult.md +47 -0
  31. package/docs/FileEmbeddedResult.md +43 -0
  32. package/docs/FileModelResult.md +49 -0
  33. package/docs/{AnonymizeResponseBodyResultsInner.md → FileRegexResult.md} +11 -8
  34. package/docs/FileResult.md +51 -0
  35. package/docs/FootnoteSegment.md +37 -0
  36. package/docs/FrameSegment.md +37 -0
  37. package/docs/HMACRule.md +43 -0
  38. package/docs/HeaderFooterSegment.md +37 -0
  39. package/docs/IndexSegment.md +37 -0
  40. package/docs/ItemSegment.md +37 -0
  41. package/docs/KeySegment.md +37 -0
  42. package/docs/Kind.md +33 -0
  43. package/docs/LineSegment.md +39 -0
  44. package/docs/MaskRule.md +3 -1
  45. package/docs/ModelEntity.md +1 -1
  46. package/docs/ModelError.md +35 -0
  47. package/docs/ModelResult.md +3 -1
  48. package/docs/ModelStatus.md +45 -0
  49. package/docs/{Entities.md → ModelType.md} +5 -4
  50. package/docs/ParagraphKind.md +33 -0
  51. package/docs/ParagraphSegment.md +39 -0
  52. package/docs/PartSegment.md +39 -0
  53. package/docs/PathSegment.md +79 -0
  54. package/docs/PoliciesApi.md +10 -1
  55. package/docs/PolicyDocumentRulesInner.md +7 -1
  56. package/docs/{ValidationError.md → PropertySegment.md} +7 -12
  57. package/docs/PseudonymizeRule.md +41 -0
  58. package/docs/RangeKind.md +33 -0
  59. package/docs/RangeSegment.md +39 -0
  60. package/docs/RedactRule.md +3 -1
  61. package/docs/Refusal.md +36 -0
  62. package/docs/RegexResult.md +2 -0
  63. package/docs/RegionSegment.md +43 -0
  64. package/docs/ReplaceRule.md +3 -1
  65. package/docs/{AnonymizeRequestBodyRulesInner.md → RuleBody.md} +12 -5
  66. package/docs/SHA256Rule.md +3 -1
  67. package/docs/SHA512Rule.md +3 -1
  68. package/docs/ScanRequestBody.md +2 -0
  69. package/docs/ScanResponseBody.md +2 -0
  70. package/docs/SegmentSegment.md +39 -0
  71. package/docs/SensitiveDataProtectionApi.md +172 -4
  72. package/docs/ShapeKind.md +33 -0
  73. package/docs/ShapeSegment.md +41 -0
  74. package/docs/SheetSegment.md +39 -0
  75. package/docs/SlideSegment.md +41 -0
  76. package/docs/SpeakerNotesSegment.md +41 -0
  77. package/docs/TableSegment.md +37 -0
  78. package/docs/TagSegment.md +41 -0
  79. package/docs/TextSegment.md +39 -0
  80. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  //#region src/runtime.ts
2
2
  /**
3
3
  * Sensitive Data Protection API
4
- * Detect and de-identify sensitive data (PII) in text. Use `scan` to locate sensitive entities such as emails, phone numbers, and names, and `anonymize` to transform them using configurable rules (redact, mask, replace, hash, or encrypt).
4
+ * Detect and de-identify sensitive data (PII) in text. Use `scan` to locate sensitive entities such as emails, phone numbers, and names, and `anonymize` to transform them using configurable rules (redact, mask, replace, pseudonymize, hash, or encrypt).
5
5
  *
6
6
  * The version of the OpenAPI document: 0.1.0
7
7
  *
@@ -263,394 +263,437 @@ var TextApiResponse = class {
263
263
  };
264
264
 
265
265
  //#endregion
266
- //#region src/models/DetectRuleEntitiesInner.ts
266
+ //#region src/models/Action.ts
267
267
  /**
268
- * @export
268
+ * Sensitive Data Protection API
269
+ * Detect and de-identify sensitive data (PII) in text. Use `scan` to locate sensitive entities such as emails, phone numbers, and names, and `anonymize` to transform them using configurable rules (redact, mask, replace, pseudonymize, hash, or encrypt).
270
+ *
271
+ * The version of the OpenAPI document: 0.1.0
272
+ *
273
+ *
274
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
275
+ * https://openapi-generator.tech
276
+ * Do not edit the class manually.
269
277
  */
270
- const DetectRuleEntitiesInnerTypeEnum = {
271
- model: "model",
272
- regex: "regex"
273
- };
274
278
  /**
275
- * Check if a given object implements the DetectRuleEntitiesInner interface.
279
+ * What the browser extension does with a match, before the text is sent.
280
+ * `warn`: highlighted; the user may send it as it is. `enforce`: replaced
281
+ * with the rule's transformation before sending; sending is blocked when it
282
+ * can't be.
283
+ * @export
276
284
  */
277
- function instanceOfDetectRuleEntitiesInner(value) {
278
- if (!("value" in value) || value["value"] === void 0) return false;
279
- return true;
285
+ const Action = {
286
+ warn: "warn",
287
+ enforce: "enforce"
288
+ };
289
+ function instanceOfAction(value) {
290
+ for (const key in Action) if (Object.prototype.hasOwnProperty.call(Action, key)) {
291
+ if (Action[key] === value) return true;
292
+ }
293
+ return false;
280
294
  }
281
- function DetectRuleEntitiesInnerFromJSON(json) {
282
- return DetectRuleEntitiesInnerFromJSONTyped(json, false);
295
+ function ActionFromJSON(json) {
296
+ return ActionFromJSONTyped(json, false);
283
297
  }
284
- function DetectRuleEntitiesInnerFromJSONTyped(json, ignoreDiscriminator) {
285
- if (json == null) return json;
286
- return {
287
- "type": json["type"] == null ? void 0 : json["type"],
288
- "value": json["value"]
289
- };
298
+ function ActionFromJSONTyped(json, ignoreDiscriminator) {
299
+ return json;
290
300
  }
291
- function DetectRuleEntitiesInnerToJSON(json) {
292
- return DetectRuleEntitiesInnerToJSONTyped(json, false);
301
+ function ActionToJSON(value) {
302
+ return value;
293
303
  }
294
- function DetectRuleEntitiesInnerToJSONTyped(value, ignoreDiscriminator = false) {
295
- if (value == null) return value;
296
- return {
297
- "type": value["type"],
298
- "value": value["value"]
299
- };
304
+ function ActionToJSONTyped(value, ignoreDiscriminator) {
305
+ return value;
300
306
  }
301
307
 
302
308
  //#endregion
303
- //#region src/models/AnonymizeRequestBodyRulesInner.ts
304
- /**
305
- * @export
306
- */
307
- const AnonymizeRequestBodyRulesInnerTypeEnum = {
308
- replace: "replace",
309
- redact: "redact",
310
- sha256: "sha256",
311
- sha512: "sha512",
312
- encrypt: "encrypt",
313
- mask: "mask",
314
- detect: "detect"
315
- };
309
+ //#region src/models/Usage.ts
316
310
  /**
317
- * Check if a given object implements the AnonymizeRequestBodyRulesInner interface.
311
+ * Check if a given object implements the Usage interface.
318
312
  */
319
- function instanceOfAnonymizeRequestBodyRulesInner(value) {
320
- if (!("entities" in value) || value["entities"] === void 0) return false;
313
+ function instanceOfUsage(value) {
314
+ if (!("input_tokens" in value) || value["input_tokens"] === void 0) return false;
315
+ if (!("inference_ms" in value) || value["inference_ms"] === void 0) return false;
321
316
  return true;
322
317
  }
323
- function AnonymizeRequestBodyRulesInnerFromJSON(json) {
324
- return AnonymizeRequestBodyRulesInnerFromJSONTyped(json, false);
318
+ function UsageFromJSON(json) {
319
+ return UsageFromJSONTyped(json, false);
325
320
  }
326
- function AnonymizeRequestBodyRulesInnerFromJSONTyped(json, ignoreDiscriminator) {
321
+ function UsageFromJSONTyped(json, ignoreDiscriminator) {
327
322
  if (json == null) return json;
328
323
  return {
329
- "type": json["type"] == null ? void 0 : json["type"],
330
- "entities": json["entities"].map(DetectRuleEntitiesInnerFromJSON),
331
- "replacement": json["replacement"] == null ? void 0 : json["replacement"],
332
- "key": json["key"] == null ? void 0 : json["key"],
333
- "masking_char": json["masking_char"] == null ? void 0 : json["masking_char"],
334
- "chars_to_mask": json["chars_to_mask"] == null ? void 0 : json["chars_to_mask"],
335
- "from_end": json["from_end"] == null ? void 0 : json["from_end"]
324
+ "input_tokens": json["input_tokens"],
325
+ "inference_ms": json["inference_ms"]
336
326
  };
337
327
  }
338
- function AnonymizeRequestBodyRulesInnerToJSON(json) {
339
- return AnonymizeRequestBodyRulesInnerToJSONTyped(json, false);
328
+ function UsageToJSON(json) {
329
+ return UsageToJSONTyped(json, false);
340
330
  }
341
- function AnonymizeRequestBodyRulesInnerToJSONTyped(value, ignoreDiscriminator = false) {
331
+ function UsageToJSONTyped(value, ignoreDiscriminator = false) {
342
332
  if (value == null) return value;
343
333
  return {
344
- "type": value["type"],
345
- "entities": value["entities"].map(DetectRuleEntitiesInnerToJSON),
346
- "replacement": value["replacement"],
347
- "key": value["key"],
348
- "masking_char": value["masking_char"],
349
- "chars_to_mask": value["chars_to_mask"],
350
- "from_end": value["from_end"]
334
+ "input_tokens": value["input_tokens"],
335
+ "inference_ms": value["inference_ms"]
351
336
  };
352
337
  }
353
338
 
354
339
  //#endregion
355
- //#region src/models/AnonymizeRequestBody.ts
340
+ //#region src/models/FileAttributeResult.ts
356
341
  /**
357
- * Check if a given object implements the AnonymizeRequestBody interface.
342
+ * @export
358
343
  */
359
- function instanceOfAnonymizeRequestBody(value) {
360
- if (!("text" in value) || value["text"] === void 0) return false;
344
+ const FileAttributeResultTypeEnum = { attribute: "attribute" };
345
+ /**
346
+ * Check if a given object implements the FileAttributeResult interface.
347
+ */
348
+ function instanceOfFileAttributeResult(value) {
349
+ if (!("type" in value) || value["type"] === void 0) return false;
350
+ if (!("id" in value) || value["id"] === void 0) return false;
351
+ if (!("rule" in value) || value["rule"] === void 0) return false;
352
+ if (!("input" in value) || value["input"] === void 0) return false;
353
+ if (!("output" in value) || value["output"] === void 0) return false;
354
+ if (!("path" in value) || value["path"] === void 0) return false;
361
355
  return true;
362
356
  }
363
- function AnonymizeRequestBodyFromJSON(json) {
364
- return AnonymizeRequestBodyFromJSONTyped(json, false);
357
+ function FileAttributeResultFromJSON(json) {
358
+ return FileAttributeResultFromJSONTyped(json, false);
365
359
  }
366
- function AnonymizeRequestBodyFromJSONTyped(json, ignoreDiscriminator) {
360
+ function FileAttributeResultFromJSONTyped(json, ignoreDiscriminator) {
367
361
  if (json == null) return json;
368
362
  return {
369
- "text": json["text"],
370
- "rules": json["rules"] == null ? void 0 : json["rules"].map(AnonymizeRequestBodyRulesInnerFromJSON),
371
- "confidence_threshold": json["confidence_threshold"] == null ? void 0 : json["confidence_threshold"],
372
- "policy": json["policy"] == null ? void 0 : json["policy"]
363
+ "type": json["type"],
364
+ "id": json["id"],
365
+ "rule": json["rule"],
366
+ "input": json["input"],
367
+ "output": json["output"],
368
+ "content_type": json["content_type"] == null ? void 0 : json["content_type"],
369
+ "path": json["path"]
373
370
  };
374
371
  }
375
- function AnonymizeRequestBodyToJSON(json) {
376
- return AnonymizeRequestBodyToJSONTyped(json, false);
372
+ function FileAttributeResultToJSON(json) {
373
+ return FileAttributeResultToJSONTyped(json, false);
377
374
  }
378
- function AnonymizeRequestBodyToJSONTyped(value, ignoreDiscriminator = false) {
375
+ function FileAttributeResultToJSONTyped(value, ignoreDiscriminator = false) {
379
376
  if (value == null) return value;
380
377
  return {
381
- "text": value["text"],
382
- "rules": value["rules"] == null ? void 0 : value["rules"].map(AnonymizeRequestBodyRulesInnerToJSON),
383
- "confidence_threshold": value["confidence_threshold"],
384
- "policy": value["policy"]
378
+ "type": value["type"],
379
+ "id": value["id"],
380
+ "rule": value["rule"],
381
+ "input": value["input"],
382
+ "output": value["output"],
383
+ "content_type": value["content_type"],
384
+ "path": value["path"]
385
385
  };
386
386
  }
387
387
 
388
388
  //#endregion
389
- //#region src/models/Usage.ts
389
+ //#region src/models/FileEmbeddedResult.ts
390
390
  /**
391
- * Check if a given object implements the Usage interface.
391
+ * @export
392
392
  */
393
- function instanceOfUsage(value) {
394
- if (!("input_tokens" in value) || value["input_tokens"] === void 0) return false;
395
- if (!("inference_ms" in value) || value["inference_ms"] === void 0) return false;
393
+ const FileEmbeddedResultTypeEnum = { embedded: "embedded" };
394
+ /**
395
+ * Check if a given object implements the FileEmbeddedResult interface.
396
+ */
397
+ function instanceOfFileEmbeddedResult(value) {
398
+ if (!("type" in value) || value["type"] === void 0) return false;
399
+ if (!("id" in value) || value["id"] === void 0) return false;
400
+ if (!("rule" in value) || value["rule"] === void 0) return false;
401
+ if (!("content_type" in value) || value["content_type"] === void 0) return false;
402
+ if (!("path" in value) || value["path"] === void 0) return false;
396
403
  return true;
397
404
  }
398
- function UsageFromJSON(json) {
399
- return UsageFromJSONTyped(json, false);
405
+ function FileEmbeddedResultFromJSON(json) {
406
+ return FileEmbeddedResultFromJSONTyped(json, false);
400
407
  }
401
- function UsageFromJSONTyped(json, ignoreDiscriminator) {
408
+ function FileEmbeddedResultFromJSONTyped(json, ignoreDiscriminator) {
402
409
  if (json == null) return json;
403
410
  return {
404
- "input_tokens": json["input_tokens"],
405
- "inference_ms": json["inference_ms"]
411
+ "type": json["type"],
412
+ "id": json["id"],
413
+ "rule": json["rule"],
414
+ "content_type": json["content_type"],
415
+ "path": json["path"]
406
416
  };
407
417
  }
408
- function UsageToJSON(json) {
409
- return UsageToJSONTyped(json, false);
418
+ function FileEmbeddedResultToJSON(json) {
419
+ return FileEmbeddedResultToJSONTyped(json, false);
410
420
  }
411
- function UsageToJSONTyped(value, ignoreDiscriminator = false) {
421
+ function FileEmbeddedResultToJSONTyped(value, ignoreDiscriminator = false) {
412
422
  if (value == null) return value;
413
423
  return {
414
- "input_tokens": value["input_tokens"],
415
- "inference_ms": value["inference_ms"]
424
+ "type": value["type"],
425
+ "id": value["id"],
426
+ "rule": value["rule"],
427
+ "content_type": value["content_type"],
428
+ "path": value["path"]
416
429
  };
417
430
  }
418
431
 
419
432
  //#endregion
420
- //#region src/models/TextRange.ts
433
+ //#region src/models/FileModelResult.ts
421
434
  /**
422
- * Check if a given object implements the TextRange interface.
435
+ * @export
423
436
  */
424
- function instanceOfTextRange(value) {
425
- if (!("start" in value) || value["start"] === void 0) return false;
426
- if (!("end" in value) || value["end"] === void 0) return false;
437
+ const FileModelResultTypeEnum = { model: "model" };
438
+ /**
439
+ * Check if a given object implements the FileModelResult interface.
440
+ */
441
+ function instanceOfFileModelResult(value) {
442
+ if (!("type" in value) || value["type"] === void 0) return false;
443
+ if (!("id" in value) || value["id"] === void 0) return false;
444
+ if (!("rule" in value) || value["rule"] === void 0) return false;
427
445
  if (!("value" in value) || value["value"] === void 0) return false;
446
+ if (!("score" in value) || value["score"] === void 0) return false;
447
+ if (!("input" in value) || value["input"] === void 0) return false;
448
+ if (!("output" in value) || value["output"] === void 0) return false;
449
+ if (!("path" in value) || value["path"] === void 0) return false;
428
450
  return true;
429
451
  }
430
- function TextRangeFromJSON(json) {
431
- return TextRangeFromJSONTyped(json, false);
452
+ function FileModelResultFromJSON(json) {
453
+ return FileModelResultFromJSONTyped(json, false);
432
454
  }
433
- function TextRangeFromJSONTyped(json, ignoreDiscriminator) {
455
+ function FileModelResultFromJSONTyped(json, ignoreDiscriminator) {
434
456
  if (json == null) return json;
435
457
  return {
436
- "start": json["start"],
437
- "end": json["end"],
438
- "value": json["value"]
458
+ "type": json["type"],
459
+ "id": json["id"],
460
+ "rule": json["rule"],
461
+ "value": json["value"],
462
+ "score": json["score"],
463
+ "input": json["input"],
464
+ "output": json["output"],
465
+ "path": json["path"]
439
466
  };
440
467
  }
441
- function TextRangeToJSON(json) {
442
- return TextRangeToJSONTyped(json, false);
468
+ function FileModelResultToJSON(json) {
469
+ return FileModelResultToJSONTyped(json, false);
443
470
  }
444
- function TextRangeToJSONTyped(value, ignoreDiscriminator = false) {
471
+ function FileModelResultToJSONTyped(value, ignoreDiscriminator = false) {
445
472
  if (value == null) return value;
446
473
  return {
447
- "start": value["start"],
448
- "end": value["end"],
449
- "value": value["value"]
474
+ "type": value["type"],
475
+ "id": value["id"],
476
+ "rule": value["rule"],
477
+ "value": value["value"],
478
+ "score": value["score"],
479
+ "input": value["input"],
480
+ "output": value["output"],
481
+ "path": value["path"]
450
482
  };
451
483
  }
452
484
 
453
485
  //#endregion
454
- //#region src/models/AnonymizeResponseBodyResultsInner.ts
486
+ //#region src/models/FileRegexResult.ts
455
487
  /**
456
488
  * @export
457
489
  */
458
- const AnonymizeResponseBodyResultsInnerTypeEnum = {
459
- model: "model",
460
- regex: "regex"
461
- };
490
+ const FileRegexResultTypeEnum = { regex: "regex" };
462
491
  /**
463
- * Check if a given object implements the AnonymizeResponseBodyResultsInner interface.
492
+ * Check if a given object implements the FileRegexResult interface.
464
493
  */
465
- function instanceOfAnonymizeResponseBodyResultsInner(value) {
494
+ function instanceOfFileRegexResult(value) {
495
+ if (!("type" in value) || value["type"] === void 0) return false;
496
+ if (!("id" in value) || value["id"] === void 0) return false;
466
497
  if (!("rule" in value) || value["rule"] === void 0) return false;
467
498
  if (!("value" in value) || value["value"] === void 0) return false;
468
499
  if (!("input" in value) || value["input"] === void 0) return false;
469
500
  if (!("output" in value) || value["output"] === void 0) return false;
501
+ if (!("path" in value) || value["path"] === void 0) return false;
470
502
  return true;
471
503
  }
472
- function AnonymizeResponseBodyResultsInnerFromJSON(json) {
473
- return AnonymizeResponseBodyResultsInnerFromJSONTyped(json, false);
504
+ function FileRegexResultFromJSON(json) {
505
+ return FileRegexResultFromJSONTyped(json, false);
474
506
  }
475
- function AnonymizeResponseBodyResultsInnerFromJSONTyped(json, ignoreDiscriminator) {
507
+ function FileRegexResultFromJSONTyped(json, ignoreDiscriminator) {
476
508
  if (json == null) return json;
477
509
  return {
478
- "type": json["type"] == null ? void 0 : json["type"],
510
+ "type": json["type"],
511
+ "id": json["id"],
479
512
  "rule": json["rule"],
480
513
  "value": json["value"],
481
- "input": TextRangeFromJSON(json["input"]),
482
- "output": TextRangeFromJSON(json["output"]),
483
- "score": json["score"] == null ? void 0 : json["score"]
514
+ "input": json["input"],
515
+ "output": json["output"],
516
+ "path": json["path"]
484
517
  };
485
518
  }
486
- function AnonymizeResponseBodyResultsInnerToJSON(json) {
487
- return AnonymizeResponseBodyResultsInnerToJSONTyped(json, false);
519
+ function FileRegexResultToJSON(json) {
520
+ return FileRegexResultToJSONTyped(json, false);
488
521
  }
489
- function AnonymizeResponseBodyResultsInnerToJSONTyped(value, ignoreDiscriminator = false) {
522
+ function FileRegexResultToJSONTyped(value, ignoreDiscriminator = false) {
490
523
  if (value == null) return value;
491
524
  return {
492
525
  "type": value["type"],
526
+ "id": value["id"],
493
527
  "rule": value["rule"],
494
528
  "value": value["value"],
495
- "input": TextRangeToJSON(value["input"]),
496
- "output": TextRangeToJSON(value["output"]),
497
- "score": value["score"]
529
+ "input": value["input"],
530
+ "output": value["output"],
531
+ "path": value["path"]
498
532
  };
499
533
  }
500
534
 
501
535
  //#endregion
502
- //#region src/models/AnonymizeResponseBody.ts
536
+ //#region src/models/FileResult.ts
537
+ function FileResultFromJSON(json) {
538
+ return FileResultFromJSONTyped(json, false);
539
+ }
540
+ function FileResultFromJSONTyped(json, ignoreDiscriminator) {
541
+ if (json == null) return json;
542
+ switch (json["type"]) {
543
+ case "attribute": return Object.assign({}, FileAttributeResultFromJSONTyped(json, true), { type: "attribute" });
544
+ case "embedded": return Object.assign({}, FileEmbeddedResultFromJSONTyped(json, true), { type: "embedded" });
545
+ case "model": return Object.assign({}, FileModelResultFromJSONTyped(json, true), { type: "model" });
546
+ case "regex": return Object.assign({}, FileRegexResultFromJSONTyped(json, true), { type: "regex" });
547
+ default: return json;
548
+ }
549
+ }
550
+ function FileResultToJSON(json) {
551
+ return FileResultToJSONTyped(json, false);
552
+ }
553
+ function FileResultToJSONTyped(value, ignoreDiscriminator = false) {
554
+ if (value == null) return value;
555
+ switch (value["type"]) {
556
+ case "attribute": return Object.assign({}, FileAttributeResultToJSON(value), { type: "attribute" });
557
+ case "embedded": return Object.assign({}, FileEmbeddedResultToJSON(value), { type: "embedded" });
558
+ case "model": return Object.assign({}, FileModelResultToJSON(value), { type: "model" });
559
+ case "regex": return Object.assign({}, FileRegexResultToJSON(value), { type: "regex" });
560
+ default: return value;
561
+ }
562
+ }
563
+
564
+ //#endregion
565
+ //#region src/models/AnonymizeFileResponseBody.ts
503
566
  /**
504
- * Check if a given object implements the AnonymizeResponseBody interface.
567
+ * Check if a given object implements the AnonymizeFileResponseBody interface.
505
568
  */
506
- function instanceOfAnonymizeResponseBody(value) {
507
- if (!("text" in value) || value["text"] === void 0) return false;
569
+ function instanceOfAnonymizeFileResponseBody(value) {
508
570
  if (!("usage" in value) || value["usage"] === void 0) return false;
571
+ if (!("models" in value) || value["models"] === void 0) return false;
572
+ if (!("format" in value) || value["format"] === void 0) return false;
573
+ if (!("results" in value) || value["results"] === void 0) return false;
574
+ if (!("file" in value) || value["file"] === void 0) return false;
509
575
  return true;
510
576
  }
511
- function AnonymizeResponseBodyFromJSON(json) {
512
- return AnonymizeResponseBodyFromJSONTyped(json, false);
577
+ function AnonymizeFileResponseBodyFromJSON(json) {
578
+ return AnonymizeFileResponseBodyFromJSONTyped(json, false);
513
579
  }
514
- function AnonymizeResponseBodyFromJSONTyped(json, ignoreDiscriminator) {
580
+ function AnonymizeFileResponseBodyFromJSONTyped(json, ignoreDiscriminator) {
515
581
  if (json == null) return json;
516
582
  return {
517
- "text": json["text"],
518
- "results": json["results"] == null ? void 0 : json["results"].map(AnonymizeResponseBodyResultsInnerFromJSON),
519
- "usage": UsageFromJSON(json["usage"])
583
+ "usage": UsageFromJSON(json["usage"]),
584
+ "models": json["models"],
585
+ "format": json["format"],
586
+ "results": json["results"].map(FileResultFromJSON),
587
+ "file": json["file"]
520
588
  };
521
589
  }
522
- function AnonymizeResponseBodyToJSON(json) {
523
- return AnonymizeResponseBodyToJSONTyped(json, false);
590
+ function AnonymizeFileResponseBodyToJSON(json) {
591
+ return AnonymizeFileResponseBodyToJSONTyped(json, false);
524
592
  }
525
- function AnonymizeResponseBodyToJSONTyped(value, ignoreDiscriminator = false) {
593
+ function AnonymizeFileResponseBodyToJSONTyped(value, ignoreDiscriminator = false) {
526
594
  if (value == null) return value;
527
595
  return {
528
- "text": value["text"],
529
- "results": value["results"] == null ? void 0 : value["results"].map(AnonymizeResponseBodyResultsInnerToJSON),
530
- "usage": UsageToJSON(value["usage"])
596
+ "usage": UsageToJSON(value["usage"]),
597
+ "models": value["models"],
598
+ "format": value["format"],
599
+ "results": value["results"].map(FileResultToJSON),
600
+ "file": value["file"]
531
601
  };
532
602
  }
533
603
 
534
604
  //#endregion
535
- //#region src/models/PolicyDocumentRulesInner.ts
605
+ //#region src/models/ModelEntity.ts
536
606
  /**
537
607
  * @export
538
608
  */
539
- const PolicyDocumentRulesInnerTypeEnum = {
540
- detect: "detect",
541
- redact: "redact",
542
- replace: "replace",
543
- mask: "mask",
544
- sha256: "sha256",
545
- sha512: "sha512",
546
- encrypt: "encrypt"
547
- };
609
+ const ModelEntityTypeEnum = { model: "model" };
548
610
  /**
549
- * Check if a given object implements the PolicyDocumentRulesInner interface.
611
+ * Check if a given object implements the ModelEntity interface.
550
612
  */
551
- function instanceOfPolicyDocumentRulesInner(value) {
552
- if (!("entities" in value) || value["entities"] === void 0) return false;
613
+ function instanceOfModelEntity(value) {
614
+ if (!("type" in value) || value["type"] === void 0) return false;
615
+ if (!("value" in value) || value["value"] === void 0) return false;
553
616
  return true;
554
617
  }
555
- function PolicyDocumentRulesInnerFromJSON(json) {
556
- return PolicyDocumentRulesInnerFromJSONTyped(json, false);
618
+ function ModelEntityFromJSON(json) {
619
+ return ModelEntityFromJSONTyped(json, false);
557
620
  }
558
- function PolicyDocumentRulesInnerFromJSONTyped(json, ignoreDiscriminator) {
621
+ function ModelEntityFromJSONTyped(json, ignoreDiscriminator) {
559
622
  if (json == null) return json;
560
623
  return {
561
- "type": json["type"] == null ? void 0 : json["type"],
562
- "entities": json["entities"].map(DetectRuleEntitiesInnerFromJSON),
563
- "replacement": json["replacement"] == null ? void 0 : json["replacement"],
564
- "masking_char": json["masking_char"] == null ? void 0 : json["masking_char"],
565
- "chars_to_mask": json["chars_to_mask"] == null ? void 0 : json["chars_to_mask"],
566
- "from_end": json["from_end"] == null ? void 0 : json["from_end"],
567
- "key": json["key"] == null ? void 0 : json["key"]
624
+ "type": json["type"],
625
+ "value": json["value"]
568
626
  };
569
627
  }
570
- function PolicyDocumentRulesInnerToJSON(json) {
571
- return PolicyDocumentRulesInnerToJSONTyped(json, false);
628
+ function ModelEntityToJSON(json) {
629
+ return ModelEntityToJSONTyped(json, false);
572
630
  }
573
- function PolicyDocumentRulesInnerToJSONTyped(value, ignoreDiscriminator = false) {
631
+ function ModelEntityToJSONTyped(value, ignoreDiscriminator = false) {
574
632
  if (value == null) return value;
575
633
  return {
576
634
  "type": value["type"],
577
- "entities": value["entities"].map(DetectRuleEntitiesInnerToJSON),
578
- "replacement": value["replacement"],
579
- "masking_char": value["masking_char"],
580
- "chars_to_mask": value["chars_to_mask"],
581
- "from_end": value["from_end"],
582
- "key": value["key"]
635
+ "value": value["value"]
583
636
  };
584
637
  }
585
638
 
586
639
  //#endregion
587
- //#region src/models/PolicyDocument.ts
640
+ //#region src/models/RegexEntity.ts
588
641
  /**
589
642
  * @export
590
643
  */
591
- const PolicyDocumentSchemaVersionEnum = { NUMBER_1: 1 };
644
+ const RegexEntityTypeEnum = { regex: "regex" };
592
645
  /**
593
- * Check if a given object implements the PolicyDocument interface.
646
+ * Check if a given object implements the RegexEntity interface.
594
647
  */
595
- function instanceOfPolicyDocument(value) {
596
- if (!("schema_version" in value) || value["schema_version"] === void 0) return false;
597
- if (!("rules" in value) || value["rules"] === void 0) return false;
648
+ function instanceOfRegexEntity(value) {
649
+ if (!("type" in value) || value["type"] === void 0) return false;
650
+ if (!("value" in value) || value["value"] === void 0) return false;
598
651
  return true;
599
652
  }
600
- function PolicyDocumentFromJSON(json) {
601
- return PolicyDocumentFromJSONTyped(json, false);
653
+ function RegexEntityFromJSON(json) {
654
+ return RegexEntityFromJSONTyped(json, false);
602
655
  }
603
- function PolicyDocumentFromJSONTyped(json, ignoreDiscriminator) {
656
+ function RegexEntityFromJSONTyped(json, ignoreDiscriminator) {
604
657
  if (json == null) return json;
605
658
  return {
606
- "schema_version": json["schema_version"],
607
- "name": json["name"] == null ? void 0 : json["name"],
608
- "confidence_threshold": json["confidence_threshold"] == null ? void 0 : json["confidence_threshold"],
609
- "rules": json["rules"].map(PolicyDocumentRulesInnerFromJSON)
659
+ "type": json["type"],
660
+ "value": json["value"]
610
661
  };
611
662
  }
612
- function PolicyDocumentToJSON(json) {
613
- return PolicyDocumentToJSONTyped(json, false);
663
+ function RegexEntityToJSON(json) {
664
+ return RegexEntityToJSONTyped(json, false);
614
665
  }
615
- function PolicyDocumentToJSONTyped(value, ignoreDiscriminator = false) {
666
+ function RegexEntityToJSONTyped(value, ignoreDiscriminator = false) {
616
667
  if (value == null) return value;
617
668
  return {
618
- "schema_version": value["schema_version"],
619
- "name": value["name"],
620
- "confidence_threshold": value["confidence_threshold"],
621
- "rules": value["rules"].map(PolicyDocumentRulesInnerToJSON)
669
+ "type": value["type"],
670
+ "value": value["value"]
622
671
  };
623
672
  }
624
673
 
625
674
  //#endregion
626
- //#region src/models/CreatePolicyRequest.ts
627
- /**
628
- * Check if a given object implements the CreatePolicyRequest interface.
629
- */
630
- function instanceOfCreatePolicyRequest(value) {
631
- if (!("name" in value) || value["name"] === void 0) return false;
632
- if (!("document" in value) || value["document"] === void 0) return false;
633
- return true;
634
- }
635
- function CreatePolicyRequestFromJSON(json) {
636
- return CreatePolicyRequestFromJSONTyped(json, false);
675
+ //#region src/models/EntityBody.ts
676
+ function EntityBodyFromJSON(json) {
677
+ return EntityBodyFromJSONTyped(json, false);
637
678
  }
638
- function CreatePolicyRequestFromJSONTyped(json, ignoreDiscriminator) {
679
+ function EntityBodyFromJSONTyped(json, ignoreDiscriminator) {
639
680
  if (json == null) return json;
640
- return {
641
- "name": json["name"],
642
- "document": PolicyDocumentFromJSON(json["document"])
643
- };
681
+ switch (json["type"]) {
682
+ case "model": return Object.assign({}, ModelEntityFromJSONTyped(json, true), { type: "model" });
683
+ case "regex": return Object.assign({}, RegexEntityFromJSONTyped(json, true), { type: "regex" });
684
+ default: return json;
685
+ }
644
686
  }
645
- function CreatePolicyRequestToJSON(json) {
646
- return CreatePolicyRequestToJSONTyped(json, false);
687
+ function EntityBodyToJSON(json) {
688
+ return EntityBodyToJSONTyped(json, false);
647
689
  }
648
- function CreatePolicyRequestToJSONTyped(value, ignoreDiscriminator = false) {
690
+ function EntityBodyToJSONTyped(value, ignoreDiscriminator = false) {
649
691
  if (value == null) return value;
650
- return {
651
- "name": value["name"],
652
- "document": PolicyDocumentToJSON(value["document"])
653
- };
692
+ switch (value["type"]) {
693
+ case "model": return Object.assign({}, ModelEntityToJSON(value), { type: "model" });
694
+ case "regex": return Object.assign({}, RegexEntityToJSON(value), { type: "regex" });
695
+ default: return value;
696
+ }
654
697
  }
655
698
 
656
699
  //#endregion
@@ -663,6 +706,7 @@ const DetectRuleTypeEnum = { detect: "detect" };
663
706
  * Check if a given object implements the DetectRule interface.
664
707
  */
665
708
  function instanceOfDetectRule(value) {
709
+ if (!("type" in value) || value["type"] === void 0) return false;
666
710
  if (!("entities" in value) || value["entities"] === void 0) return false;
667
711
  return true;
668
712
  }
@@ -672,8 +716,9 @@ function DetectRuleFromJSON(json) {
672
716
  function DetectRuleFromJSONTyped(json, ignoreDiscriminator) {
673
717
  if (json == null) return json;
674
718
  return {
675
- "type": json["type"] == null ? void 0 : json["type"],
676
- "entities": json["entities"].map(DetectRuleEntitiesInnerFromJSON)
719
+ "type": json["type"],
720
+ "entities": json["entities"].map(EntityBodyFromJSON),
721
+ "action": json["action"] == null ? void 0 : ActionFromJSON(json["action"])
677
722
  };
678
723
  }
679
724
  function DetectRuleToJSON(json) {
@@ -683,7 +728,8 @@ function DetectRuleToJSONTyped(value, ignoreDiscriminator = false) {
683
728
  if (value == null) return value;
684
729
  return {
685
730
  "type": value["type"],
686
- "entities": value["entities"].map(DetectRuleEntitiesInnerToJSON)
731
+ "entities": value["entities"].map(EntityBodyToJSON),
732
+ "action": ActionToJSON(value["action"])
687
733
  };
688
734
  }
689
735
 
@@ -697,6 +743,7 @@ const EncryptRuleTypeEnum = { encrypt: "encrypt" };
697
743
  * Check if a given object implements the EncryptRule interface.
698
744
  */
699
745
  function instanceOfEncryptRule(value) {
746
+ if (!("type" in value) || value["type"] === void 0) return false;
700
747
  if (!("entities" in value) || value["entities"] === void 0) return false;
701
748
  return true;
702
749
  }
@@ -706,8 +753,9 @@ function EncryptRuleFromJSON(json) {
706
753
  function EncryptRuleFromJSONTyped(json, ignoreDiscriminator) {
707
754
  if (json == null) return json;
708
755
  return {
709
- "type": json["type"] == null ? void 0 : json["type"],
710
- "entities": json["entities"].map(DetectRuleEntitiesInnerFromJSON),
756
+ "type": json["type"],
757
+ "entities": json["entities"].map(EntityBodyFromJSON),
758
+ "action": json["action"] == null ? void 0 : ActionFromJSON(json["action"]),
711
759
  "key": json["key"] == null ? void 0 : json["key"]
712
760
  };
713
761
  }
@@ -718,531 +766,2461 @@ function EncryptRuleToJSONTyped(value, ignoreDiscriminator = false) {
718
766
  if (value == null) return value;
719
767
  return {
720
768
  "type": value["type"],
721
- "entities": value["entities"].map(DetectRuleEntitiesInnerToJSON),
769
+ "entities": value["entities"].map(EntityBodyToJSON),
770
+ "action": ActionToJSON(value["action"]),
722
771
  "key": value["key"]
723
772
  };
724
773
  }
725
774
 
726
775
  //#endregion
727
- //#region src/models/ValidationErrorLocInner.ts
776
+ //#region src/models/HMACRule.ts
777
+ /**
778
+ * @export
779
+ */
780
+ const HMACRuleTypeEnum = { hmac: "hmac" };
728
781
  /**
729
- * Check if a given object implements the ValidationErrorLocInner interface.
782
+ * Check if a given object implements the HMACRule interface.
730
783
  */
731
- function instanceOfValidationErrorLocInner(value) {
784
+ function instanceOfHMACRule(value) {
785
+ if (!("type" in value) || value["type"] === void 0) return false;
786
+ if (!("entities" in value) || value["entities"] === void 0) return false;
787
+ if (!("key" in value) || value["key"] === void 0) return false;
732
788
  return true;
733
789
  }
734
- function ValidationErrorLocInnerFromJSON(json) {
735
- return ValidationErrorLocInnerFromJSONTyped(json, false);
790
+ function HMACRuleFromJSON(json) {
791
+ return HMACRuleFromJSONTyped(json, false);
736
792
  }
737
- function ValidationErrorLocInnerFromJSONTyped(json, ignoreDiscriminator) {
738
- return json;
793
+ function HMACRuleFromJSONTyped(json, ignoreDiscriminator) {
794
+ if (json == null) return json;
795
+ return {
796
+ "type": json["type"],
797
+ "entities": json["entities"].map(EntityBodyFromJSON),
798
+ "action": json["action"] == null ? void 0 : ActionFromJSON(json["action"]),
799
+ "key": json["key"],
800
+ "length": json["length"] == null ? void 0 : json["length"]
801
+ };
739
802
  }
740
- function ValidationErrorLocInnerToJSON(json) {
741
- return ValidationErrorLocInnerToJSONTyped(json, false);
803
+ function HMACRuleToJSON(json) {
804
+ return HMACRuleToJSONTyped(json, false);
742
805
  }
743
- function ValidationErrorLocInnerToJSONTyped(value, ignoreDiscriminator = false) {
744
- return value;
806
+ function HMACRuleToJSONTyped(value, ignoreDiscriminator = false) {
807
+ if (value == null) return value;
808
+ return {
809
+ "type": value["type"],
810
+ "entities": value["entities"].map(EntityBodyToJSON),
811
+ "action": ActionToJSON(value["action"]),
812
+ "key": value["key"],
813
+ "length": value["length"]
814
+ };
745
815
  }
746
816
 
747
817
  //#endregion
748
- //#region src/models/ValidationError.ts
818
+ //#region src/models/MaskRule.ts
819
+ /**
820
+ * @export
821
+ */
822
+ const MaskRuleTypeEnum = { mask: "mask" };
749
823
  /**
750
- * Check if a given object implements the ValidationError interface.
824
+ * Check if a given object implements the MaskRule interface.
751
825
  */
752
- function instanceOfValidationError(value) {
753
- if (!("loc" in value) || value["loc"] === void 0) return false;
754
- if (!("msg" in value) || value["msg"] === void 0) return false;
826
+ function instanceOfMaskRule(value) {
755
827
  if (!("type" in value) || value["type"] === void 0) return false;
828
+ if (!("entities" in value) || value["entities"] === void 0) return false;
756
829
  return true;
757
830
  }
758
- function ValidationErrorFromJSON(json) {
759
- return ValidationErrorFromJSONTyped(json, false);
831
+ function MaskRuleFromJSON(json) {
832
+ return MaskRuleFromJSONTyped(json, false);
760
833
  }
761
- function ValidationErrorFromJSONTyped(json, ignoreDiscriminator) {
834
+ function MaskRuleFromJSONTyped(json, ignoreDiscriminator) {
762
835
  if (json == null) return json;
763
836
  return {
764
- "loc": json["loc"].map(ValidationErrorLocInnerFromJSON),
765
- "msg": json["msg"],
766
837
  "type": json["type"],
767
- "input": json["input"] == null ? void 0 : json["input"],
768
- "ctx": json["ctx"] == null ? void 0 : json["ctx"]
838
+ "entities": json["entities"].map(EntityBodyFromJSON),
839
+ "action": json["action"] == null ? void 0 : ActionFromJSON(json["action"]),
840
+ "masking_char": json["masking_char"] == null ? void 0 : json["masking_char"],
841
+ "chars_to_mask": json["chars_to_mask"] == null ? void 0 : json["chars_to_mask"],
842
+ "from_end": json["from_end"] == null ? void 0 : json["from_end"]
769
843
  };
770
844
  }
771
- function ValidationErrorToJSON(json) {
772
- return ValidationErrorToJSONTyped(json, false);
845
+ function MaskRuleToJSON(json) {
846
+ return MaskRuleToJSONTyped(json, false);
773
847
  }
774
- function ValidationErrorToJSONTyped(value, ignoreDiscriminator = false) {
848
+ function MaskRuleToJSONTyped(value, ignoreDiscriminator = false) {
775
849
  if (value == null) return value;
776
850
  return {
777
- "loc": value["loc"].map(ValidationErrorLocInnerToJSON),
778
- "msg": value["msg"],
779
851
  "type": value["type"],
780
- "input": value["input"],
781
- "ctx": value["ctx"]
852
+ "entities": value["entities"].map(EntityBodyToJSON),
853
+ "action": ActionToJSON(value["action"]),
854
+ "masking_char": value["masking_char"],
855
+ "chars_to_mask": value["chars_to_mask"],
856
+ "from_end": value["from_end"]
782
857
  };
783
858
  }
784
859
 
785
860
  //#endregion
786
- //#region src/models/HTTPValidationError.ts
861
+ //#region src/models/PseudonymizeRule.ts
862
+ /**
863
+ * @export
864
+ */
865
+ const PseudonymizeRuleTypeEnum = { pseudonymize: "pseudonymize" };
787
866
  /**
788
- * Check if a given object implements the HTTPValidationError interface.
867
+ * Check if a given object implements the PseudonymizeRule interface.
789
868
  */
790
- function instanceOfHTTPValidationError(value) {
869
+ function instanceOfPseudonymizeRule(value) {
870
+ if (!("type" in value) || value["type"] === void 0) return false;
871
+ if (!("entities" in value) || value["entities"] === void 0) return false;
791
872
  return true;
792
873
  }
793
- function HTTPValidationErrorFromJSON(json) {
794
- return HTTPValidationErrorFromJSONTyped(json, false);
874
+ function PseudonymizeRuleFromJSON(json) {
875
+ return PseudonymizeRuleFromJSONTyped(json, false);
795
876
  }
796
- function HTTPValidationErrorFromJSONTyped(json, ignoreDiscriminator) {
877
+ function PseudonymizeRuleFromJSONTyped(json, ignoreDiscriminator) {
797
878
  if (json == null) return json;
798
- return { "detail": json["detail"] == null ? void 0 : json["detail"].map(ValidationErrorFromJSON) };
879
+ return {
880
+ "type": json["type"],
881
+ "entities": json["entities"].map(EntityBodyFromJSON),
882
+ "action": json["action"] == null ? void 0 : ActionFromJSON(json["action"]),
883
+ "tag": json["tag"] == null ? void 0 : json["tag"]
884
+ };
799
885
  }
800
- function HTTPValidationErrorToJSON(json) {
801
- return HTTPValidationErrorToJSONTyped(json, false);
886
+ function PseudonymizeRuleToJSON(json) {
887
+ return PseudonymizeRuleToJSONTyped(json, false);
802
888
  }
803
- function HTTPValidationErrorToJSONTyped(value, ignoreDiscriminator = false) {
889
+ function PseudonymizeRuleToJSONTyped(value, ignoreDiscriminator = false) {
804
890
  if (value == null) return value;
805
- return { "detail": value["detail"] == null ? void 0 : value["detail"].map(ValidationErrorToJSON) };
891
+ return {
892
+ "type": value["type"],
893
+ "entities": value["entities"].map(EntityBodyToJSON),
894
+ "action": ActionToJSON(value["action"]),
895
+ "tag": value["tag"]
896
+ };
806
897
  }
807
898
 
808
899
  //#endregion
809
- //#region src/models/PolicySummary.ts
900
+ //#region src/models/RedactRule.ts
810
901
  /**
811
- * Check if a given object implements the PolicySummary interface.
902
+ * @export
812
903
  */
813
- function instanceOfPolicySummary(value) {
814
- if (!("id" in value) || value["id"] === void 0) return false;
815
- if (!("name" in value) || value["name"] === void 0) return false;
816
- if (!("versionId" in value) || value["versionId"] === void 0) return false;
817
- if (!("createdAt" in value) || value["createdAt"] === void 0) return false;
818
- if (!("updatedAt" in value) || value["updatedAt"] === void 0) return false;
904
+ const RedactRuleTypeEnum = { redact: "redact" };
905
+ /**
906
+ * Check if a given object implements the RedactRule interface.
907
+ */
908
+ function instanceOfRedactRule(value) {
909
+ if (!("type" in value) || value["type"] === void 0) return false;
910
+ if (!("entities" in value) || value["entities"] === void 0) return false;
819
911
  return true;
820
912
  }
821
- function PolicySummaryFromJSON(json) {
822
- return PolicySummaryFromJSONTyped(json, false);
913
+ function RedactRuleFromJSON(json) {
914
+ return RedactRuleFromJSONTyped(json, false);
823
915
  }
824
- function PolicySummaryFromJSONTyped(json, ignoreDiscriminator) {
916
+ function RedactRuleFromJSONTyped(json, ignoreDiscriminator) {
825
917
  if (json == null) return json;
826
918
  return {
827
- "id": json["id"],
828
- "name": json["name"],
829
- "versionId": json["versionId"],
830
- "createdAt": json["createdAt"],
831
- "updatedAt": json["updatedAt"]
919
+ "type": json["type"],
920
+ "entities": json["entities"].map(EntityBodyFromJSON),
921
+ "action": json["action"] == null ? void 0 : ActionFromJSON(json["action"])
832
922
  };
833
923
  }
834
- function PolicySummaryToJSON(json) {
835
- return PolicySummaryToJSONTyped(json, false);
924
+ function RedactRuleToJSON(json) {
925
+ return RedactRuleToJSONTyped(json, false);
836
926
  }
837
- function PolicySummaryToJSONTyped(value, ignoreDiscriminator = false) {
927
+ function RedactRuleToJSONTyped(value, ignoreDiscriminator = false) {
838
928
  if (value == null) return value;
839
929
  return {
840
- "id": value["id"],
841
- "name": value["name"],
842
- "versionId": value["versionId"],
843
- "createdAt": value["createdAt"],
844
- "updatedAt": value["updatedAt"]
930
+ "type": value["type"],
931
+ "entities": value["entities"].map(EntityBodyToJSON),
932
+ "action": ActionToJSON(value["action"])
845
933
  };
846
934
  }
847
935
 
848
936
  //#endregion
849
- //#region src/models/ListPolicies200Response.ts
937
+ //#region src/models/ReplaceRule.ts
850
938
  /**
851
- * Check if a given object implements the ListPolicies200Response interface.
939
+ * @export
852
940
  */
853
- function instanceOfListPolicies200Response(value) {
854
- if (!("policies" in value) || value["policies"] === void 0) return false;
941
+ const ReplaceRuleTypeEnum = { replace: "replace" };
942
+ /**
943
+ * Check if a given object implements the ReplaceRule interface.
944
+ */
945
+ function instanceOfReplaceRule(value) {
946
+ if (!("type" in value) || value["type"] === void 0) return false;
947
+ if (!("entities" in value) || value["entities"] === void 0) return false;
855
948
  return true;
856
949
  }
857
- function ListPolicies200ResponseFromJSON(json) {
858
- return ListPolicies200ResponseFromJSONTyped(json, false);
950
+ function ReplaceRuleFromJSON(json) {
951
+ return ReplaceRuleFromJSONTyped(json, false);
859
952
  }
860
- function ListPolicies200ResponseFromJSONTyped(json, ignoreDiscriminator) {
953
+ function ReplaceRuleFromJSONTyped(json, ignoreDiscriminator) {
861
954
  if (json == null) return json;
862
- return { "policies": json["policies"].map(PolicySummaryFromJSON) };
955
+ return {
956
+ "type": json["type"],
957
+ "entities": json["entities"].map(EntityBodyFromJSON),
958
+ "action": json["action"] == null ? void 0 : ActionFromJSON(json["action"]),
959
+ "replacement": json["replacement"] == null ? void 0 : json["replacement"]
960
+ };
863
961
  }
864
- function ListPolicies200ResponseToJSON(json) {
865
- return ListPolicies200ResponseToJSONTyped(json, false);
962
+ function ReplaceRuleToJSON(json) {
963
+ return ReplaceRuleToJSONTyped(json, false);
866
964
  }
867
- function ListPolicies200ResponseToJSONTyped(value, ignoreDiscriminator = false) {
965
+ function ReplaceRuleToJSONTyped(value, ignoreDiscriminator = false) {
868
966
  if (value == null) return value;
869
- return { "policies": value["policies"].map(PolicySummaryToJSON) };
967
+ return {
968
+ "type": value["type"],
969
+ "entities": value["entities"].map(EntityBodyToJSON),
970
+ "action": ActionToJSON(value["action"]),
971
+ "replacement": value["replacement"]
972
+ };
870
973
  }
871
974
 
872
975
  //#endregion
873
- //#region src/models/MaskRule.ts
976
+ //#region src/models/SHA256Rule.ts
874
977
  /**
875
978
  * @export
876
979
  */
877
- const MaskRuleTypeEnum = { mask: "mask" };
980
+ const SHA256RuleTypeEnum = { sha256: "sha256" };
878
981
  /**
879
- * Check if a given object implements the MaskRule interface.
982
+ * Check if a given object implements the SHA256Rule interface.
880
983
  */
881
- function instanceOfMaskRule(value) {
984
+ function instanceOfSHA256Rule(value) {
985
+ if (!("type" in value) || value["type"] === void 0) return false;
882
986
  if (!("entities" in value) || value["entities"] === void 0) return false;
883
987
  return true;
884
988
  }
885
- function MaskRuleFromJSON(json) {
886
- return MaskRuleFromJSONTyped(json, false);
989
+ function SHA256RuleFromJSON(json) {
990
+ return SHA256RuleFromJSONTyped(json, false);
887
991
  }
888
- function MaskRuleFromJSONTyped(json, ignoreDiscriminator) {
992
+ function SHA256RuleFromJSONTyped(json, ignoreDiscriminator) {
889
993
  if (json == null) return json;
890
994
  return {
891
- "type": json["type"] == null ? void 0 : json["type"],
892
- "entities": json["entities"].map(DetectRuleEntitiesInnerFromJSON),
893
- "masking_char": json["masking_char"] == null ? void 0 : json["masking_char"],
894
- "chars_to_mask": json["chars_to_mask"] == null ? void 0 : json["chars_to_mask"],
895
- "from_end": json["from_end"] == null ? void 0 : json["from_end"]
995
+ "type": json["type"],
996
+ "entities": json["entities"].map(EntityBodyFromJSON),
997
+ "action": json["action"] == null ? void 0 : ActionFromJSON(json["action"])
896
998
  };
897
999
  }
898
- function MaskRuleToJSON(json) {
899
- return MaskRuleToJSONTyped(json, false);
1000
+ function SHA256RuleToJSON(json) {
1001
+ return SHA256RuleToJSONTyped(json, false);
900
1002
  }
901
- function MaskRuleToJSONTyped(value, ignoreDiscriminator = false) {
1003
+ function SHA256RuleToJSONTyped(value, ignoreDiscriminator = false) {
902
1004
  if (value == null) return value;
903
1005
  return {
904
1006
  "type": value["type"],
905
- "entities": value["entities"].map(DetectRuleEntitiesInnerToJSON),
906
- "masking_char": value["masking_char"],
907
- "chars_to_mask": value["chars_to_mask"],
908
- "from_end": value["from_end"]
1007
+ "entities": value["entities"].map(EntityBodyToJSON),
1008
+ "action": ActionToJSON(value["action"])
909
1009
  };
910
1010
  }
911
1011
 
912
1012
  //#endregion
913
- //#region src/models/ModelEntity.ts
1013
+ //#region src/models/SHA512Rule.ts
914
1014
  /**
915
1015
  * @export
916
1016
  */
917
- const ModelEntityTypeEnum = { model: "model" };
1017
+ const SHA512RuleTypeEnum = { sha512: "sha512" };
918
1018
  /**
919
- * Check if a given object implements the ModelEntity interface.
1019
+ * Check if a given object implements the SHA512Rule interface.
1020
+ */
1021
+ function instanceOfSHA512Rule(value) {
1022
+ if (!("type" in value) || value["type"] === void 0) return false;
1023
+ if (!("entities" in value) || value["entities"] === void 0) return false;
1024
+ return true;
1025
+ }
1026
+ function SHA512RuleFromJSON(json) {
1027
+ return SHA512RuleFromJSONTyped(json, false);
1028
+ }
1029
+ function SHA512RuleFromJSONTyped(json, ignoreDiscriminator) {
1030
+ if (json == null) return json;
1031
+ return {
1032
+ "type": json["type"],
1033
+ "entities": json["entities"].map(EntityBodyFromJSON),
1034
+ "action": json["action"] == null ? void 0 : ActionFromJSON(json["action"])
1035
+ };
1036
+ }
1037
+ function SHA512RuleToJSON(json) {
1038
+ return SHA512RuleToJSONTyped(json, false);
1039
+ }
1040
+ function SHA512RuleToJSONTyped(value, ignoreDiscriminator = false) {
1041
+ if (value == null) return value;
1042
+ return {
1043
+ "type": value["type"],
1044
+ "entities": value["entities"].map(EntityBodyToJSON),
1045
+ "action": ActionToJSON(value["action"])
1046
+ };
1047
+ }
1048
+
1049
+ //#endregion
1050
+ //#region src/models/RuleBody.ts
1051
+ function RuleBodyFromJSON(json) {
1052
+ return RuleBodyFromJSONTyped(json, false);
1053
+ }
1054
+ function RuleBodyFromJSONTyped(json, ignoreDiscriminator) {
1055
+ if (json == null) return json;
1056
+ switch (json["type"]) {
1057
+ case "detect": return Object.assign({}, DetectRuleFromJSONTyped(json, true), { type: "detect" });
1058
+ case "encrypt": return Object.assign({}, EncryptRuleFromJSONTyped(json, true), { type: "encrypt" });
1059
+ case "hmac": return Object.assign({}, HMACRuleFromJSONTyped(json, true), { type: "hmac" });
1060
+ case "mask": return Object.assign({}, MaskRuleFromJSONTyped(json, true), { type: "mask" });
1061
+ case "pseudonymize": return Object.assign({}, PseudonymizeRuleFromJSONTyped(json, true), { type: "pseudonymize" });
1062
+ case "redact": return Object.assign({}, RedactRuleFromJSONTyped(json, true), { type: "redact" });
1063
+ case "replace": return Object.assign({}, ReplaceRuleFromJSONTyped(json, true), { type: "replace" });
1064
+ case "sha256": return Object.assign({}, SHA256RuleFromJSONTyped(json, true), { type: "sha256" });
1065
+ case "sha512": return Object.assign({}, SHA512RuleFromJSONTyped(json, true), { type: "sha512" });
1066
+ default: return json;
1067
+ }
1068
+ }
1069
+ function RuleBodyToJSON(json) {
1070
+ return RuleBodyToJSONTyped(json, false);
1071
+ }
1072
+ function RuleBodyToJSONTyped(value, ignoreDiscriminator = false) {
1073
+ if (value == null) return value;
1074
+ switch (value["type"]) {
1075
+ case "detect": return Object.assign({}, DetectRuleToJSON(value), { type: "detect" });
1076
+ case "encrypt": return Object.assign({}, EncryptRuleToJSON(value), { type: "encrypt" });
1077
+ case "hmac": return Object.assign({}, HMACRuleToJSON(value), { type: "hmac" });
1078
+ case "mask": return Object.assign({}, MaskRuleToJSON(value), { type: "mask" });
1079
+ case "pseudonymize": return Object.assign({}, PseudonymizeRuleToJSON(value), { type: "pseudonymize" });
1080
+ case "redact": return Object.assign({}, RedactRuleToJSON(value), { type: "redact" });
1081
+ case "replace": return Object.assign({}, ReplaceRuleToJSON(value), { type: "replace" });
1082
+ case "sha256": return Object.assign({}, SHA256RuleToJSON(value), { type: "sha256" });
1083
+ case "sha512": return Object.assign({}, SHA512RuleToJSON(value), { type: "sha512" });
1084
+ default: return value;
1085
+ }
1086
+ }
1087
+
1088
+ //#endregion
1089
+ //#region src/models/AnonymizeRequestBody.ts
1090
+ /**
1091
+ * Check if a given object implements the AnonymizeRequestBody interface.
1092
+ */
1093
+ function instanceOfAnonymizeRequestBody(value) {
1094
+ if (!("text" in value) || value["text"] === void 0) return false;
1095
+ return true;
1096
+ }
1097
+ function AnonymizeRequestBodyFromJSON(json) {
1098
+ return AnonymizeRequestBodyFromJSONTyped(json, false);
1099
+ }
1100
+ function AnonymizeRequestBodyFromJSONTyped(json, ignoreDiscriminator) {
1101
+ if (json == null) return json;
1102
+ return {
1103
+ "text": json["text"],
1104
+ "rules": json["rules"] == null ? void 0 : json["rules"].map(RuleBodyFromJSON),
1105
+ "confidence_threshold": json["confidence_threshold"] == null ? void 0 : json["confidence_threshold"],
1106
+ "models": json["models"] == null ? void 0 : json["models"]
1107
+ };
1108
+ }
1109
+ function AnonymizeRequestBodyToJSON(json) {
1110
+ return AnonymizeRequestBodyToJSONTyped(json, false);
1111
+ }
1112
+ function AnonymizeRequestBodyToJSONTyped(value, ignoreDiscriminator = false) {
1113
+ if (value == null) return value;
1114
+ return {
1115
+ "text": value["text"],
1116
+ "rules": value["rules"] == null ? void 0 : value["rules"].map(RuleBodyToJSON),
1117
+ "confidence_threshold": value["confidence_threshold"],
1118
+ "models": value["models"]
1119
+ };
1120
+ }
1121
+
1122
+ //#endregion
1123
+ //#region src/models/TextRange.ts
1124
+ /**
1125
+ * Check if a given object implements the TextRange interface.
1126
+ */
1127
+ function instanceOfTextRange(value) {
1128
+ if (!("start" in value) || value["start"] === void 0) return false;
1129
+ if (!("end" in value) || value["end"] === void 0) return false;
1130
+ if (!("value" in value) || value["value"] === void 0) return false;
1131
+ return true;
1132
+ }
1133
+ function TextRangeFromJSON(json) {
1134
+ return TextRangeFromJSONTyped(json, false);
1135
+ }
1136
+ function TextRangeFromJSONTyped(json, ignoreDiscriminator) {
1137
+ if (json == null) return json;
1138
+ return {
1139
+ "start": json["start"],
1140
+ "end": json["end"],
1141
+ "value": json["value"]
1142
+ };
1143
+ }
1144
+ function TextRangeToJSON(json) {
1145
+ return TextRangeToJSONTyped(json, false);
1146
+ }
1147
+ function TextRangeToJSONTyped(value, ignoreDiscriminator = false) {
1148
+ if (value == null) return value;
1149
+ return {
1150
+ "start": value["start"],
1151
+ "end": value["end"],
1152
+ "value": value["value"]
1153
+ };
1154
+ }
1155
+
1156
+ //#endregion
1157
+ //#region src/models/ModelResult.ts
1158
+ /**
1159
+ * @export
1160
+ */
1161
+ const ModelResultTypeEnum = { model: "model" };
1162
+ /**
1163
+ * Check if a given object implements the ModelResult interface.
1164
+ */
1165
+ function instanceOfModelResult(value) {
1166
+ if (!("type" in value) || value["type"] === void 0) return false;
1167
+ if (!("rule" in value) || value["rule"] === void 0) return false;
1168
+ if (!("value" in value) || value["value"] === void 0) return false;
1169
+ if (!("input" in value) || value["input"] === void 0) return false;
1170
+ if (!("output" in value) || value["output"] === void 0) return false;
1171
+ return true;
1172
+ }
1173
+ function ModelResultFromJSON(json) {
1174
+ return ModelResultFromJSONTyped(json, false);
1175
+ }
1176
+ function ModelResultFromJSONTyped(json, ignoreDiscriminator) {
1177
+ if (json == null) return json;
1178
+ return {
1179
+ "type": json["type"],
1180
+ "rule": json["rule"],
1181
+ "value": json["value"],
1182
+ "input": TextRangeFromJSON(json["input"]),
1183
+ "output": TextRangeFromJSON(json["output"]),
1184
+ "score": json["score"] == null ? void 0 : json["score"],
1185
+ "action": json["action"] == null ? void 0 : ActionFromJSON(json["action"])
1186
+ };
1187
+ }
1188
+ function ModelResultToJSON(json) {
1189
+ return ModelResultToJSONTyped(json, false);
1190
+ }
1191
+ function ModelResultToJSONTyped(value, ignoreDiscriminator = false) {
1192
+ if (value == null) return value;
1193
+ return {
1194
+ "type": value["type"],
1195
+ "rule": value["rule"],
1196
+ "value": value["value"],
1197
+ "input": TextRangeToJSON(value["input"]),
1198
+ "output": TextRangeToJSON(value["output"]),
1199
+ "score": value["score"],
1200
+ "action": ActionToJSON(value["action"])
1201
+ };
1202
+ }
1203
+
1204
+ //#endregion
1205
+ //#region src/models/RegexResult.ts
1206
+ /**
1207
+ * @export
1208
+ */
1209
+ const RegexResultTypeEnum = { regex: "regex" };
1210
+ /**
1211
+ * Check if a given object implements the RegexResult interface.
1212
+ */
1213
+ function instanceOfRegexResult(value) {
1214
+ if (!("type" in value) || value["type"] === void 0) return false;
1215
+ if (!("rule" in value) || value["rule"] === void 0) return false;
1216
+ if (!("value" in value) || value["value"] === void 0) return false;
1217
+ if (!("input" in value) || value["input"] === void 0) return false;
1218
+ if (!("output" in value) || value["output"] === void 0) return false;
1219
+ return true;
1220
+ }
1221
+ function RegexResultFromJSON(json) {
1222
+ return RegexResultFromJSONTyped(json, false);
1223
+ }
1224
+ function RegexResultFromJSONTyped(json, ignoreDiscriminator) {
1225
+ if (json == null) return json;
1226
+ return {
1227
+ "type": json["type"],
1228
+ "rule": json["rule"],
1229
+ "value": json["value"],
1230
+ "input": TextRangeFromJSON(json["input"]),
1231
+ "output": TextRangeFromJSON(json["output"]),
1232
+ "action": json["action"] == null ? void 0 : ActionFromJSON(json["action"])
1233
+ };
1234
+ }
1235
+ function RegexResultToJSON(json) {
1236
+ return RegexResultToJSONTyped(json, false);
1237
+ }
1238
+ function RegexResultToJSONTyped(value, ignoreDiscriminator = false) {
1239
+ if (value == null) return value;
1240
+ return {
1241
+ "type": value["type"],
1242
+ "rule": value["rule"],
1243
+ "value": value["value"],
1244
+ "input": TextRangeToJSON(value["input"]),
1245
+ "output": TextRangeToJSON(value["output"]),
1246
+ "action": ActionToJSON(value["action"])
1247
+ };
1248
+ }
1249
+
1250
+ //#endregion
1251
+ //#region src/models/Applied.ts
1252
+ function AppliedFromJSON(json) {
1253
+ return AppliedFromJSONTyped(json, false);
1254
+ }
1255
+ function AppliedFromJSONTyped(json, ignoreDiscriminator) {
1256
+ if (json == null) return json;
1257
+ switch (json["type"]) {
1258
+ case "model": return Object.assign({}, ModelResultFromJSONTyped(json, true), { type: "model" });
1259
+ case "regex": return Object.assign({}, RegexResultFromJSONTyped(json, true), { type: "regex" });
1260
+ default: return json;
1261
+ }
1262
+ }
1263
+ function AppliedToJSON(json) {
1264
+ return AppliedToJSONTyped(json, false);
1265
+ }
1266
+ function AppliedToJSONTyped(value, ignoreDiscriminator = false) {
1267
+ if (value == null) return value;
1268
+ switch (value["type"]) {
1269
+ case "model": return Object.assign({}, ModelResultToJSON(value), { type: "model" });
1270
+ case "regex": return Object.assign({}, RegexResultToJSON(value), { type: "regex" });
1271
+ default: return value;
1272
+ }
1273
+ }
1274
+
1275
+ //#endregion
1276
+ //#region src/models/AnonymizeResponseBody.ts
1277
+ /**
1278
+ * Check if a given object implements the AnonymizeResponseBody interface.
1279
+ */
1280
+ function instanceOfAnonymizeResponseBody(value) {
1281
+ if (!("text" in value) || value["text"] === void 0) return false;
1282
+ if (!("usage" in value) || value["usage"] === void 0) return false;
1283
+ if (!("models" in value) || value["models"] === void 0) return false;
1284
+ return true;
1285
+ }
1286
+ function AnonymizeResponseBodyFromJSON(json) {
1287
+ return AnonymizeResponseBodyFromJSONTyped(json, false);
1288
+ }
1289
+ function AnonymizeResponseBodyFromJSONTyped(json, ignoreDiscriminator) {
1290
+ if (json == null) return json;
1291
+ return {
1292
+ "text": json["text"],
1293
+ "results": json["results"] == null ? void 0 : json["results"].map(AppliedFromJSON),
1294
+ "usage": UsageFromJSON(json["usage"]),
1295
+ "models": json["models"]
1296
+ };
1297
+ }
1298
+ function AnonymizeResponseBodyToJSON(json) {
1299
+ return AnonymizeResponseBodyToJSONTyped(json, false);
1300
+ }
1301
+ function AnonymizeResponseBodyToJSONTyped(value, ignoreDiscriminator = false) {
1302
+ if (value == null) return value;
1303
+ return {
1304
+ "text": value["text"],
1305
+ "results": value["results"] == null ? void 0 : value["results"].map(AppliedToJSON),
1306
+ "usage": UsageToJSON(value["usage"]),
1307
+ "models": value["models"]
1308
+ };
1309
+ }
1310
+
1311
+ //#endregion
1312
+ //#region src/models/AttributeSegment.ts
1313
+ /**
1314
+ * @export
1315
+ */
1316
+ const AttributeSegmentTypeEnum = { attribute: "attribute" };
1317
+ /**
1318
+ * Check if a given object implements the AttributeSegment interface.
1319
+ */
1320
+ function instanceOfAttributeSegment(value) {
1321
+ if (!("type" in value) || value["type"] === void 0) return false;
1322
+ if (!("name" in value) || value["name"] === void 0) return false;
1323
+ return true;
1324
+ }
1325
+ function AttributeSegmentFromJSON(json) {
1326
+ return AttributeSegmentFromJSONTyped(json, false);
1327
+ }
1328
+ function AttributeSegmentFromJSONTyped(json, ignoreDiscriminator) {
1329
+ if (json == null) return json;
1330
+ return {
1331
+ "type": json["type"],
1332
+ "name": json["name"]
1333
+ };
1334
+ }
1335
+ function AttributeSegmentToJSON(json) {
1336
+ return AttributeSegmentToJSONTyped(json, false);
1337
+ }
1338
+ function AttributeSegmentToJSONTyped(value, ignoreDiscriminator = false) {
1339
+ if (value == null) return value;
1340
+ return {
1341
+ "type": value["type"],
1342
+ "name": value["name"]
1343
+ };
1344
+ }
1345
+
1346
+ //#endregion
1347
+ //#region src/models/CellNoteSegment.ts
1348
+ /**
1349
+ * @export
1350
+ */
1351
+ const CellNoteSegmentTypeEnum = { cell_note: "cell_note" };
1352
+ /**
1353
+ * Check if a given object implements the CellNoteSegment interface.
1354
+ */
1355
+ function instanceOfCellNoteSegment(value) {
1356
+ if (!("type" in value) || value["type"] === void 0) return false;
1357
+ return true;
1358
+ }
1359
+ function CellNoteSegmentFromJSON(json) {
1360
+ return CellNoteSegmentFromJSONTyped(json, false);
1361
+ }
1362
+ function CellNoteSegmentFromJSONTyped(json, ignoreDiscriminator) {
1363
+ if (json == null) return json;
1364
+ return { "type": json["type"] };
1365
+ }
1366
+ function CellNoteSegmentToJSON(json) {
1367
+ return CellNoteSegmentToJSONTyped(json, false);
1368
+ }
1369
+ function CellNoteSegmentToJSONTyped(value, ignoreDiscriminator = false) {
1370
+ if (value == null) return value;
1371
+ return { "type": value["type"] };
1372
+ }
1373
+
1374
+ //#endregion
1375
+ //#region src/models/CellKind.ts
1376
+ function CellKindFromJSON(json) {
1377
+ return CellKindFromJSONTyped(json, false);
1378
+ }
1379
+ function CellKindFromJSONTyped(json, ignoreDiscriminator) {
1380
+ if (json == null) return json;
1381
+ if (typeof json === "string" && json === "formula") return json;
1382
+ if (typeof json === "string" && json === "hyperlink") return json;
1383
+ return {};
1384
+ }
1385
+ function CellKindToJSON(json) {
1386
+ return CellKindToJSONTyped(json, false);
1387
+ }
1388
+ function CellKindToJSONTyped(value, ignoreDiscriminator = false) {
1389
+ if (value == null) return value;
1390
+ if (typeof value === "string" && value === "formula") return value;
1391
+ if (typeof value === "string" && value === "hyperlink") return value;
1392
+ return {};
1393
+ }
1394
+
1395
+ //#endregion
1396
+ //#region src/models/CellSegment.ts
1397
+ /**
1398
+ * @export
1399
+ */
1400
+ const CellSegmentTypeEnum = { cell: "cell" };
1401
+ /**
1402
+ * Check if a given object implements the CellSegment interface.
1403
+ */
1404
+ function instanceOfCellSegment(value) {
1405
+ if (!("type" in value) || value["type"] === void 0) return false;
1406
+ if (!("row" in value) || value["row"] === void 0) return false;
1407
+ if (!("column" in value) || value["column"] === void 0) return false;
1408
+ if (!("ref" in value) || value["ref"] === void 0) return false;
1409
+ return true;
1410
+ }
1411
+ function CellSegmentFromJSON(json) {
1412
+ return CellSegmentFromJSONTyped(json, false);
1413
+ }
1414
+ function CellSegmentFromJSONTyped(json, ignoreDiscriminator) {
1415
+ if (json == null) return json;
1416
+ return {
1417
+ "type": json["type"],
1418
+ "row": json["row"],
1419
+ "column": json["column"],
1420
+ "ref": json["ref"],
1421
+ "kind": json["kind"] == null ? void 0 : CellKindFromJSON(json["kind"])
1422
+ };
1423
+ }
1424
+ function CellSegmentToJSON(json) {
1425
+ return CellSegmentToJSONTyped(json, false);
1426
+ }
1427
+ function CellSegmentToJSONTyped(value, ignoreDiscriminator = false) {
1428
+ if (value == null) return value;
1429
+ return {
1430
+ "type": value["type"],
1431
+ "row": value["row"],
1432
+ "column": value["column"],
1433
+ "ref": value["ref"],
1434
+ "kind": CellKindToJSON(value["kind"])
1435
+ };
1436
+ }
1437
+
1438
+ //#endregion
1439
+ //#region src/models/CommentKind.ts
1440
+ /**
1441
+ * Sensitive Data Protection API
1442
+ * Detect and de-identify sensitive data (PII) in text. Use `scan` to locate sensitive entities such as emails, phone numbers, and names, and `anonymize` to transform them using configurable rules (redact, mask, replace, pseudonymize, hash, or encrypt).
1443
+ *
1444
+ * The version of the OpenAPI document: 0.1.0
1445
+ *
1446
+ *
1447
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1448
+ * https://openapi-generator.tech
1449
+ * Do not edit the class manually.
1450
+ */
1451
+ /**
1452
+ * Its author's name or initials.
1453
+ * @export
1454
+ */
1455
+ const CommentKind = { author: "author" };
1456
+ function instanceOfCommentKind(value) {
1457
+ for (const key in CommentKind) if (Object.prototype.hasOwnProperty.call(CommentKind, key)) {
1458
+ if (CommentKind[key] === value) return true;
1459
+ }
1460
+ return false;
1461
+ }
1462
+ function CommentKindFromJSON(json) {
1463
+ return CommentKindFromJSONTyped(json, false);
1464
+ }
1465
+ function CommentKindFromJSONTyped(json, ignoreDiscriminator) {
1466
+ return json;
1467
+ }
1468
+ function CommentKindToJSON(value) {
1469
+ return value;
1470
+ }
1471
+ function CommentKindToJSONTyped(value, ignoreDiscriminator) {
1472
+ return value;
1473
+ }
1474
+
1475
+ //#endregion
1476
+ //#region src/models/CommentSegment.ts
1477
+ /**
1478
+ * @export
1479
+ */
1480
+ const CommentSegmentTypeEnum = { comment: "comment" };
1481
+ /**
1482
+ * Check if a given object implements the CommentSegment interface.
1483
+ */
1484
+ function instanceOfCommentSegment(value) {
1485
+ if (!("type" in value) || value["type"] === void 0) return false;
1486
+ if (!("id" in value) || value["id"] === void 0) return false;
1487
+ return true;
1488
+ }
1489
+ function CommentSegmentFromJSON(json) {
1490
+ return CommentSegmentFromJSONTyped(json, false);
1491
+ }
1492
+ function CommentSegmentFromJSONTyped(json, ignoreDiscriminator) {
1493
+ if (json == null) return json;
1494
+ return {
1495
+ "type": json["type"],
1496
+ "id": json["id"],
1497
+ "kind": json["kind"] == null ? void 0 : CommentKindFromJSON(json["kind"])
1498
+ };
1499
+ }
1500
+ function CommentSegmentToJSON(json) {
1501
+ return CommentSegmentToJSONTyped(json, false);
1502
+ }
1503
+ function CommentSegmentToJSONTyped(value, ignoreDiscriminator = false) {
1504
+ if (value == null) return value;
1505
+ return {
1506
+ "type": value["type"],
1507
+ "id": value["id"],
1508
+ "kind": CommentKindToJSON(value["kind"])
1509
+ };
1510
+ }
1511
+
1512
+ //#endregion
1513
+ //#region src/models/ComponentSegment.ts
1514
+ /**
1515
+ * @export
1516
+ */
1517
+ const ComponentSegmentTypeEnum = { component: "component" };
1518
+ /**
1519
+ * Check if a given object implements the ComponentSegment interface.
1520
+ */
1521
+ function instanceOfComponentSegment(value) {
1522
+ if (!("type" in value) || value["type"] === void 0) return false;
1523
+ if (!("number" in value) || value["number"] === void 0) return false;
1524
+ return true;
1525
+ }
1526
+ function ComponentSegmentFromJSON(json) {
1527
+ return ComponentSegmentFromJSONTyped(json, false);
1528
+ }
1529
+ function ComponentSegmentFromJSONTyped(json, ignoreDiscriminator) {
1530
+ if (json == null) return json;
1531
+ return {
1532
+ "type": json["type"],
1533
+ "number": json["number"],
1534
+ "subcomponent": json["subcomponent"] == null ? void 0 : json["subcomponent"]
1535
+ };
1536
+ }
1537
+ function ComponentSegmentToJSON(json) {
1538
+ return ComponentSegmentToJSONTyped(json, false);
1539
+ }
1540
+ function ComponentSegmentToJSONTyped(value, ignoreDiscriminator = false) {
1541
+ if (value == null) return value;
1542
+ return {
1543
+ "type": value["type"],
1544
+ "number": value["number"],
1545
+ "subcomponent": value["subcomponent"]
1546
+ };
1547
+ }
1548
+
1549
+ //#endregion
1550
+ //#region src/models/ElementSegment.ts
1551
+ /**
1552
+ * @export
1553
+ */
1554
+ const ElementSegmentTypeEnum = { element: "element" };
1555
+ /**
1556
+ * Check if a given object implements the ElementSegment interface.
1557
+ */
1558
+ function instanceOfElementSegment(value) {
1559
+ if (!("type" in value) || value["type"] === void 0) return false;
1560
+ if (!("name" in value) || value["name"] === void 0) return false;
1561
+ if (!("index" in value) || value["index"] === void 0) return false;
1562
+ return true;
1563
+ }
1564
+ function ElementSegmentFromJSON(json) {
1565
+ return ElementSegmentFromJSONTyped(json, false);
1566
+ }
1567
+ function ElementSegmentFromJSONTyped(json, ignoreDiscriminator) {
1568
+ if (json == null) return json;
1569
+ return {
1570
+ "type": json["type"],
1571
+ "name": json["name"],
1572
+ "index": json["index"]
1573
+ };
1574
+ }
1575
+ function ElementSegmentToJSON(json) {
1576
+ return ElementSegmentToJSONTyped(json, false);
1577
+ }
1578
+ function ElementSegmentToJSONTyped(value, ignoreDiscriminator = false) {
1579
+ if (value == null) return value;
1580
+ return {
1581
+ "type": value["type"],
1582
+ "name": value["name"],
1583
+ "index": value["index"]
1584
+ };
1585
+ }
1586
+
1587
+ //#endregion
1588
+ //#region src/models/EndnoteSegment.ts
1589
+ /**
1590
+ * @export
1591
+ */
1592
+ const EndnoteSegmentTypeEnum = { endnote: "endnote" };
1593
+ /**
1594
+ * Check if a given object implements the EndnoteSegment interface.
1595
+ */
1596
+ function instanceOfEndnoteSegment(value) {
1597
+ if (!("type" in value) || value["type"] === void 0) return false;
1598
+ if (!("id" in value) || value["id"] === void 0) return false;
1599
+ return true;
1600
+ }
1601
+ function EndnoteSegmentFromJSON(json) {
1602
+ return EndnoteSegmentFromJSONTyped(json, false);
1603
+ }
1604
+ function EndnoteSegmentFromJSONTyped(json, ignoreDiscriminator) {
1605
+ if (json == null) return json;
1606
+ return {
1607
+ "type": json["type"],
1608
+ "id": json["id"]
1609
+ };
1610
+ }
1611
+ function EndnoteSegmentToJSON(json) {
1612
+ return EndnoteSegmentToJSONTyped(json, false);
1613
+ }
1614
+ function EndnoteSegmentToJSONTyped(value, ignoreDiscriminator = false) {
1615
+ if (value == null) return value;
1616
+ return {
1617
+ "type": value["type"],
1618
+ "id": value["id"]
1619
+ };
1620
+ }
1621
+
1622
+ //#endregion
1623
+ //#region src/models/FieldSegment.ts
1624
+ /**
1625
+ * @export
1626
+ */
1627
+ const FieldSegmentTypeEnum = { field: "field" };
1628
+ /**
1629
+ * Check if a given object implements the FieldSegment interface.
1630
+ */
1631
+ function instanceOfFieldSegment(value) {
1632
+ if (!("type" in value) || value["type"] === void 0) return false;
1633
+ if (!("number" in value) || value["number"] === void 0) return false;
1634
+ if (!("repetition" in value) || value["repetition"] === void 0) return false;
1635
+ return true;
1636
+ }
1637
+ function FieldSegmentFromJSON(json) {
1638
+ return FieldSegmentFromJSONTyped(json, false);
1639
+ }
1640
+ function FieldSegmentFromJSONTyped(json, ignoreDiscriminator) {
1641
+ if (json == null) return json;
1642
+ return {
1643
+ "type": json["type"],
1644
+ "number": json["number"],
1645
+ "repetition": json["repetition"]
1646
+ };
1647
+ }
1648
+ function FieldSegmentToJSON(json) {
1649
+ return FieldSegmentToJSONTyped(json, false);
1650
+ }
1651
+ function FieldSegmentToJSONTyped(value, ignoreDiscriminator = false) {
1652
+ if (value == null) return value;
1653
+ return {
1654
+ "type": value["type"],
1655
+ "number": value["number"],
1656
+ "repetition": value["repetition"]
1657
+ };
1658
+ }
1659
+
1660
+ //#endregion
1661
+ //#region src/models/FootnoteSegment.ts
1662
+ /**
1663
+ * @export
1664
+ */
1665
+ const FootnoteSegmentTypeEnum = { footnote: "footnote" };
1666
+ /**
1667
+ * Check if a given object implements the FootnoteSegment interface.
1668
+ */
1669
+ function instanceOfFootnoteSegment(value) {
1670
+ if (!("type" in value) || value["type"] === void 0) return false;
1671
+ if (!("id" in value) || value["id"] === void 0) return false;
1672
+ return true;
1673
+ }
1674
+ function FootnoteSegmentFromJSON(json) {
1675
+ return FootnoteSegmentFromJSONTyped(json, false);
1676
+ }
1677
+ function FootnoteSegmentFromJSONTyped(json, ignoreDiscriminator) {
1678
+ if (json == null) return json;
1679
+ return {
1680
+ "type": json["type"],
1681
+ "id": json["id"]
1682
+ };
1683
+ }
1684
+ function FootnoteSegmentToJSON(json) {
1685
+ return FootnoteSegmentToJSONTyped(json, false);
1686
+ }
1687
+ function FootnoteSegmentToJSONTyped(value, ignoreDiscriminator = false) {
1688
+ if (value == null) return value;
1689
+ return {
1690
+ "type": value["type"],
1691
+ "id": value["id"]
1692
+ };
1693
+ }
1694
+
1695
+ //#endregion
1696
+ //#region src/models/FrameSegment.ts
1697
+ /**
1698
+ * @export
1699
+ */
1700
+ const FrameSegmentTypeEnum = { frame: "frame" };
1701
+ /**
1702
+ * Check if a given object implements the FrameSegment interface.
1703
+ */
1704
+ function instanceOfFrameSegment(value) {
1705
+ if (!("type" in value) || value["type"] === void 0) return false;
1706
+ if (!("number" in value) || value["number"] === void 0) return false;
1707
+ return true;
1708
+ }
1709
+ function FrameSegmentFromJSON(json) {
1710
+ return FrameSegmentFromJSONTyped(json, false);
1711
+ }
1712
+ function FrameSegmentFromJSONTyped(json, ignoreDiscriminator) {
1713
+ if (json == null) return json;
1714
+ return {
1715
+ "type": json["type"],
1716
+ "number": json["number"]
1717
+ };
1718
+ }
1719
+ function FrameSegmentToJSON(json) {
1720
+ return FrameSegmentToJSONTyped(json, false);
1721
+ }
1722
+ function FrameSegmentToJSONTyped(value, ignoreDiscriminator = false) {
1723
+ if (value == null) return value;
1724
+ return {
1725
+ "type": value["type"],
1726
+ "number": value["number"]
1727
+ };
1728
+ }
1729
+
1730
+ //#endregion
1731
+ //#region src/models/HeaderFooterSegment.ts
1732
+ /**
1733
+ * @export
1734
+ */
1735
+ const HeaderFooterSegmentTypeEnum = { header_footer: "header_footer" };
1736
+ /**
1737
+ * Check if a given object implements the HeaderFooterSegment interface.
1738
+ */
1739
+ function instanceOfHeaderFooterSegment(value) {
1740
+ if (!("type" in value) || value["type"] === void 0) return false;
1741
+ if (!("name" in value) || value["name"] === void 0) return false;
1742
+ return true;
1743
+ }
1744
+ function HeaderFooterSegmentFromJSON(json) {
1745
+ return HeaderFooterSegmentFromJSONTyped(json, false);
1746
+ }
1747
+ function HeaderFooterSegmentFromJSONTyped(json, ignoreDiscriminator) {
1748
+ if (json == null) return json;
1749
+ return {
1750
+ "type": json["type"],
1751
+ "name": json["name"]
1752
+ };
1753
+ }
1754
+ function HeaderFooterSegmentToJSON(json) {
1755
+ return HeaderFooterSegmentToJSONTyped(json, false);
1756
+ }
1757
+ function HeaderFooterSegmentToJSONTyped(value, ignoreDiscriminator = false) {
1758
+ if (value == null) return value;
1759
+ return {
1760
+ "type": value["type"],
1761
+ "name": value["name"]
1762
+ };
1763
+ }
1764
+
1765
+ //#endregion
1766
+ //#region src/models/IndexSegment.ts
1767
+ /**
1768
+ * @export
1769
+ */
1770
+ const IndexSegmentTypeEnum = { index: "index" };
1771
+ /**
1772
+ * Check if a given object implements the IndexSegment interface.
1773
+ */
1774
+ function instanceOfIndexSegment(value) {
1775
+ if (!("type" in value) || value["type"] === void 0) return false;
1776
+ if (!("index" in value) || value["index"] === void 0) return false;
1777
+ return true;
1778
+ }
1779
+ function IndexSegmentFromJSON(json) {
1780
+ return IndexSegmentFromJSONTyped(json, false);
1781
+ }
1782
+ function IndexSegmentFromJSONTyped(json, ignoreDiscriminator) {
1783
+ if (json == null) return json;
1784
+ return {
1785
+ "type": json["type"],
1786
+ "index": json["index"]
1787
+ };
1788
+ }
1789
+ function IndexSegmentToJSON(json) {
1790
+ return IndexSegmentToJSONTyped(json, false);
1791
+ }
1792
+ function IndexSegmentToJSONTyped(value, ignoreDiscriminator = false) {
1793
+ if (value == null) return value;
1794
+ return {
1795
+ "type": value["type"],
1796
+ "index": value["index"]
1797
+ };
1798
+ }
1799
+
1800
+ //#endregion
1801
+ //#region src/models/ItemSegment.ts
1802
+ /**
1803
+ * @export
1804
+ */
1805
+ const ItemSegmentTypeEnum = { item: "item" };
1806
+ /**
1807
+ * Check if a given object implements the ItemSegment interface.
1808
+ */
1809
+ function instanceOfItemSegment(value) {
1810
+ if (!("type" in value) || value["type"] === void 0) return false;
1811
+ if (!("number" in value) || value["number"] === void 0) return false;
1812
+ return true;
1813
+ }
1814
+ function ItemSegmentFromJSON(json) {
1815
+ return ItemSegmentFromJSONTyped(json, false);
1816
+ }
1817
+ function ItemSegmentFromJSONTyped(json, ignoreDiscriminator) {
1818
+ if (json == null) return json;
1819
+ return {
1820
+ "type": json["type"],
1821
+ "number": json["number"]
1822
+ };
1823
+ }
1824
+ function ItemSegmentToJSON(json) {
1825
+ return ItemSegmentToJSONTyped(json, false);
1826
+ }
1827
+ function ItemSegmentToJSONTyped(value, ignoreDiscriminator = false) {
1828
+ if (value == null) return value;
1829
+ return {
1830
+ "type": value["type"],
1831
+ "number": value["number"]
1832
+ };
1833
+ }
1834
+
1835
+ //#endregion
1836
+ //#region src/models/KeySegment.ts
1837
+ /**
1838
+ * @export
1839
+ */
1840
+ const KeySegmentTypeEnum = { key: "key" };
1841
+ /**
1842
+ * Check if a given object implements the KeySegment interface.
1843
+ */
1844
+ function instanceOfKeySegment(value) {
1845
+ if (!("type" in value) || value["type"] === void 0) return false;
1846
+ if (!("name" in value) || value["name"] === void 0) return false;
1847
+ return true;
1848
+ }
1849
+ function KeySegmentFromJSON(json) {
1850
+ return KeySegmentFromJSONTyped(json, false);
1851
+ }
1852
+ function KeySegmentFromJSONTyped(json, ignoreDiscriminator) {
1853
+ if (json == null) return json;
1854
+ return {
1855
+ "type": json["type"],
1856
+ "name": json["name"]
1857
+ };
1858
+ }
1859
+ function KeySegmentToJSON(json) {
1860
+ return KeySegmentToJSONTyped(json, false);
1861
+ }
1862
+ function KeySegmentToJSONTyped(value, ignoreDiscriminator = false) {
1863
+ if (value == null) return value;
1864
+ return {
1865
+ "type": value["type"],
1866
+ "name": value["name"]
1867
+ };
1868
+ }
1869
+
1870
+ //#endregion
1871
+ //#region src/models/LineSegment.ts
1872
+ /**
1873
+ * @export
1874
+ */
1875
+ const LineSegmentTypeEnum = { line: "line" };
1876
+ /**
1877
+ * Check if a given object implements the LineSegment interface.
1878
+ */
1879
+ function instanceOfLineSegment(value) {
1880
+ if (!("type" in value) || value["type"] === void 0) return false;
1881
+ if (!("line" in value) || value["line"] === void 0) return false;
1882
+ if (!("column" in value) || value["column"] === void 0) return false;
1883
+ return true;
1884
+ }
1885
+ function LineSegmentFromJSON(json) {
1886
+ return LineSegmentFromJSONTyped(json, false);
1887
+ }
1888
+ function LineSegmentFromJSONTyped(json, ignoreDiscriminator) {
1889
+ if (json == null) return json;
1890
+ return {
1891
+ "type": json["type"],
1892
+ "line": json["line"],
1893
+ "column": json["column"]
1894
+ };
1895
+ }
1896
+ function LineSegmentToJSON(json) {
1897
+ return LineSegmentToJSONTyped(json, false);
1898
+ }
1899
+ function LineSegmentToJSONTyped(value, ignoreDiscriminator = false) {
1900
+ if (value == null) return value;
1901
+ return {
1902
+ "type": value["type"],
1903
+ "line": value["line"],
1904
+ "column": value["column"]
1905
+ };
1906
+ }
1907
+
1908
+ //#endregion
1909
+ //#region src/models/ParagraphKind.ts
1910
+ function ParagraphKindFromJSON(json) {
1911
+ return ParagraphKindFromJSONTyped(json, false);
1912
+ }
1913
+ function ParagraphKindFromJSONTyped(json, ignoreDiscriminator) {
1914
+ if (json == null) return json;
1915
+ if (typeof json === "string" && json === "field_code") return json;
1916
+ if (typeof json === "string" && json === "content_control") return json;
1917
+ if (typeof json === "string" && json === "hyperlink") return json;
1918
+ if (typeof json === "string" && json === "form_field") return json;
1919
+ if (typeof json === "string" && json === "attribute") return json;
1920
+ if (typeof json === "string" && json === "deleted_text") return json;
1921
+ return {};
1922
+ }
1923
+ function ParagraphKindToJSON(json) {
1924
+ return ParagraphKindToJSONTyped(json, false);
1925
+ }
1926
+ function ParagraphKindToJSONTyped(value, ignoreDiscriminator = false) {
1927
+ if (value == null) return value;
1928
+ if (typeof value === "string" && value === "field_code") return value;
1929
+ if (typeof value === "string" && value === "content_control") return value;
1930
+ if (typeof value === "string" && value === "hyperlink") return value;
1931
+ if (typeof value === "string" && value === "form_field") return value;
1932
+ if (typeof value === "string" && value === "attribute") return value;
1933
+ if (typeof value === "string" && value === "deleted_text") return value;
1934
+ return {};
1935
+ }
1936
+
1937
+ //#endregion
1938
+ //#region src/models/ParagraphSegment.ts
1939
+ /**
1940
+ * @export
1941
+ */
1942
+ const ParagraphSegmentTypeEnum = { paragraph: "paragraph" };
1943
+ /**
1944
+ * Check if a given object implements the ParagraphSegment interface.
1945
+ */
1946
+ function instanceOfParagraphSegment(value) {
1947
+ if (!("type" in value) || value["type"] === void 0) return false;
1948
+ if (!("number" in value) || value["number"] === void 0) return false;
1949
+ return true;
1950
+ }
1951
+ function ParagraphSegmentFromJSON(json) {
1952
+ return ParagraphSegmentFromJSONTyped(json, false);
1953
+ }
1954
+ function ParagraphSegmentFromJSONTyped(json, ignoreDiscriminator) {
1955
+ if (json == null) return json;
1956
+ return {
1957
+ "type": json["type"],
1958
+ "number": json["number"],
1959
+ "kind": json["kind"] == null ? void 0 : ParagraphKindFromJSON(json["kind"])
1960
+ };
1961
+ }
1962
+ function ParagraphSegmentToJSON(json) {
1963
+ return ParagraphSegmentToJSONTyped(json, false);
1964
+ }
1965
+ function ParagraphSegmentToJSONTyped(value, ignoreDiscriminator = false) {
1966
+ if (value == null) return value;
1967
+ return {
1968
+ "type": value["type"],
1969
+ "number": value["number"],
1970
+ "kind": ParagraphKindToJSON(value["kind"])
1971
+ };
1972
+ }
1973
+
1974
+ //#endregion
1975
+ //#region src/models/Kind.ts
1976
+ function KindFromJSON(json) {
1977
+ return KindFromJSONTyped(json, false);
1978
+ }
1979
+ function KindFromJSONTyped(json, ignoreDiscriminator) {
1980
+ if (json == null) return json;
1981
+ if (typeof json === "string" && json === "custom_show_name") return json;
1982
+ if (typeof json === "string" && json === "core_property") return json;
1983
+ if (typeof json === "string" && json === "alternative_text") return json;
1984
+ if (typeof json === "string" && json === "content_control") return json;
1985
+ if (typeof json === "string" && json === "paragraph") return json;
1986
+ if (typeof json === "string" && json === "field_code") return json;
1987
+ if (typeof json === "string" && json === "chart") return json;
1988
+ if (typeof json === "string" && json === "form_field") return json;
1989
+ if (typeof json === "string" && json === "deleted_text") return json;
1990
+ if (typeof json === "string" && json === "extended_property") return json;
1991
+ if (typeof json === "string" && json === "custom_xml") return json;
1992
+ if (typeof json === "string" && json === "section_name") return json;
1993
+ if (typeof json === "string" && json === "author") return json;
1994
+ if (typeof json === "string" && json === "object_name") return json;
1995
+ if (typeof json === "string" && json === "text") return json;
1996
+ if (typeof json === "string" && json === "hyperlink") return json;
1997
+ if (typeof json === "string" && json === "custom_property") return json;
1998
+ if (typeof json === "string" && json === "table_name") return json;
1999
+ if (typeof json === "string" && json === "document_variable") return json;
2000
+ if (typeof json === "string" && json === "connection") return json;
2001
+ if (typeof json === "string" && json === "formula") return json;
2002
+ if (typeof json === "string" && json === "data_validation") return json;
2003
+ if (typeof json === "string" && json === "attribute") return json;
2004
+ if (typeof json === "string" && json === "sheet_name") return json;
2005
+ if (typeof json === "string" && json === "vml_drawing") return json;
2006
+ if (typeof json === "string" && json === "pivot_cache") return json;
2007
+ if (typeof json === "string" && json === "table_column") return json;
2008
+ return {};
2009
+ }
2010
+ function KindToJSON(json) {
2011
+ return KindToJSONTyped(json, false);
2012
+ }
2013
+ function KindToJSONTyped(value, ignoreDiscriminator = false) {
2014
+ if (value == null) return value;
2015
+ if (typeof value === "string" && value === "custom_show_name") return value;
2016
+ if (typeof value === "string" && value === "core_property") return value;
2017
+ if (typeof value === "string" && value === "alternative_text") return value;
2018
+ if (typeof value === "string" && value === "content_control") return value;
2019
+ if (typeof value === "string" && value === "paragraph") return value;
2020
+ if (typeof value === "string" && value === "field_code") return value;
2021
+ if (typeof value === "string" && value === "chart") return value;
2022
+ if (typeof value === "string" && value === "form_field") return value;
2023
+ if (typeof value === "string" && value === "deleted_text") return value;
2024
+ if (typeof value === "string" && value === "extended_property") return value;
2025
+ if (typeof value === "string" && value === "custom_xml") return value;
2026
+ if (typeof value === "string" && value === "section_name") return value;
2027
+ if (typeof value === "string" && value === "author") return value;
2028
+ if (typeof value === "string" && value === "object_name") return value;
2029
+ if (typeof value === "string" && value === "text") return value;
2030
+ if (typeof value === "string" && value === "hyperlink") return value;
2031
+ if (typeof value === "string" && value === "custom_property") return value;
2032
+ if (typeof value === "string" && value === "table_name") return value;
2033
+ if (typeof value === "string" && value === "document_variable") return value;
2034
+ if (typeof value === "string" && value === "connection") return value;
2035
+ if (typeof value === "string" && value === "formula") return value;
2036
+ if (typeof value === "string" && value === "data_validation") return value;
2037
+ if (typeof value === "string" && value === "attribute") return value;
2038
+ if (typeof value === "string" && value === "sheet_name") return value;
2039
+ if (typeof value === "string" && value === "vml_drawing") return value;
2040
+ if (typeof value === "string" && value === "pivot_cache") return value;
2041
+ if (typeof value === "string" && value === "table_column") return value;
2042
+ return {};
2043
+ }
2044
+
2045
+ //#endregion
2046
+ //#region src/models/PartSegment.ts
2047
+ /**
2048
+ * @export
2049
+ */
2050
+ const PartSegmentTypeEnum = { part: "part" };
2051
+ /**
2052
+ * Check if a given object implements the PartSegment interface.
2053
+ */
2054
+ function instanceOfPartSegment(value) {
2055
+ if (!("type" in value) || value["type"] === void 0) return false;
2056
+ if (!("part" in value) || value["part"] === void 0) return false;
2057
+ return true;
2058
+ }
2059
+ function PartSegmentFromJSON(json) {
2060
+ return PartSegmentFromJSONTyped(json, false);
2061
+ }
2062
+ function PartSegmentFromJSONTyped(json, ignoreDiscriminator) {
2063
+ if (json == null) return json;
2064
+ return {
2065
+ "type": json["type"],
2066
+ "part": json["part"],
2067
+ "kind": json["kind"] == null ? void 0 : KindFromJSON(json["kind"])
2068
+ };
2069
+ }
2070
+ function PartSegmentToJSON(json) {
2071
+ return PartSegmentToJSONTyped(json, false);
2072
+ }
2073
+ function PartSegmentToJSONTyped(value, ignoreDiscriminator = false) {
2074
+ if (value == null) return value;
2075
+ return {
2076
+ "type": value["type"],
2077
+ "part": value["part"],
2078
+ "kind": KindToJSON(value["kind"])
2079
+ };
2080
+ }
2081
+
2082
+ //#endregion
2083
+ //#region src/models/PropertySegment.ts
2084
+ /**
2085
+ * @export
2086
+ */
2087
+ const PropertySegmentTypeEnum = { property: "property" };
2088
+ /**
2089
+ * Check if a given object implements the PropertySegment interface.
2090
+ */
2091
+ function instanceOfPropertySegment(value) {
2092
+ if (!("type" in value) || value["type"] === void 0) return false;
2093
+ if (!("name" in value) || value["name"] === void 0) return false;
2094
+ return true;
2095
+ }
2096
+ function PropertySegmentFromJSON(json) {
2097
+ return PropertySegmentFromJSONTyped(json, false);
2098
+ }
2099
+ function PropertySegmentFromJSONTyped(json, ignoreDiscriminator) {
2100
+ if (json == null) return json;
2101
+ return {
2102
+ "type": json["type"],
2103
+ "name": json["name"]
2104
+ };
2105
+ }
2106
+ function PropertySegmentToJSON(json) {
2107
+ return PropertySegmentToJSONTyped(json, false);
2108
+ }
2109
+ function PropertySegmentToJSONTyped(value, ignoreDiscriminator = false) {
2110
+ if (value == null) return value;
2111
+ return {
2112
+ "type": value["type"],
2113
+ "name": value["name"]
2114
+ };
2115
+ }
2116
+
2117
+ //#endregion
2118
+ //#region src/models/RangeKind.ts
2119
+ /**
2120
+ * Sensitive Data Protection API
2121
+ * Detect and de-identify sensitive data (PII) in text. Use `scan` to locate sensitive entities such as emails, phone numbers, and names, and `anonymize` to transform them using configurable rules (redact, mask, replace, pseudonymize, hash, or encrypt).
2122
+ *
2123
+ * The version of the OpenAPI document: 0.1.0
2124
+ *
2125
+ *
2126
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2127
+ * https://openapi-generator.tech
2128
+ * Do not edit the class manually.
2129
+ */
2130
+ /**
2131
+ * A data validation's prompt, error message or list of values.
2132
+ * @export
2133
+ */
2134
+ const RangeKind = { data_validation: "data_validation" };
2135
+ function instanceOfRangeKind(value) {
2136
+ for (const key in RangeKind) if (Object.prototype.hasOwnProperty.call(RangeKind, key)) {
2137
+ if (RangeKind[key] === value) return true;
2138
+ }
2139
+ return false;
2140
+ }
2141
+ function RangeKindFromJSON(json) {
2142
+ return RangeKindFromJSONTyped(json, false);
2143
+ }
2144
+ function RangeKindFromJSONTyped(json, ignoreDiscriminator) {
2145
+ return json;
2146
+ }
2147
+ function RangeKindToJSON(value) {
2148
+ return value;
2149
+ }
2150
+ function RangeKindToJSONTyped(value, ignoreDiscriminator) {
2151
+ return value;
2152
+ }
2153
+
2154
+ //#endregion
2155
+ //#region src/models/RangeSegment.ts
2156
+ /**
2157
+ * @export
2158
+ */
2159
+ const RangeSegmentTypeEnum = { range: "range" };
2160
+ /**
2161
+ * Check if a given object implements the RangeSegment interface.
2162
+ */
2163
+ function instanceOfRangeSegment(value) {
2164
+ if (!("type" in value) || value["type"] === void 0) return false;
2165
+ if (!("ref" in value) || value["ref"] === void 0) return false;
2166
+ if (!("kind" in value) || value["kind"] === void 0) return false;
2167
+ return true;
2168
+ }
2169
+ function RangeSegmentFromJSON(json) {
2170
+ return RangeSegmentFromJSONTyped(json, false);
2171
+ }
2172
+ function RangeSegmentFromJSONTyped(json, ignoreDiscriminator) {
2173
+ if (json == null) return json;
2174
+ return {
2175
+ "type": json["type"],
2176
+ "ref": json["ref"],
2177
+ "kind": RangeKindFromJSON(json["kind"])
2178
+ };
2179
+ }
2180
+ function RangeSegmentToJSON(json) {
2181
+ return RangeSegmentToJSONTyped(json, false);
2182
+ }
2183
+ function RangeSegmentToJSONTyped(value, ignoreDiscriminator = false) {
2184
+ if (value == null) return value;
2185
+ return {
2186
+ "type": value["type"],
2187
+ "ref": value["ref"],
2188
+ "kind": RangeKindToJSON(value["kind"])
2189
+ };
2190
+ }
2191
+
2192
+ //#endregion
2193
+ //#region src/models/RegionSegment.ts
2194
+ /**
2195
+ * @export
2196
+ */
2197
+ const RegionSegmentTypeEnum = { region: "region" };
2198
+ /**
2199
+ * Check if a given object implements the RegionSegment interface.
2200
+ */
2201
+ function instanceOfRegionSegment(value) {
2202
+ if (!("type" in value) || value["type"] === void 0) return false;
2203
+ if (!("x" in value) || value["x"] === void 0) return false;
2204
+ if (!("y" in value) || value["y"] === void 0) return false;
2205
+ if (!("w" in value) || value["w"] === void 0) return false;
2206
+ if (!("h" in value) || value["h"] === void 0) return false;
2207
+ return true;
2208
+ }
2209
+ function RegionSegmentFromJSON(json) {
2210
+ return RegionSegmentFromJSONTyped(json, false);
2211
+ }
2212
+ function RegionSegmentFromJSONTyped(json, ignoreDiscriminator) {
2213
+ if (json == null) return json;
2214
+ return {
2215
+ "type": json["type"],
2216
+ "x": json["x"],
2217
+ "y": json["y"],
2218
+ "w": json["w"],
2219
+ "h": json["h"]
2220
+ };
2221
+ }
2222
+ function RegionSegmentToJSON(json) {
2223
+ return RegionSegmentToJSONTyped(json, false);
2224
+ }
2225
+ function RegionSegmentToJSONTyped(value, ignoreDiscriminator = false) {
2226
+ if (value == null) return value;
2227
+ return {
2228
+ "type": value["type"],
2229
+ "x": value["x"],
2230
+ "y": value["y"],
2231
+ "w": value["w"],
2232
+ "h": value["h"]
2233
+ };
2234
+ }
2235
+
2236
+ //#endregion
2237
+ //#region src/models/SegmentSegment.ts
2238
+ /**
2239
+ * @export
2240
+ */
2241
+ const SegmentSegmentTypeEnum = { segment: "segment" };
2242
+ /**
2243
+ * Check if a given object implements the SegmentSegment interface.
2244
+ */
2245
+ function instanceOfSegmentSegment(value) {
2246
+ if (!("type" in value) || value["type"] === void 0) return false;
2247
+ if (!("name" in value) || value["name"] === void 0) return false;
2248
+ if (!("index" in value) || value["index"] === void 0) return false;
2249
+ return true;
2250
+ }
2251
+ function SegmentSegmentFromJSON(json) {
2252
+ return SegmentSegmentFromJSONTyped(json, false);
2253
+ }
2254
+ function SegmentSegmentFromJSONTyped(json, ignoreDiscriminator) {
2255
+ if (json == null) return json;
2256
+ return {
2257
+ "type": json["type"],
2258
+ "name": json["name"],
2259
+ "index": json["index"]
2260
+ };
2261
+ }
2262
+ function SegmentSegmentToJSON(json) {
2263
+ return SegmentSegmentToJSONTyped(json, false);
2264
+ }
2265
+ function SegmentSegmentToJSONTyped(value, ignoreDiscriminator = false) {
2266
+ if (value == null) return value;
2267
+ return {
2268
+ "type": value["type"],
2269
+ "name": value["name"],
2270
+ "index": value["index"]
2271
+ };
2272
+ }
2273
+
2274
+ //#endregion
2275
+ //#region src/models/ShapeKind.ts
2276
+ function ShapeKindFromJSON(json) {
2277
+ return ShapeKindFromJSONTyped(json, false);
2278
+ }
2279
+ function ShapeKindFromJSONTyped(json, ignoreDiscriminator) {
2280
+ if (json == null) return json;
2281
+ if (typeof json === "string" && json === "field_code") return json;
2282
+ if (typeof json === "string" && json === "form_field") return json;
2283
+ if (typeof json === "string" && json === "object_name") return json;
2284
+ if (typeof json === "string" && json === "deleted_text") return json;
2285
+ if (typeof json === "string" && json === "hyperlink") return json;
2286
+ if (typeof json === "string" && json === "content_control") return json;
2287
+ if (typeof json === "string" && json === "alternative_text") return json;
2288
+ if (typeof json === "string" && json === "attribute") return json;
2289
+ return {};
2290
+ }
2291
+ function ShapeKindToJSON(json) {
2292
+ return ShapeKindToJSONTyped(json, false);
2293
+ }
2294
+ function ShapeKindToJSONTyped(value, ignoreDiscriminator = false) {
2295
+ if (value == null) return value;
2296
+ if (typeof value === "string" && value === "field_code") return value;
2297
+ if (typeof value === "string" && value === "form_field") return value;
2298
+ if (typeof value === "string" && value === "object_name") return value;
2299
+ if (typeof value === "string" && value === "deleted_text") return value;
2300
+ if (typeof value === "string" && value === "hyperlink") return value;
2301
+ if (typeof value === "string" && value === "content_control") return value;
2302
+ if (typeof value === "string" && value === "alternative_text") return value;
2303
+ if (typeof value === "string" && value === "attribute") return value;
2304
+ return {};
2305
+ }
2306
+
2307
+ //#endregion
2308
+ //#region src/models/ShapeSegment.ts
2309
+ /**
2310
+ * @export
2311
+ */
2312
+ const ShapeSegmentTypeEnum = { shape: "shape" };
2313
+ /**
2314
+ * Check if a given object implements the ShapeSegment interface.
2315
+ */
2316
+ function instanceOfShapeSegment(value) {
2317
+ if (!("type" in value) || value["type"] === void 0) return false;
2318
+ if (!("id" in value) || value["id"] === void 0) return false;
2319
+ if (!("name" in value) || value["name"] === void 0) return false;
2320
+ return true;
2321
+ }
2322
+ function ShapeSegmentFromJSON(json) {
2323
+ return ShapeSegmentFromJSONTyped(json, false);
2324
+ }
2325
+ function ShapeSegmentFromJSONTyped(json, ignoreDiscriminator) {
2326
+ if (json == null) return json;
2327
+ return {
2328
+ "type": json["type"],
2329
+ "id": json["id"],
2330
+ "name": json["name"],
2331
+ "kind": json["kind"] == null ? void 0 : ShapeKindFromJSON(json["kind"])
2332
+ };
2333
+ }
2334
+ function ShapeSegmentToJSON(json) {
2335
+ return ShapeSegmentToJSONTyped(json, false);
2336
+ }
2337
+ function ShapeSegmentToJSONTyped(value, ignoreDiscriminator = false) {
2338
+ if (value == null) return value;
2339
+ return {
2340
+ "type": value["type"],
2341
+ "id": value["id"],
2342
+ "name": value["name"],
2343
+ "kind": ShapeKindToJSON(value["kind"])
2344
+ };
2345
+ }
2346
+
2347
+ //#endregion
2348
+ //#region src/models/SheetSegment.ts
2349
+ /**
2350
+ * @export
2351
+ */
2352
+ const SheetSegmentTypeEnum = { sheet: "sheet" };
2353
+ /**
2354
+ * Check if a given object implements the SheetSegment interface.
2355
+ */
2356
+ function instanceOfSheetSegment(value) {
2357
+ if (!("type" in value) || value["type"] === void 0) return false;
2358
+ if (!("name" in value) || value["name"] === void 0) return false;
2359
+ if (!("part" in value) || value["part"] === void 0) return false;
2360
+ return true;
2361
+ }
2362
+ function SheetSegmentFromJSON(json) {
2363
+ return SheetSegmentFromJSONTyped(json, false);
2364
+ }
2365
+ function SheetSegmentFromJSONTyped(json, ignoreDiscriminator) {
2366
+ if (json == null) return json;
2367
+ return {
2368
+ "type": json["type"],
2369
+ "name": json["name"],
2370
+ "part": json["part"]
2371
+ };
2372
+ }
2373
+ function SheetSegmentToJSON(json) {
2374
+ return SheetSegmentToJSONTyped(json, false);
2375
+ }
2376
+ function SheetSegmentToJSONTyped(value, ignoreDiscriminator = false) {
2377
+ if (value == null) return value;
2378
+ return {
2379
+ "type": value["type"],
2380
+ "name": value["name"],
2381
+ "part": value["part"]
2382
+ };
2383
+ }
2384
+
2385
+ //#endregion
2386
+ //#region src/models/SlideSegment.ts
2387
+ /**
2388
+ * @export
2389
+ */
2390
+ const SlideSegmentTypeEnum = { slide: "slide" };
2391
+ /**
2392
+ * Check if a given object implements the SlideSegment interface.
2393
+ */
2394
+ function instanceOfSlideSegment(value) {
2395
+ if (!("type" in value) || value["type"] === void 0) return false;
2396
+ if (!("number" in value) || value["number"] === void 0) return false;
2397
+ if (!("part" in value) || value["part"] === void 0) return false;
2398
+ return true;
2399
+ }
2400
+ function SlideSegmentFromJSON(json) {
2401
+ return SlideSegmentFromJSONTyped(json, false);
2402
+ }
2403
+ function SlideSegmentFromJSONTyped(json, ignoreDiscriminator) {
2404
+ if (json == null) return json;
2405
+ return {
2406
+ "type": json["type"],
2407
+ "number": json["number"],
2408
+ "part": json["part"],
2409
+ "kind": json["kind"] == null ? void 0 : KindFromJSON(json["kind"])
2410
+ };
2411
+ }
2412
+ function SlideSegmentToJSON(json) {
2413
+ return SlideSegmentToJSONTyped(json, false);
2414
+ }
2415
+ function SlideSegmentToJSONTyped(value, ignoreDiscriminator = false) {
2416
+ if (value == null) return value;
2417
+ return {
2418
+ "type": value["type"],
2419
+ "number": value["number"],
2420
+ "part": value["part"],
2421
+ "kind": KindToJSON(value["kind"])
2422
+ };
2423
+ }
2424
+
2425
+ //#endregion
2426
+ //#region src/models/SpeakerNotesSegment.ts
2427
+ /**
2428
+ * @export
2429
+ */
2430
+ const SpeakerNotesSegmentTypeEnum = { speaker_notes: "speaker_notes" };
2431
+ /**
2432
+ * Check if a given object implements the SpeakerNotesSegment interface.
2433
+ */
2434
+ function instanceOfSpeakerNotesSegment(value) {
2435
+ if (!("type" in value) || value["type"] === void 0) return false;
2436
+ if (!("slide" in value) || value["slide"] === void 0) return false;
2437
+ if (!("part" in value) || value["part"] === void 0) return false;
2438
+ return true;
2439
+ }
2440
+ function SpeakerNotesSegmentFromJSON(json) {
2441
+ return SpeakerNotesSegmentFromJSONTyped(json, false);
2442
+ }
2443
+ function SpeakerNotesSegmentFromJSONTyped(json, ignoreDiscriminator) {
2444
+ if (json == null) return json;
2445
+ return {
2446
+ "type": json["type"],
2447
+ "slide": json["slide"],
2448
+ "part": json["part"],
2449
+ "kind": json["kind"] == null ? void 0 : KindFromJSON(json["kind"])
2450
+ };
2451
+ }
2452
+ function SpeakerNotesSegmentToJSON(json) {
2453
+ return SpeakerNotesSegmentToJSONTyped(json, false);
2454
+ }
2455
+ function SpeakerNotesSegmentToJSONTyped(value, ignoreDiscriminator = false) {
2456
+ if (value == null) return value;
2457
+ return {
2458
+ "type": value["type"],
2459
+ "slide": value["slide"],
2460
+ "part": value["part"],
2461
+ "kind": KindToJSON(value["kind"])
2462
+ };
2463
+ }
2464
+
2465
+ //#endregion
2466
+ //#region src/models/TableSegment.ts
2467
+ /**
2468
+ * @export
2469
+ */
2470
+ const TableSegmentTypeEnum = { table: "table" };
2471
+ /**
2472
+ * Check if a given object implements the TableSegment interface.
2473
+ */
2474
+ function instanceOfTableSegment(value) {
2475
+ if (!("type" in value) || value["type"] === void 0) return false;
2476
+ if (!("number" in value) || value["number"] === void 0) return false;
2477
+ return true;
2478
+ }
2479
+ function TableSegmentFromJSON(json) {
2480
+ return TableSegmentFromJSONTyped(json, false);
2481
+ }
2482
+ function TableSegmentFromJSONTyped(json, ignoreDiscriminator) {
2483
+ if (json == null) return json;
2484
+ return {
2485
+ "type": json["type"],
2486
+ "number": json["number"]
2487
+ };
2488
+ }
2489
+ function TableSegmentToJSON(json) {
2490
+ return TableSegmentToJSONTyped(json, false);
2491
+ }
2492
+ function TableSegmentToJSONTyped(value, ignoreDiscriminator = false) {
2493
+ if (value == null) return value;
2494
+ return {
2495
+ "type": value["type"],
2496
+ "number": value["number"]
2497
+ };
2498
+ }
2499
+
2500
+ //#endregion
2501
+ //#region src/models/TagSegment.ts
2502
+ /**
2503
+ * @export
2504
+ */
2505
+ const TagSegmentTypeEnum = { tag: "tag" };
2506
+ /**
2507
+ * Check if a given object implements the TagSegment interface.
2508
+ */
2509
+ function instanceOfTagSegment(value) {
2510
+ if (!("type" in value) || value["type"] === void 0) return false;
2511
+ if (!("group" in value) || value["group"] === void 0) return false;
2512
+ if (!("element" in value) || value["element"] === void 0) return false;
2513
+ return true;
2514
+ }
2515
+ function TagSegmentFromJSON(json) {
2516
+ return TagSegmentFromJSONTyped(json, false);
2517
+ }
2518
+ function TagSegmentFromJSONTyped(json, ignoreDiscriminator) {
2519
+ if (json == null) return json;
2520
+ return {
2521
+ "type": json["type"],
2522
+ "group": json["group"],
2523
+ "element": json["element"],
2524
+ "keyword": json["keyword"] == null ? void 0 : json["keyword"]
2525
+ };
2526
+ }
2527
+ function TagSegmentToJSON(json) {
2528
+ return TagSegmentToJSONTyped(json, false);
2529
+ }
2530
+ function TagSegmentToJSONTyped(value, ignoreDiscriminator = false) {
2531
+ if (value == null) return value;
2532
+ return {
2533
+ "type": value["type"],
2534
+ "group": value["group"],
2535
+ "element": value["element"],
2536
+ "keyword": value["keyword"]
2537
+ };
2538
+ }
2539
+
2540
+ //#endregion
2541
+ //#region src/models/TextSegment.ts
2542
+ /**
2543
+ * @export
2544
+ */
2545
+ const TextSegmentTypeEnum = { text: "text" };
2546
+ /**
2547
+ * Check if a given object implements the TextSegment interface.
2548
+ */
2549
+ function instanceOfTextSegment(value) {
2550
+ if (!("type" in value) || value["type"] === void 0) return false;
2551
+ if (!("input" in value) || value["input"] === void 0) return false;
2552
+ if (!("output" in value) || value["output"] === void 0) return false;
2553
+ return true;
2554
+ }
2555
+ function TextSegmentFromJSON(json) {
2556
+ return TextSegmentFromJSONTyped(json, false);
2557
+ }
2558
+ function TextSegmentFromJSONTyped(json, ignoreDiscriminator) {
2559
+ if (json == null) return json;
2560
+ return {
2561
+ "type": json["type"],
2562
+ "input": TextRangeFromJSON(json["input"]),
2563
+ "output": TextRangeFromJSON(json["output"])
2564
+ };
2565
+ }
2566
+ function TextSegmentToJSON(json) {
2567
+ return TextSegmentToJSONTyped(json, false);
2568
+ }
2569
+ function TextSegmentToJSONTyped(value, ignoreDiscriminator = false) {
2570
+ if (value == null) return value;
2571
+ return {
2572
+ "type": value["type"],
2573
+ "input": TextRangeToJSON(value["input"]),
2574
+ "output": TextRangeToJSON(value["output"])
2575
+ };
2576
+ }
2577
+
2578
+ //#endregion
2579
+ //#region src/models/PathSegment.ts
2580
+ function PathSegmentFromJSON(json) {
2581
+ return PathSegmentFromJSONTyped(json, false);
2582
+ }
2583
+ function PathSegmentFromJSONTyped(json, ignoreDiscriminator) {
2584
+ if (json == null) return json;
2585
+ switch (json["type"]) {
2586
+ case "attribute": return Object.assign({}, AttributeSegmentFromJSONTyped(json, true), { type: "attribute" });
2587
+ case "cell": return Object.assign({}, CellSegmentFromJSONTyped(json, true), { type: "cell" });
2588
+ case "cell_note": return Object.assign({}, CellNoteSegmentFromJSONTyped(json, true), { type: "cell_note" });
2589
+ case "comment": return Object.assign({}, CommentSegmentFromJSONTyped(json, true), { type: "comment" });
2590
+ case "component": return Object.assign({}, ComponentSegmentFromJSONTyped(json, true), { type: "component" });
2591
+ case "element": return Object.assign({}, ElementSegmentFromJSONTyped(json, true), { type: "element" });
2592
+ case "endnote": return Object.assign({}, EndnoteSegmentFromJSONTyped(json, true), { type: "endnote" });
2593
+ case "field": return Object.assign({}, FieldSegmentFromJSONTyped(json, true), { type: "field" });
2594
+ case "footnote": return Object.assign({}, FootnoteSegmentFromJSONTyped(json, true), { type: "footnote" });
2595
+ case "frame": return Object.assign({}, FrameSegmentFromJSONTyped(json, true), { type: "frame" });
2596
+ case "header_footer": return Object.assign({}, HeaderFooterSegmentFromJSONTyped(json, true), { type: "header_footer" });
2597
+ case "index": return Object.assign({}, IndexSegmentFromJSONTyped(json, true), { type: "index" });
2598
+ case "item": return Object.assign({}, ItemSegmentFromJSONTyped(json, true), { type: "item" });
2599
+ case "key": return Object.assign({}, KeySegmentFromJSONTyped(json, true), { type: "key" });
2600
+ case "line": return Object.assign({}, LineSegmentFromJSONTyped(json, true), { type: "line" });
2601
+ case "paragraph": return Object.assign({}, ParagraphSegmentFromJSONTyped(json, true), { type: "paragraph" });
2602
+ case "part": return Object.assign({}, PartSegmentFromJSONTyped(json, true), { type: "part" });
2603
+ case "property": return Object.assign({}, PropertySegmentFromJSONTyped(json, true), { type: "property" });
2604
+ case "range": return Object.assign({}, RangeSegmentFromJSONTyped(json, true), { type: "range" });
2605
+ case "region": return Object.assign({}, RegionSegmentFromJSONTyped(json, true), { type: "region" });
2606
+ case "segment": return Object.assign({}, SegmentSegmentFromJSONTyped(json, true), { type: "segment" });
2607
+ case "shape": return Object.assign({}, ShapeSegmentFromJSONTyped(json, true), { type: "shape" });
2608
+ case "sheet": return Object.assign({}, SheetSegmentFromJSONTyped(json, true), { type: "sheet" });
2609
+ case "slide": return Object.assign({}, SlideSegmentFromJSONTyped(json, true), { type: "slide" });
2610
+ case "speaker_notes": return Object.assign({}, SpeakerNotesSegmentFromJSONTyped(json, true), { type: "speaker_notes" });
2611
+ case "table": return Object.assign({}, TableSegmentFromJSONTyped(json, true), { type: "table" });
2612
+ case "tag": return Object.assign({}, TagSegmentFromJSONTyped(json, true), { type: "tag" });
2613
+ case "text": return Object.assign({}, TextSegmentFromJSONTyped(json, true), { type: "text" });
2614
+ default: return json;
2615
+ }
2616
+ }
2617
+ function PathSegmentToJSON(json) {
2618
+ return PathSegmentToJSONTyped(json, false);
2619
+ }
2620
+ function PathSegmentToJSONTyped(value, ignoreDiscriminator = false) {
2621
+ if (value == null) return value;
2622
+ switch (value["type"]) {
2623
+ case "attribute": return Object.assign({}, AttributeSegmentToJSON(value), { type: "attribute" });
2624
+ case "cell": return Object.assign({}, CellSegmentToJSON(value), { type: "cell" });
2625
+ case "cell_note": return Object.assign({}, CellNoteSegmentToJSON(value), { type: "cell_note" });
2626
+ case "comment": return Object.assign({}, CommentSegmentToJSON(value), { type: "comment" });
2627
+ case "component": return Object.assign({}, ComponentSegmentToJSON(value), { type: "component" });
2628
+ case "element": return Object.assign({}, ElementSegmentToJSON(value), { type: "element" });
2629
+ case "endnote": return Object.assign({}, EndnoteSegmentToJSON(value), { type: "endnote" });
2630
+ case "field": return Object.assign({}, FieldSegmentToJSON(value), { type: "field" });
2631
+ case "footnote": return Object.assign({}, FootnoteSegmentToJSON(value), { type: "footnote" });
2632
+ case "frame": return Object.assign({}, FrameSegmentToJSON(value), { type: "frame" });
2633
+ case "header_footer": return Object.assign({}, HeaderFooterSegmentToJSON(value), { type: "header_footer" });
2634
+ case "index": return Object.assign({}, IndexSegmentToJSON(value), { type: "index" });
2635
+ case "item": return Object.assign({}, ItemSegmentToJSON(value), { type: "item" });
2636
+ case "key": return Object.assign({}, KeySegmentToJSON(value), { type: "key" });
2637
+ case "line": return Object.assign({}, LineSegmentToJSON(value), { type: "line" });
2638
+ case "paragraph": return Object.assign({}, ParagraphSegmentToJSON(value), { type: "paragraph" });
2639
+ case "part": return Object.assign({}, PartSegmentToJSON(value), { type: "part" });
2640
+ case "property": return Object.assign({}, PropertySegmentToJSON(value), { type: "property" });
2641
+ case "range": return Object.assign({}, RangeSegmentToJSON(value), { type: "range" });
2642
+ case "region": return Object.assign({}, RegionSegmentToJSON(value), { type: "region" });
2643
+ case "segment": return Object.assign({}, SegmentSegmentToJSON(value), { type: "segment" });
2644
+ case "shape": return Object.assign({}, ShapeSegmentToJSON(value), { type: "shape" });
2645
+ case "sheet": return Object.assign({}, SheetSegmentToJSON(value), { type: "sheet" });
2646
+ case "slide": return Object.assign({}, SlideSegmentToJSON(value), { type: "slide" });
2647
+ case "speaker_notes": return Object.assign({}, SpeakerNotesSegmentToJSON(value), { type: "speaker_notes" });
2648
+ case "table": return Object.assign({}, TableSegmentToJSON(value), { type: "table" });
2649
+ case "tag": return Object.assign({}, TagSegmentToJSON(value), { type: "tag" });
2650
+ case "text": return Object.assign({}, TextSegmentToJSON(value), { type: "text" });
2651
+ default: return value;
2652
+ }
2653
+ }
2654
+
2655
+ //#endregion
2656
+ //#region src/models/At.ts
2657
+ /**
2658
+ * Check if a given object implements the At interface.
2659
+ */
2660
+ function instanceOfAt(value) {
2661
+ if (!("path" in value) || value["path"] === void 0) return false;
2662
+ if (!("text" in value) || value["text"] === void 0) return false;
2663
+ return true;
2664
+ }
2665
+ function AtFromJSON(json) {
2666
+ return AtFromJSONTyped(json, false);
2667
+ }
2668
+ function AtFromJSONTyped(json, ignoreDiscriminator) {
2669
+ if (json == null) return json;
2670
+ return {
2671
+ "path": json["path"].map(PathSegmentFromJSON),
2672
+ "text": json["text"]
2673
+ };
2674
+ }
2675
+ function AtToJSON(json) {
2676
+ return AtToJSONTyped(json, false);
2677
+ }
2678
+ function AtToJSONTyped(value, ignoreDiscriminator = false) {
2679
+ if (value == null) return value;
2680
+ return {
2681
+ "path": value["path"].map(PathSegmentToJSON),
2682
+ "text": value["text"]
2683
+ };
2684
+ }
2685
+
2686
+ //#endregion
2687
+ //#region src/models/PolicyDocumentRulesInner.ts
2688
+ function PolicyDocumentRulesInnerFromJSON(json) {
2689
+ return PolicyDocumentRulesInnerFromJSONTyped(json, false);
2690
+ }
2691
+ function PolicyDocumentRulesInnerFromJSONTyped(json, ignoreDiscriminator) {
2692
+ if (json == null) return json;
2693
+ switch (json["type"]) {
2694
+ case "detect": return Object.assign({}, DetectRuleFromJSONTyped(json, true), { type: "detect" });
2695
+ case "encrypt": return Object.assign({}, EncryptRuleFromJSONTyped(json, true), { type: "encrypt" });
2696
+ case "hmac": return Object.assign({}, HMACRuleFromJSONTyped(json, true), { type: "hmac" });
2697
+ case "mask": return Object.assign({}, MaskRuleFromJSONTyped(json, true), { type: "mask" });
2698
+ case "pseudonymize": return Object.assign({}, PseudonymizeRuleFromJSONTyped(json, true), { type: "pseudonymize" });
2699
+ case "redact": return Object.assign({}, RedactRuleFromJSONTyped(json, true), { type: "redact" });
2700
+ case "replace": return Object.assign({}, ReplaceRuleFromJSONTyped(json, true), { type: "replace" });
2701
+ case "sha256": return Object.assign({}, SHA256RuleFromJSONTyped(json, true), { type: "sha256" });
2702
+ case "sha512": return Object.assign({}, SHA512RuleFromJSONTyped(json, true), { type: "sha512" });
2703
+ default: return json;
2704
+ }
2705
+ }
2706
+ function PolicyDocumentRulesInnerToJSON(json) {
2707
+ return PolicyDocumentRulesInnerToJSONTyped(json, false);
2708
+ }
2709
+ function PolicyDocumentRulesInnerToJSONTyped(value, ignoreDiscriminator = false) {
2710
+ if (value == null) return value;
2711
+ switch (value["type"]) {
2712
+ case "detect": return Object.assign({}, DetectRuleToJSON(value), { type: "detect" });
2713
+ case "encrypt": return Object.assign({}, EncryptRuleToJSON(value), { type: "encrypt" });
2714
+ case "hmac": return Object.assign({}, HMACRuleToJSON(value), { type: "hmac" });
2715
+ case "mask": return Object.assign({}, MaskRuleToJSON(value), { type: "mask" });
2716
+ case "pseudonymize": return Object.assign({}, PseudonymizeRuleToJSON(value), { type: "pseudonymize" });
2717
+ case "redact": return Object.assign({}, RedactRuleToJSON(value), { type: "redact" });
2718
+ case "replace": return Object.assign({}, ReplaceRuleToJSON(value), { type: "replace" });
2719
+ case "sha256": return Object.assign({}, SHA256RuleToJSON(value), { type: "sha256" });
2720
+ case "sha512": return Object.assign({}, SHA512RuleToJSON(value), { type: "sha512" });
2721
+ default: return value;
2722
+ }
2723
+ }
2724
+
2725
+ //#endregion
2726
+ //#region src/models/PolicyDocument.ts
2727
+ /**
2728
+ * @export
2729
+ */
2730
+ const PolicyDocumentSchemaVersionEnum = { NUMBER_1: 1 };
2731
+ /**
2732
+ * Check if a given object implements the PolicyDocument interface.
2733
+ */
2734
+ function instanceOfPolicyDocument(value) {
2735
+ if (!("schema_version" in value) || value["schema_version"] === void 0) return false;
2736
+ if (!("rules" in value) || value["rules"] === void 0) return false;
2737
+ return true;
2738
+ }
2739
+ function PolicyDocumentFromJSON(json) {
2740
+ return PolicyDocumentFromJSONTyped(json, false);
2741
+ }
2742
+ function PolicyDocumentFromJSONTyped(json, ignoreDiscriminator) {
2743
+ if (json == null) return json;
2744
+ return {
2745
+ "schema_version": json["schema_version"],
2746
+ "name": json["name"] == null ? void 0 : json["name"],
2747
+ "confidence_threshold": json["confidence_threshold"] == null ? void 0 : json["confidence_threshold"],
2748
+ "rules": json["rules"].map(PolicyDocumentRulesInnerFromJSON)
2749
+ };
2750
+ }
2751
+ function PolicyDocumentToJSON(json) {
2752
+ return PolicyDocumentToJSONTyped(json, false);
2753
+ }
2754
+ function PolicyDocumentToJSONTyped(value, ignoreDiscriminator = false) {
2755
+ if (value == null) return value;
2756
+ return {
2757
+ "schema_version": value["schema_version"],
2758
+ "name": value["name"],
2759
+ "confidence_threshold": value["confidence_threshold"],
2760
+ "rules": value["rules"].map(PolicyDocumentRulesInnerToJSON)
2761
+ };
2762
+ }
2763
+
2764
+ //#endregion
2765
+ //#region src/models/CreatePolicyRequest.ts
2766
+ /**
2767
+ * Check if a given object implements the CreatePolicyRequest interface.
2768
+ */
2769
+ function instanceOfCreatePolicyRequest(value) {
2770
+ if (!("name" in value) || value["name"] === void 0) return false;
2771
+ if (!("document" in value) || value["document"] === void 0) return false;
2772
+ return true;
2773
+ }
2774
+ function CreatePolicyRequestFromJSON(json) {
2775
+ return CreatePolicyRequestFromJSONTyped(json, false);
2776
+ }
2777
+ function CreatePolicyRequestFromJSONTyped(json, ignoreDiscriminator) {
2778
+ if (json == null) return json;
2779
+ return {
2780
+ "name": json["name"],
2781
+ "document": PolicyDocumentFromJSON(json["document"])
2782
+ };
2783
+ }
2784
+ function CreatePolicyRequestToJSON(json) {
2785
+ return CreatePolicyRequestToJSONTyped(json, false);
2786
+ }
2787
+ function CreatePolicyRequestToJSONTyped(value, ignoreDiscriminator = false) {
2788
+ if (value == null) return value;
2789
+ return {
2790
+ "name": value["name"],
2791
+ "document": PolicyDocumentToJSON(value["document"])
2792
+ };
2793
+ }
2794
+
2795
+ //#endregion
2796
+ //#region src/models/ErrorCode.ts
2797
+ /**
2798
+ * Sensitive Data Protection API
2799
+ * Detect and de-identify sensitive data (PII) in text. Use `scan` to locate sensitive entities such as emails, phone numbers, and names, and `anonymize` to transform them using configurable rules (redact, mask, replace, pseudonymize, hash, or encrypt).
2800
+ *
2801
+ * The version of the OpenAPI document: 0.1.0
2802
+ *
2803
+ *
2804
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2805
+ * https://openapi-generator.tech
2806
+ * Do not edit the class manually.
2807
+ */
2808
+ /**
2809
+ * What went wrong, for callers to branch on. `invalid_json` (400): the body
2810
+ * is not JSON. `invalid_request` (422): some fields are invalid, `details`
2811
+ * says which. `unauthorized` (401), `not_found` (404), `method_not_allowed`
2812
+ * (405). `internal` (500): the request failed; retrying may help.
2813
+ * `unavailable` (503): the model is not loaded.
2814
+ * `forbidden` (403): the caller's assigned policy sets the rules or threshold. `policy_unreadable` (409): that policy cannot be read.
2815
+ * @export
2816
+ */
2817
+ const ErrorCode = {
2818
+ invalid_json: "invalid_json",
2819
+ invalid_request: "invalid_request",
2820
+ unauthorized: "unauthorized",
2821
+ not_found: "not_found",
2822
+ method_not_allowed: "method_not_allowed",
2823
+ internal: "internal",
2824
+ unavailable: "unavailable",
2825
+ forbidden: "forbidden",
2826
+ policy_unreadable: "policy_unreadable"
2827
+ };
2828
+ function instanceOfErrorCode(value) {
2829
+ for (const key in ErrorCode) if (Object.prototype.hasOwnProperty.call(ErrorCode, key)) {
2830
+ if (ErrorCode[key] === value) return true;
2831
+ }
2832
+ return false;
2833
+ }
2834
+ function ErrorCodeFromJSON(json) {
2835
+ return ErrorCodeFromJSONTyped(json, false);
2836
+ }
2837
+ function ErrorCodeFromJSONTyped(json, ignoreDiscriminator) {
2838
+ return json;
2839
+ }
2840
+ function ErrorCodeToJSON(value) {
2841
+ return value;
2842
+ }
2843
+ function ErrorCodeToJSONTyped(value, ignoreDiscriminator) {
2844
+ return value;
2845
+ }
2846
+
2847
+ //#endregion
2848
+ //#region src/models/FieldErrorPathInner.ts
2849
+ /**
2850
+ * Check if a given object implements the FieldErrorPathInner interface.
2851
+ */
2852
+ function instanceOfFieldErrorPathInner(value) {
2853
+ return true;
2854
+ }
2855
+ function FieldErrorPathInnerFromJSON(json) {
2856
+ return FieldErrorPathInnerFromJSONTyped(json, false);
2857
+ }
2858
+ function FieldErrorPathInnerFromJSONTyped(json, ignoreDiscriminator) {
2859
+ return json;
2860
+ }
2861
+ function FieldErrorPathInnerToJSON(json) {
2862
+ return FieldErrorPathInnerToJSONTyped(json, false);
2863
+ }
2864
+ function FieldErrorPathInnerToJSONTyped(value, ignoreDiscriminator = false) {
2865
+ return value;
2866
+ }
2867
+
2868
+ //#endregion
2869
+ //#region src/models/FieldErrorCode.ts
2870
+ /**
2871
+ * Sensitive Data Protection API
2872
+ * Detect and de-identify sensitive data (PII) in text. Use `scan` to locate sensitive entities such as emails, phone numbers, and names, and `anonymize` to transform them using configurable rules (redact, mask, replace, pseudonymize, hash, or encrypt).
2873
+ *
2874
+ * The version of the OpenAPI document: 0.1.0
2875
+ *
2876
+ *
2877
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2878
+ * https://openapi-generator.tech
2879
+ * Do not edit the class manually.
2880
+ */
2881
+ /**
2882
+ * Why one field was refused. `missing`; `wrong_type` (see `expected`);
2883
+ * `too_short`/`too_long` in characters and `too_large` in UTF-8 bytes (see
2884
+ * `limit`); `too_few`/`too_many` items (see `limit`); `out_of_range` (see
2885
+ * `min`, `max`); `blank`: only whitespace; `unknown_type` (see `allowed`);
2886
+ * `invalid_pattern`: not a regular expression the engine runs;
2887
+ * `invalid_key`: not a Fernet key; `labels_over_budget`: the labels leave
2888
+ * the model too little room for text (see `tokens`, `limit`).
2889
+ * @export
2890
+ */
2891
+ const FieldErrorCode = {
2892
+ missing: "missing",
2893
+ wrong_type: "wrong_type",
2894
+ too_short: "too_short",
2895
+ too_long: "too_long",
2896
+ too_large: "too_large",
2897
+ too_few: "too_few",
2898
+ too_many: "too_many",
2899
+ out_of_range: "out_of_range",
2900
+ blank: "blank",
2901
+ unknown_type: "unknown_type",
2902
+ invalid_pattern: "invalid_pattern",
2903
+ invalid_key: "invalid_key",
2904
+ labels_over_budget: "labels_over_budget"
2905
+ };
2906
+ function instanceOfFieldErrorCode(value) {
2907
+ for (const key in FieldErrorCode) if (Object.prototype.hasOwnProperty.call(FieldErrorCode, key)) {
2908
+ if (FieldErrorCode[key] === value) return true;
2909
+ }
2910
+ return false;
2911
+ }
2912
+ function FieldErrorCodeFromJSON(json) {
2913
+ return FieldErrorCodeFromJSONTyped(json, false);
2914
+ }
2915
+ function FieldErrorCodeFromJSONTyped(json, ignoreDiscriminator) {
2916
+ return json;
2917
+ }
2918
+ function FieldErrorCodeToJSON(value) {
2919
+ return value;
2920
+ }
2921
+ function FieldErrorCodeToJSONTyped(value, ignoreDiscriminator) {
2922
+ return value;
2923
+ }
2924
+
2925
+ //#endregion
2926
+ //#region src/models/FieldError.ts
2927
+ /**
2928
+ * Check if a given object implements the FieldError interface.
920
2929
  */
921
- function instanceOfModelEntity(value) {
922
- if (!("value" in value) || value["value"] === void 0) return false;
2930
+ function instanceOfFieldError(value) {
2931
+ if (!("path" in value) || value["path"] === void 0) return false;
2932
+ if (!("code" in value) || value["code"] === void 0) return false;
2933
+ if (!("message" in value) || value["message"] === void 0) return false;
923
2934
  return true;
924
2935
  }
925
- function ModelEntityFromJSON(json) {
926
- return ModelEntityFromJSONTyped(json, false);
2936
+ function FieldErrorFromJSON(json) {
2937
+ return FieldErrorFromJSONTyped(json, false);
927
2938
  }
928
- function ModelEntityFromJSONTyped(json, ignoreDiscriminator) {
2939
+ function FieldErrorFromJSONTyped(json, ignoreDiscriminator) {
929
2940
  if (json == null) return json;
930
2941
  return {
931
- "type": json["type"] == null ? void 0 : json["type"],
932
- "value": json["value"]
2942
+ "path": json["path"].map(FieldErrorPathInnerFromJSON),
2943
+ "code": FieldErrorCodeFromJSON(json["code"]),
2944
+ "message": json["message"],
2945
+ "limit": json["limit"] == null ? void 0 : json["limit"],
2946
+ "min": json["min"] == null ? void 0 : json["min"],
2947
+ "max": json["max"] == null ? void 0 : json["max"],
2948
+ "expected": json["expected"] == null ? void 0 : json["expected"],
2949
+ "allowed": json["allowed"] == null ? void 0 : json["allowed"],
2950
+ "tokens": json["tokens"] == null ? void 0 : json["tokens"]
933
2951
  };
934
2952
  }
935
- function ModelEntityToJSON(json) {
936
- return ModelEntityToJSONTyped(json, false);
2953
+ function FieldErrorToJSON(json) {
2954
+ return FieldErrorToJSONTyped(json, false);
937
2955
  }
938
- function ModelEntityToJSONTyped(value, ignoreDiscriminator = false) {
2956
+ function FieldErrorToJSONTyped(value, ignoreDiscriminator = false) {
939
2957
  if (value == null) return value;
940
2958
  return {
941
- "type": value["type"],
942
- "value": value["value"]
2959
+ "path": value["path"].map(FieldErrorPathInnerToJSON),
2960
+ "code": FieldErrorCodeToJSON(value["code"]),
2961
+ "message": value["message"],
2962
+ "limit": value["limit"],
2963
+ "min": value["min"],
2964
+ "max": value["max"],
2965
+ "expected": value["expected"],
2966
+ "allowed": value["allowed"],
2967
+ "tokens": value["tokens"]
943
2968
  };
944
2969
  }
945
2970
 
946
2971
  //#endregion
947
- //#region src/models/ModelResult.ts
948
- /**
949
- * @export
950
- */
951
- const ModelResultTypeEnum = { model: "model" };
2972
+ //#region src/models/ErrorInfo.ts
952
2973
  /**
953
- * Check if a given object implements the ModelResult interface.
2974
+ * Check if a given object implements the ErrorInfo interface.
954
2975
  */
955
- function instanceOfModelResult(value) {
956
- if (!("rule" in value) || value["rule"] === void 0) return false;
957
- if (!("value" in value) || value["value"] === void 0) return false;
958
- if (!("input" in value) || value["input"] === void 0) return false;
959
- if (!("output" in value) || value["output"] === void 0) return false;
2976
+ function instanceOfErrorInfo(value) {
2977
+ if (!("code" in value) || value["code"] === void 0) return false;
2978
+ if (!("message" in value) || value["message"] === void 0) return false;
960
2979
  return true;
961
2980
  }
962
- function ModelResultFromJSON(json) {
963
- return ModelResultFromJSONTyped(json, false);
2981
+ function ErrorInfoFromJSON(json) {
2982
+ return ErrorInfoFromJSONTyped(json, false);
964
2983
  }
965
- function ModelResultFromJSONTyped(json, ignoreDiscriminator) {
2984
+ function ErrorInfoFromJSONTyped(json, ignoreDiscriminator) {
966
2985
  if (json == null) return json;
967
2986
  return {
968
- "type": json["type"] == null ? void 0 : json["type"],
969
- "rule": json["rule"],
970
- "value": json["value"],
971
- "input": TextRangeFromJSON(json["input"]),
972
- "output": TextRangeFromJSON(json["output"]),
973
- "score": json["score"] == null ? void 0 : json["score"]
2987
+ "code": ErrorCodeFromJSON(json["code"]),
2988
+ "message": json["message"],
2989
+ "details": json["details"] == null ? void 0 : json["details"].map(FieldErrorFromJSON)
974
2990
  };
975
2991
  }
976
- function ModelResultToJSON(json) {
977
- return ModelResultToJSONTyped(json, false);
2992
+ function ErrorInfoToJSON(json) {
2993
+ return ErrorInfoToJSONTyped(json, false);
978
2994
  }
979
- function ModelResultToJSONTyped(value, ignoreDiscriminator = false) {
2995
+ function ErrorInfoToJSONTyped(value, ignoreDiscriminator = false) {
980
2996
  if (value == null) return value;
981
2997
  return {
982
- "type": value["type"],
983
- "rule": value["rule"],
984
- "value": value["value"],
985
- "input": TextRangeToJSON(value["input"]),
986
- "output": TextRangeToJSON(value["output"]),
987
- "score": value["score"]
2998
+ "code": ErrorCodeToJSON(value["code"]),
2999
+ "message": value["message"],
3000
+ "details": value["details"] == null ? void 0 : value["details"].map(FieldErrorToJSON)
988
3001
  };
989
3002
  }
990
3003
 
991
3004
  //#endregion
992
- //#region src/models/Policy.ts
3005
+ //#region src/models/PolicySummary.ts
993
3006
  /**
994
- * Check if a given object implements the Policy interface.
3007
+ * Check if a given object implements the PolicySummary interface.
995
3008
  */
996
- function instanceOfPolicy(value) {
3009
+ function instanceOfPolicySummary(value) {
997
3010
  if (!("id" in value) || value["id"] === void 0) return false;
998
3011
  if (!("name" in value) || value["name"] === void 0) return false;
999
3012
  if (!("versionId" in value) || value["versionId"] === void 0) return false;
1000
- if (!("document" in value) || value["document"] === void 0) return false;
1001
3013
  if (!("createdAt" in value) || value["createdAt"] === void 0) return false;
1002
3014
  if (!("updatedAt" in value) || value["updatedAt"] === void 0) return false;
1003
3015
  return true;
1004
3016
  }
1005
- function PolicyFromJSON(json) {
1006
- return PolicyFromJSONTyped(json, false);
3017
+ function PolicySummaryFromJSON(json) {
3018
+ return PolicySummaryFromJSONTyped(json, false);
1007
3019
  }
1008
- function PolicyFromJSONTyped(json, ignoreDiscriminator) {
3020
+ function PolicySummaryFromJSONTyped(json, ignoreDiscriminator) {
1009
3021
  if (json == null) return json;
1010
3022
  return {
1011
3023
  "id": json["id"],
1012
3024
  "name": json["name"],
1013
3025
  "versionId": json["versionId"],
1014
- "document": PolicyDocumentFromJSON(json["document"]),
1015
3026
  "createdAt": json["createdAt"],
1016
3027
  "updatedAt": json["updatedAt"]
1017
3028
  };
1018
3029
  }
1019
- function PolicyToJSON(json) {
1020
- return PolicyToJSONTyped(json, false);
3030
+ function PolicySummaryToJSON(json) {
3031
+ return PolicySummaryToJSONTyped(json, false);
1021
3032
  }
1022
- function PolicyToJSONTyped(value, ignoreDiscriminator = false) {
3033
+ function PolicySummaryToJSONTyped(value, ignoreDiscriminator = false) {
1023
3034
  if (value == null) return value;
1024
3035
  return {
1025
3036
  "id": value["id"],
1026
3037
  "name": value["name"],
1027
3038
  "versionId": value["versionId"],
1028
- "document": PolicyDocumentToJSON(value["document"]),
1029
3039
  "createdAt": value["createdAt"],
1030
3040
  "updatedAt": value["updatedAt"]
1031
3041
  };
1032
3042
  }
1033
3043
 
1034
3044
  //#endregion
1035
- //#region src/models/RedactRule.ts
1036
- /**
1037
- * @export
1038
- */
1039
- const RedactRuleTypeEnum = { redact: "redact" };
3045
+ //#region src/models/ListPolicies200Response.ts
1040
3046
  /**
1041
- * Check if a given object implements the RedactRule interface.
3047
+ * Check if a given object implements the ListPolicies200Response interface.
1042
3048
  */
1043
- function instanceOfRedactRule(value) {
1044
- if (!("entities" in value) || value["entities"] === void 0) return false;
3049
+ function instanceOfListPolicies200Response(value) {
3050
+ if (!("policies" in value) || value["policies"] === void 0) return false;
1045
3051
  return true;
1046
3052
  }
1047
- function RedactRuleFromJSON(json) {
1048
- return RedactRuleFromJSONTyped(json, false);
3053
+ function ListPolicies200ResponseFromJSON(json) {
3054
+ return ListPolicies200ResponseFromJSONTyped(json, false);
1049
3055
  }
1050
- function RedactRuleFromJSONTyped(json, ignoreDiscriminator) {
3056
+ function ListPolicies200ResponseFromJSONTyped(json, ignoreDiscriminator) {
1051
3057
  if (json == null) return json;
1052
- return {
1053
- "type": json["type"] == null ? void 0 : json["type"],
1054
- "entities": json["entities"].map(DetectRuleEntitiesInnerFromJSON)
1055
- };
3058
+ return { "policies": json["policies"].map(PolicySummaryFromJSON) };
1056
3059
  }
1057
- function RedactRuleToJSON(json) {
1058
- return RedactRuleToJSONTyped(json, false);
3060
+ function ListPolicies200ResponseToJSON(json) {
3061
+ return ListPolicies200ResponseToJSONTyped(json, false);
1059
3062
  }
1060
- function RedactRuleToJSONTyped(value, ignoreDiscriminator = false) {
3063
+ function ListPolicies200ResponseToJSONTyped(value, ignoreDiscriminator = false) {
1061
3064
  if (value == null) return value;
1062
- return {
1063
- "type": value["type"],
1064
- "entities": value["entities"].map(DetectRuleEntitiesInnerToJSON)
1065
- };
3065
+ return { "policies": value["policies"].map(PolicySummaryToJSON) };
1066
3066
  }
1067
3067
 
1068
3068
  //#endregion
1069
- //#region src/models/RegexEntity.ts
1070
- /**
1071
- * @export
1072
- */
1073
- const RegexEntityTypeEnum = { regex: "regex" };
3069
+ //#region src/models/ModelError.ts
1074
3070
  /**
1075
- * Check if a given object implements the RegexEntity interface.
3071
+ * Check if a given object implements the ModelError interface.
1076
3072
  */
1077
- function instanceOfRegexEntity(value) {
1078
- if (!("value" in value) || value["value"] === void 0) return false;
3073
+ function instanceOfModelError(value) {
3074
+ if (!("error" in value) || value["error"] === void 0) return false;
1079
3075
  return true;
1080
3076
  }
1081
- function RegexEntityFromJSON(json) {
1082
- return RegexEntityFromJSONTyped(json, false);
3077
+ function ModelErrorFromJSON(json) {
3078
+ return ModelErrorFromJSONTyped(json, false);
1083
3079
  }
1084
- function RegexEntityFromJSONTyped(json, ignoreDiscriminator) {
3080
+ function ModelErrorFromJSONTyped(json, ignoreDiscriminator) {
1085
3081
  if (json == null) return json;
1086
- return {
1087
- "type": json["type"] == null ? void 0 : json["type"],
1088
- "value": json["value"]
1089
- };
3082
+ return { "error": ErrorInfoFromJSON(json["error"]) };
1090
3083
  }
1091
- function RegexEntityToJSON(json) {
1092
- return RegexEntityToJSONTyped(json, false);
3084
+ function ModelErrorToJSON(json) {
3085
+ return ModelErrorToJSONTyped(json, false);
1093
3086
  }
1094
- function RegexEntityToJSONTyped(value, ignoreDiscriminator = false) {
3087
+ function ModelErrorToJSONTyped(value, ignoreDiscriminator = false) {
1095
3088
  if (value == null) return value;
1096
- return {
1097
- "type": value["type"],
1098
- "value": value["value"]
1099
- };
3089
+ return { "error": ErrorInfoToJSON(value["error"]) };
1100
3090
  }
1101
3091
 
1102
3092
  //#endregion
1103
- //#region src/models/RegexResult.ts
1104
- /**
1105
- * @export
1106
- */
1107
- const RegexResultTypeEnum = { regex: "regex" };
1108
- /**
1109
- * Check if a given object implements the RegexResult interface.
1110
- */
1111
- function instanceOfRegexResult(value) {
1112
- if (!("rule" in value) || value["rule"] === void 0) return false;
1113
- if (!("value" in value) || value["value"] === void 0) return false;
1114
- if (!("input" in value) || value["input"] === void 0) return false;
1115
- if (!("output" in value) || value["output"] === void 0) return false;
1116
- return true;
3093
+ //#region src/models/ModelType.ts
3094
+ function ModelTypeFromJSON(json) {
3095
+ return ModelTypeFromJSONTyped(json, false);
1117
3096
  }
1118
- function RegexResultFromJSON(json) {
1119
- return RegexResultFromJSONTyped(json, false);
1120
- }
1121
- function RegexResultFromJSONTyped(json, ignoreDiscriminator) {
3097
+ function ModelTypeFromJSONTyped(json, ignoreDiscriminator) {
1122
3098
  if (json == null) return json;
1123
- return {
1124
- "type": json["type"] == null ? void 0 : json["type"],
1125
- "rule": json["rule"],
1126
- "value": json["value"],
1127
- "input": TextRangeFromJSON(json["input"]),
1128
- "output": TextRangeFromJSON(json["output"])
1129
- };
3099
+ if (typeof json === "string" && json === "text") return json;
3100
+ if (typeof json === "string" && json === "image") return json;
3101
+ return {};
1130
3102
  }
1131
- function RegexResultToJSON(json) {
1132
- return RegexResultToJSONTyped(json, false);
3103
+ function ModelTypeToJSON(json) {
3104
+ return ModelTypeToJSONTyped(json, false);
1133
3105
  }
1134
- function RegexResultToJSONTyped(value, ignoreDiscriminator = false) {
3106
+ function ModelTypeToJSONTyped(value, ignoreDiscriminator = false) {
1135
3107
  if (value == null) return value;
1136
- return {
1137
- "type": value["type"],
1138
- "rule": value["rule"],
1139
- "value": value["value"],
1140
- "input": TextRangeToJSON(value["input"]),
1141
- "output": TextRangeToJSON(value["output"])
1142
- };
3108
+ if (typeof value === "string" && value === "text") return value;
3109
+ if (typeof value === "string" && value === "image") return value;
3110
+ return {};
1143
3111
  }
1144
3112
 
1145
3113
  //#endregion
1146
- //#region src/models/ReplaceRule.ts
1147
- /**
1148
- * @export
1149
- */
1150
- const ReplaceRuleTypeEnum = { replace: "replace" };
3114
+ //#region src/models/ModelStatus.ts
1151
3115
  /**
1152
- * Check if a given object implements the ReplaceRule interface.
3116
+ * Check if a given object implements the ModelStatus interface.
1153
3117
  */
1154
- function instanceOfReplaceRule(value) {
1155
- if (!("entities" in value) || value["entities"] === void 0) return false;
3118
+ function instanceOfModelStatus(value) {
3119
+ if (!("id" in value) || value["id"] === void 0) return false;
3120
+ if (!("type" in value) || value["type"] === void 0) return false;
3121
+ if (!("_default" in value) || value["_default"] === void 0) return false;
3122
+ if (!("ready" in value) || value["ready"] === void 0) return false;
1156
3123
  return true;
1157
3124
  }
1158
- function ReplaceRuleFromJSON(json) {
1159
- return ReplaceRuleFromJSONTyped(json, false);
3125
+ function ModelStatusFromJSON(json) {
3126
+ return ModelStatusFromJSONTyped(json, false);
1160
3127
  }
1161
- function ReplaceRuleFromJSONTyped(json, ignoreDiscriminator) {
3128
+ function ModelStatusFromJSONTyped(json, ignoreDiscriminator) {
1162
3129
  if (json == null) return json;
1163
3130
  return {
1164
- "type": json["type"] == null ? void 0 : json["type"],
1165
- "entities": json["entities"].map(DetectRuleEntitiesInnerFromJSON),
1166
- "replacement": json["replacement"] == null ? void 0 : json["replacement"]
3131
+ "id": json["id"],
3132
+ "type": ModelTypeFromJSON(json["type"]),
3133
+ "_default": json["default"],
3134
+ "ready": json["ready"],
3135
+ "description": json["description"] == null ? void 0 : json["description"],
3136
+ "error": json["error"] == null ? void 0 : json["error"]
1167
3137
  };
1168
3138
  }
1169
- function ReplaceRuleToJSON(json) {
1170
- return ReplaceRuleToJSONTyped(json, false);
3139
+ function ModelStatusToJSON(json) {
3140
+ return ModelStatusToJSONTyped(json, false);
1171
3141
  }
1172
- function ReplaceRuleToJSONTyped(value, ignoreDiscriminator = false) {
3142
+ function ModelStatusToJSONTyped(value, ignoreDiscriminator = false) {
1173
3143
  if (value == null) return value;
1174
3144
  return {
1175
- "type": value["type"],
1176
- "entities": value["entities"].map(DetectRuleEntitiesInnerToJSON),
1177
- "replacement": value["replacement"]
3145
+ "id": value["id"],
3146
+ "type": ModelTypeToJSON(value["type"]),
3147
+ "default": value["_default"],
3148
+ "ready": value["ready"],
3149
+ "description": value["description"],
3150
+ "error": value["error"]
1178
3151
  };
1179
3152
  }
1180
3153
 
1181
3154
  //#endregion
1182
- //#region src/models/SHA256Rule.ts
1183
- /**
1184
- * @export
1185
- */
1186
- const SHA256RuleTypeEnum = { sha256: "sha256" };
3155
+ //#region src/models/Policy.ts
1187
3156
  /**
1188
- * Check if a given object implements the SHA256Rule interface.
3157
+ * Check if a given object implements the Policy interface.
1189
3158
  */
1190
- function instanceOfSHA256Rule(value) {
1191
- if (!("entities" in value) || value["entities"] === void 0) return false;
3159
+ function instanceOfPolicy(value) {
3160
+ if (!("id" in value) || value["id"] === void 0) return false;
3161
+ if (!("name" in value) || value["name"] === void 0) return false;
3162
+ if (!("versionId" in value) || value["versionId"] === void 0) return false;
3163
+ if (!("document" in value) || value["document"] === void 0) return false;
3164
+ if (!("createdAt" in value) || value["createdAt"] === void 0) return false;
3165
+ if (!("updatedAt" in value) || value["updatedAt"] === void 0) return false;
1192
3166
  return true;
1193
3167
  }
1194
- function SHA256RuleFromJSON(json) {
1195
- return SHA256RuleFromJSONTyped(json, false);
3168
+ function PolicyFromJSON(json) {
3169
+ return PolicyFromJSONTyped(json, false);
1196
3170
  }
1197
- function SHA256RuleFromJSONTyped(json, ignoreDiscriminator) {
3171
+ function PolicyFromJSONTyped(json, ignoreDiscriminator) {
1198
3172
  if (json == null) return json;
1199
3173
  return {
1200
- "type": json["type"] == null ? void 0 : json["type"],
1201
- "entities": json["entities"].map(DetectRuleEntitiesInnerFromJSON)
3174
+ "id": json["id"],
3175
+ "name": json["name"],
3176
+ "versionId": json["versionId"],
3177
+ "document": PolicyDocumentFromJSON(json["document"]),
3178
+ "createdAt": json["createdAt"],
3179
+ "updatedAt": json["updatedAt"]
1202
3180
  };
1203
3181
  }
1204
- function SHA256RuleToJSON(json) {
1205
- return SHA256RuleToJSONTyped(json, false);
3182
+ function PolicyToJSON(json) {
3183
+ return PolicyToJSONTyped(json, false);
1206
3184
  }
1207
- function SHA256RuleToJSONTyped(value, ignoreDiscriminator = false) {
3185
+ function PolicyToJSONTyped(value, ignoreDiscriminator = false) {
1208
3186
  if (value == null) return value;
1209
3187
  return {
1210
- "type": value["type"],
1211
- "entities": value["entities"].map(DetectRuleEntitiesInnerToJSON)
3188
+ "id": value["id"],
3189
+ "name": value["name"],
3190
+ "versionId": value["versionId"],
3191
+ "document": PolicyDocumentToJSON(value["document"]),
3192
+ "createdAt": value["createdAt"],
3193
+ "updatedAt": value["updatedAt"]
1212
3194
  };
1213
3195
  }
1214
3196
 
1215
3197
  //#endregion
1216
- //#region src/models/SHA512Rule.ts
3198
+ //#region src/models/Refusal.ts
1217
3199
  /**
1218
- * @export
1219
- */
1220
- const SHA512RuleTypeEnum = { sha512: "sha512" };
1221
- /**
1222
- * Check if a given object implements the SHA512Rule interface.
3200
+ * Check if a given object implements the Refusal interface.
1223
3201
  */
1224
- function instanceOfSHA512Rule(value) {
1225
- if (!("entities" in value) || value["entities"] === void 0) return false;
3202
+ function instanceOfRefusal(value) {
3203
+ if (!("error" in value) || value["error"] === void 0) return false;
1226
3204
  return true;
1227
3205
  }
1228
- function SHA512RuleFromJSON(json) {
1229
- return SHA512RuleFromJSONTyped(json, false);
3206
+ function RefusalFromJSON(json) {
3207
+ return RefusalFromJSONTyped(json, false);
1230
3208
  }
1231
- function SHA512RuleFromJSONTyped(json, ignoreDiscriminator) {
3209
+ function RefusalFromJSONTyped(json, ignoreDiscriminator) {
1232
3210
  if (json == null) return json;
1233
3211
  return {
1234
- "type": json["type"] == null ? void 0 : json["type"],
1235
- "entities": json["entities"].map(DetectRuleEntitiesInnerFromJSON)
3212
+ "error": json["error"],
3213
+ "signup": json["signup"] == null ? void 0 : json["signup"]
1236
3214
  };
1237
3215
  }
1238
- function SHA512RuleToJSON(json) {
1239
- return SHA512RuleToJSONTyped(json, false);
3216
+ function RefusalToJSON(json) {
3217
+ return RefusalToJSONTyped(json, false);
1240
3218
  }
1241
- function SHA512RuleToJSONTyped(value, ignoreDiscriminator = false) {
3219
+ function RefusalToJSONTyped(value, ignoreDiscriminator = false) {
1242
3220
  if (value == null) return value;
1243
3221
  return {
1244
- "type": value["type"],
1245
- "entities": value["entities"].map(DetectRuleEntitiesInnerToJSON)
3222
+ "error": value["error"],
3223
+ "signup": value["signup"]
1246
3224
  };
1247
3225
  }
1248
3226
 
@@ -1264,7 +3242,8 @@ function ScanRequestBodyFromJSONTyped(json, ignoreDiscriminator) {
1264
3242
  "text": json["text"],
1265
3243
  "language": json["language"] == null ? void 0 : json["language"],
1266
3244
  "entities": json["entities"] == null ? void 0 : json["entities"],
1267
- "confidence_threshold": json["confidence_threshold"] == null ? void 0 : json["confidence_threshold"]
3245
+ "confidence_threshold": json["confidence_threshold"] == null ? void 0 : json["confidence_threshold"],
3246
+ "models": json["models"] == null ? void 0 : json["models"]
1268
3247
  };
1269
3248
  }
1270
3249
  function ScanRequestBodyToJSON(json) {
@@ -1276,7 +3255,8 @@ function ScanRequestBodyToJSONTyped(value, ignoreDiscriminator = false) {
1276
3255
  "text": value["text"],
1277
3256
  "language": value["language"],
1278
3257
  "entities": value["entities"],
1279
- "confidence_threshold": value["confidence_threshold"]
3258
+ "confidence_threshold": value["confidence_threshold"],
3259
+ "models": value["models"]
1280
3260
  };
1281
3261
  }
1282
3262
 
@@ -1325,6 +3305,7 @@ function ScanResultToJSONTyped(value, ignoreDiscriminator = false) {
1325
3305
  function instanceOfScanResponseBody(value) {
1326
3306
  if (!("results" in value) || value["results"] === void 0) return false;
1327
3307
  if (!("usage" in value) || value["usage"] === void 0) return false;
3308
+ if (!("models" in value) || value["models"] === void 0) return false;
1328
3309
  return true;
1329
3310
  }
1330
3311
  function ScanResponseBodyFromJSON(json) {
@@ -1334,7 +3315,8 @@ function ScanResponseBodyFromJSONTyped(json, ignoreDiscriminator) {
1334
3315
  if (json == null) return json;
1335
3316
  return {
1336
3317
  "results": json["results"].map(ScanResultFromJSON),
1337
- "usage": UsageFromJSON(json["usage"])
3318
+ "usage": UsageFromJSON(json["usage"]),
3319
+ "models": json["models"]
1338
3320
  };
1339
3321
  }
1340
3322
  function ScanResponseBodyToJSON(json) {
@@ -1344,7 +3326,8 @@ function ScanResponseBodyToJSONTyped(value, ignoreDiscriminator = false) {
1344
3326
  if (value == null) return value;
1345
3327
  return {
1346
3328
  "results": value["results"].map(ScanResultToJSON),
1347
- "usage": UsageToJSON(value["usage"])
3329
+ "usage": UsageToJSON(value["usage"]),
3330
+ "models": value["models"]
1348
3331
  };
1349
3332
  }
1350
3333
 
@@ -1381,7 +3364,7 @@ function UpdatePolicyRequestToJSONTyped(value, ignoreDiscriminator = false) {
1381
3364
  //#region src/apis/PoliciesApi.ts
1382
3365
  /**
1383
3366
  * Sensitive Data Protection API
1384
- * Detect and de-identify sensitive data (PII) in text. Use `scan` to locate sensitive entities such as emails, phone numbers, and names, and `anonymize` to transform them using configurable rules (redact, mask, replace, hash, or encrypt).
3367
+ * Detect and de-identify sensitive data (PII) in text. Use `scan` to locate sensitive entities such as emails, phone numbers, and names, and `anonymize` to transform them using configurable rules (redact, mask, replace, pseudonymize, hash, or encrypt).
1385
3368
  *
1386
3369
  * The version of the OpenAPI document: 0.1.0
1387
3370
  *
@@ -1523,7 +3506,7 @@ var PoliciesApi = class extends BaseAPI {
1523
3506
  //#region src/apis/SensitiveDataProtectionApi.ts
1524
3507
  /**
1525
3508
  * Sensitive Data Protection API
1526
- * Detect and de-identify sensitive data (PII) in text. Use `scan` to locate sensitive entities such as emails, phone numbers, and names, and `anonymize` to transform them using configurable rules (redact, mask, replace, hash, or encrypt).
3509
+ * Detect and de-identify sensitive data (PII) in text. Use `scan` to locate sensitive entities such as emails, phone numbers, and names, and `anonymize` to transform them using configurable rules (redact, mask, replace, pseudonymize, hash, or encrypt).
1527
3510
  *
1528
3511
  * The version of the OpenAPI document: 0.1.0
1529
3512
  *
@@ -1537,7 +3520,53 @@ var PoliciesApi = class extends BaseAPI {
1537
3520
  */
1538
3521
  var SensitiveDataProtectionApi = class extends BaseAPI {
1539
3522
  /**
1540
- * Anonymize sensitive data in text. Scans the request text for the entities targeted by each supplied rule and applies that rule\'s operation (replace, redact, mask, hash, or encrypt) to every match. Returns the anonymized text together with a record of each transformation, including the original and resulting character ranges.
3523
+ * Anonymize sensitive data in a file. Reads the file\'s text (Office parts, cells, lines), applies the rules as `/anonymize` does, and returns the file in its own format with every change made: each value found, with where it is (`path`), and each part removed. With `Accept: application/x-ndjson`, answers with one JSON event per line: `start`, a `batch` per step of reading, then `done` (the same body) or `error`. An Office file\'s images and kept embedded files are read as files of their own beside its text: each has `task` events (queued, started, then done, stopped or failed), and its own `start` and `batch` events carry its `task` path.
3524
+ * Anonymize File
3525
+ */
3526
+ async anonymizeFileRaw(requestParameters, initOverrides) {
3527
+ if (requestParameters["file"] == null) throw new RequiredError("file", "Required parameter \"file\" was null or undefined when calling anonymizeFile().");
3528
+ const queryParameters = {};
3529
+ const headerParameters = {};
3530
+ if (this.configuration && this.configuration.apiKey) headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key");
3531
+ const canConsumeForm$1 = canConsumeForm([{ contentType: "multipart/form-data" }]);
3532
+ let formParams;
3533
+ let useForm = false;
3534
+ useForm = canConsumeForm$1;
3535
+ if (useForm) formParams = new FormData();
3536
+ else formParams = new URLSearchParams();
3537
+ if (requestParameters["file"] != null) formParams.append("file", requestParameters["file"]);
3538
+ if (requestParameters["rules"] != null) formParams.append("rules", requestParameters["rules"]);
3539
+ if (requestParameters["confidence_threshold"] != null) formParams.append("confidence_threshold", requestParameters["confidence_threshold"]);
3540
+ if (requestParameters["embedded_rules"] != null) formParams.append("embedded_rules", requestParameters["embedded_rules"]);
3541
+ if (requestParameters["table_headers"] != null) formParams.append("table_headers", requestParameters["table_headers"]);
3542
+ if (requestParameters["models"] != null) formParams.append("models", requestParameters["models"]);
3543
+ if (requestParameters["dicom_options"] != null) formParams.append("dicom_options", requestParameters["dicom_options"]);
3544
+ const response = await this.request({
3545
+ path: `/anonymize/file`,
3546
+ method: "POST",
3547
+ headers: headerParameters,
3548
+ query: queryParameters,
3549
+ body: formParams
3550
+ }, initOverrides);
3551
+ return new JSONApiResponse(response, (jsonValue) => AnonymizeFileResponseBodyFromJSON(jsonValue));
3552
+ }
3553
+ /**
3554
+ * Anonymize sensitive data in a file. Reads the file\'s text (Office parts, cells, lines), applies the rules as `/anonymize` does, and returns the file in its own format with every change made: each value found, with where it is (`path`), and each part removed. With `Accept: application/x-ndjson`, answers with one JSON event per line: `start`, a `batch` per step of reading, then `done` (the same body) or `error`. An Office file\'s images and kept embedded files are read as files of their own beside its text: each has `task` events (queued, started, then done, stopped or failed), and its own `start` and `batch` events carry its `task` path.
3555
+ * Anonymize File
3556
+ */
3557
+ async anonymizeFile(file, rules, confidence_threshold, embedded_rules, table_headers, models, dicom_options, initOverrides) {
3558
+ return await (await this.anonymizeFileRaw({
3559
+ file,
3560
+ rules,
3561
+ confidence_threshold,
3562
+ embedded_rules,
3563
+ table_headers,
3564
+ models,
3565
+ dicom_options
3566
+ }, initOverrides)).value();
3567
+ }
3568
+ /**
3569
+ * Anonymize sensitive data in text. Scans the request text for the entities targeted by each supplied rule and applies that rule\'s operation (replace, redact, mask, pseudonymize, hash, or encrypt) to every match. Returns the anonymized text together with a record of each transformation, including the original and resulting character ranges.
1541
3570
  * Anonymize Text
1542
3571
  */
1543
3572
  async anonymizeTextRaw(requestParameters, initOverrides) {
@@ -1556,7 +3585,7 @@ var SensitiveDataProtectionApi = class extends BaseAPI {
1556
3585
  return new JSONApiResponse(response, (jsonValue) => AnonymizeResponseBodyFromJSON(jsonValue));
1557
3586
  }
1558
3587
  /**
1559
- * Anonymize sensitive data in text. Scans the request text for the entities targeted by each supplied rule and applies that rule\'s operation (replace, redact, mask, hash, or encrypt) to every match. Returns the anonymized text together with a record of each transformation, including the original and resulting character ranges.
3588
+ * Anonymize sensitive data in text. Scans the request text for the entities targeted by each supplied rule and applies that rule\'s operation (replace, redact, mask, pseudonymize, hash, or encrypt) to every match. Returns the anonymized text together with a record of each transformation, including the original and resulting character ranges.
1560
3589
  * Anonymize Text
1561
3590
  */
1562
3591
  async anonymizeText(AnonymizeRequestBody, initOverrides) {
@@ -1587,6 +3616,26 @@ var SensitiveDataProtectionApi = class extends BaseAPI {
1587
3616
  return await (await this.healthCheckRaw(initOverrides)).value();
1588
3617
  }
1589
3618
  /**
3619
+ * The models this server offers: text models (`type: text`, run on every request), then image readers (`type: image`, read a file\'s images), each type largest first. A request lists ids in `models`, each type\'s in order of preference: of each type, the first `ready` runs. If none of a type it names is ready, it is refused with a 503, with `Retry-After` while one still loads. A type it names none of runs on its `default`: the first `ready`, largest first (so `default` moves as models load); at startup, before any is ready, the request waits for the first to load. An unknown id is a 422.
3620
+ * List Models
3621
+ */
3622
+ async listModelsRaw(initOverrides) {
3623
+ const response = await this.request({
3624
+ path: `/models`,
3625
+ method: "GET",
3626
+ headers: {},
3627
+ query: {}
3628
+ }, initOverrides);
3629
+ return new JSONApiResponse(response, (jsonValue) => jsonValue.map(ModelStatusFromJSON));
3630
+ }
3631
+ /**
3632
+ * The models this server offers: text models (`type: text`, run on every request), then image readers (`type: image`, read a file\'s images), each type largest first. A request lists ids in `models`, each type\'s in order of preference: of each type, the first `ready` runs. If none of a type it names is ready, it is refused with a 503, with `Retry-After` while one still loads. A type it names none of runs on its `default`: the first `ready`, largest first (so `default` moves as models load); at startup, before any is ready, the request waits for the first to load. An unknown id is a 422.
3633
+ * List Models
3634
+ */
3635
+ async listModels(initOverrides) {
3636
+ return await (await this.listModelsRaw(initOverrides)).value();
3637
+ }
3638
+ /**
1590
3639
  * Scan text for sensitive data. Runs the configured detection entities over the request text and returns every match as a character range with its entity type and confidence score. Detections below the confidence threshold are omitted.
1591
3640
  * Scan Text
1592
3641
  */
@@ -1613,6 +3662,24 @@ var SensitiveDataProtectionApi = class extends BaseAPI {
1613
3662
  return await (await this.scanTextRaw({ ScanRequestBody }, initOverrides)).value();
1614
3663
  }
1615
3664
  };
3665
+ /**
3666
+ * @export
3667
+ */
3668
+ const AnonymizeFileEmbeddedRulesEnum = {
3669
+ anonymize: "anonymize",
3670
+ anonymize_or_keep: "anonymize_or_keep",
3671
+ remove: "remove",
3672
+ keep: "keep"
3673
+ };
3674
+ /**
3675
+ * @export
3676
+ */
3677
+ const AnonymizeFileTableHeadersEnum = {
3678
+ none: "none",
3679
+ first_row: "first_row",
3680
+ first_column: "first_column",
3681
+ last_column: "last_column"
3682
+ };
1616
3683
 
1617
3684
  //#endregion
1618
- export { AnonymizeRequestBodyFromJSON, AnonymizeRequestBodyFromJSONTyped, AnonymizeRequestBodyRulesInnerFromJSON, AnonymizeRequestBodyRulesInnerFromJSONTyped, AnonymizeRequestBodyRulesInnerToJSON, AnonymizeRequestBodyRulesInnerToJSONTyped, AnonymizeRequestBodyRulesInnerTypeEnum, AnonymizeRequestBodyToJSON, AnonymizeRequestBodyToJSONTyped, AnonymizeResponseBodyFromJSON, AnonymizeResponseBodyFromJSONTyped, AnonymizeResponseBodyResultsInnerFromJSON, AnonymizeResponseBodyResultsInnerFromJSONTyped, AnonymizeResponseBodyResultsInnerToJSON, AnonymizeResponseBodyResultsInnerToJSONTyped, AnonymizeResponseBodyResultsInnerTypeEnum, AnonymizeResponseBodyToJSON, AnonymizeResponseBodyToJSONTyped, BASE_PATH, BaseAPI, BlobApiResponse, COLLECTION_FORMATS, Configuration, CreatePolicyRequestFromJSON, CreatePolicyRequestFromJSONTyped, CreatePolicyRequestToJSON, CreatePolicyRequestToJSONTyped, DefaultConfig, DetectRuleEntitiesInnerFromJSON, DetectRuleEntitiesInnerFromJSONTyped, DetectRuleEntitiesInnerToJSON, DetectRuleEntitiesInnerToJSONTyped, DetectRuleEntitiesInnerTypeEnum, DetectRuleFromJSON, DetectRuleFromJSONTyped, DetectRuleToJSON, DetectRuleToJSONTyped, DetectRuleTypeEnum, EncryptRuleFromJSON, EncryptRuleFromJSONTyped, EncryptRuleToJSON, EncryptRuleToJSONTyped, EncryptRuleTypeEnum, FetchError, HTTPValidationErrorFromJSON, HTTPValidationErrorFromJSONTyped, HTTPValidationErrorToJSON, HTTPValidationErrorToJSONTyped, JSONApiResponse, ListPolicies200ResponseFromJSON, ListPolicies200ResponseFromJSONTyped, ListPolicies200ResponseToJSON, ListPolicies200ResponseToJSONTyped, MaskRuleFromJSON, MaskRuleFromJSONTyped, MaskRuleToJSON, MaskRuleToJSONTyped, MaskRuleTypeEnum, ModelEntityFromJSON, ModelEntityFromJSONTyped, ModelEntityToJSON, ModelEntityToJSONTyped, ModelEntityTypeEnum, ModelResultFromJSON, ModelResultFromJSONTyped, ModelResultToJSON, ModelResultToJSONTyped, ModelResultTypeEnum, PoliciesApi, PolicyDocumentFromJSON, PolicyDocumentFromJSONTyped, PolicyDocumentRulesInnerFromJSON, PolicyDocumentRulesInnerFromJSONTyped, PolicyDocumentRulesInnerToJSON, PolicyDocumentRulesInnerToJSONTyped, PolicyDocumentRulesInnerTypeEnum, PolicyDocumentSchemaVersionEnum, PolicyDocumentToJSON, PolicyDocumentToJSONTyped, PolicyFromJSON, PolicyFromJSONTyped, PolicySummaryFromJSON, PolicySummaryFromJSONTyped, PolicySummaryToJSON, PolicySummaryToJSONTyped, PolicyToJSON, PolicyToJSONTyped, RedactRuleFromJSON, RedactRuleFromJSONTyped, RedactRuleToJSON, RedactRuleToJSONTyped, RedactRuleTypeEnum, RegexEntityFromJSON, RegexEntityFromJSONTyped, RegexEntityToJSON, RegexEntityToJSONTyped, RegexEntityTypeEnum, RegexResultFromJSON, RegexResultFromJSONTyped, RegexResultToJSON, RegexResultToJSONTyped, RegexResultTypeEnum, ReplaceRuleFromJSON, ReplaceRuleFromJSONTyped, ReplaceRuleToJSON, ReplaceRuleToJSONTyped, ReplaceRuleTypeEnum, RequiredError, ResponseError, SHA256RuleFromJSON, SHA256RuleFromJSONTyped, SHA256RuleToJSON, SHA256RuleToJSONTyped, SHA256RuleTypeEnum, SHA512RuleFromJSON, SHA512RuleFromJSONTyped, SHA512RuleToJSON, SHA512RuleToJSONTyped, SHA512RuleTypeEnum, ScanRequestBodyFromJSON, ScanRequestBodyFromJSONTyped, ScanRequestBodyToJSON, ScanRequestBodyToJSONTyped, ScanResponseBodyFromJSON, ScanResponseBodyFromJSONTyped, ScanResponseBodyToJSON, ScanResponseBodyToJSONTyped, ScanResultFromJSON, ScanResultFromJSONTyped, ScanResultToJSON, ScanResultToJSONTyped, SensitiveDataProtectionApi, TextApiResponse, TextRangeFromJSON, TextRangeFromJSONTyped, TextRangeToJSON, TextRangeToJSONTyped, UpdatePolicyRequestFromJSON, UpdatePolicyRequestFromJSONTyped, UpdatePolicyRequestToJSON, UpdatePolicyRequestToJSONTyped, UsageFromJSON, UsageFromJSONTyped, UsageToJSON, UsageToJSONTyped, ValidationErrorFromJSON, ValidationErrorFromJSONTyped, ValidationErrorLocInnerFromJSON, ValidationErrorLocInnerFromJSONTyped, ValidationErrorLocInnerToJSON, ValidationErrorLocInnerToJSONTyped, ValidationErrorToJSON, ValidationErrorToJSONTyped, VoidApiResponse, canConsumeForm, exists, instanceOfAnonymizeRequestBody, instanceOfAnonymizeRequestBodyRulesInner, instanceOfAnonymizeResponseBody, instanceOfAnonymizeResponseBodyResultsInner, instanceOfCreatePolicyRequest, instanceOfDetectRule, instanceOfDetectRuleEntitiesInner, instanceOfEncryptRule, instanceOfHTTPValidationError, instanceOfListPolicies200Response, instanceOfMaskRule, instanceOfModelEntity, instanceOfModelResult, instanceOfPolicy, instanceOfPolicyDocument, instanceOfPolicyDocumentRulesInner, instanceOfPolicySummary, instanceOfRedactRule, instanceOfRegexEntity, instanceOfRegexResult, instanceOfReplaceRule, instanceOfSHA256Rule, instanceOfSHA512Rule, instanceOfScanRequestBody, instanceOfScanResponseBody, instanceOfScanResult, instanceOfTextRange, instanceOfUpdatePolicyRequest, instanceOfUsage, instanceOfValidationError, instanceOfValidationErrorLocInner, mapValues, querystring };
3685
+ export { Action, ActionFromJSON, ActionFromJSONTyped, ActionToJSON, ActionToJSONTyped, AnonymizeFileEmbeddedRulesEnum, AnonymizeFileResponseBodyFromJSON, AnonymizeFileResponseBodyFromJSONTyped, AnonymizeFileResponseBodyToJSON, AnonymizeFileResponseBodyToJSONTyped, AnonymizeFileTableHeadersEnum, AnonymizeRequestBodyFromJSON, AnonymizeRequestBodyFromJSONTyped, AnonymizeRequestBodyToJSON, AnonymizeRequestBodyToJSONTyped, AnonymizeResponseBodyFromJSON, AnonymizeResponseBodyFromJSONTyped, AnonymizeResponseBodyToJSON, AnonymizeResponseBodyToJSONTyped, AppliedFromJSON, AppliedFromJSONTyped, AppliedToJSON, AppliedToJSONTyped, AtFromJSON, AtFromJSONTyped, AtToJSON, AtToJSONTyped, AttributeSegmentFromJSON, AttributeSegmentFromJSONTyped, AttributeSegmentToJSON, AttributeSegmentToJSONTyped, AttributeSegmentTypeEnum, BASE_PATH, BaseAPI, BlobApiResponse, COLLECTION_FORMATS, CellKindFromJSON, CellKindFromJSONTyped, CellKindToJSON, CellKindToJSONTyped, CellNoteSegmentFromJSON, CellNoteSegmentFromJSONTyped, CellNoteSegmentToJSON, CellNoteSegmentToJSONTyped, CellNoteSegmentTypeEnum, CellSegmentFromJSON, CellSegmentFromJSONTyped, CellSegmentToJSON, CellSegmentToJSONTyped, CellSegmentTypeEnum, CommentKind, CommentKindFromJSON, CommentKindFromJSONTyped, CommentKindToJSON, CommentKindToJSONTyped, CommentSegmentFromJSON, CommentSegmentFromJSONTyped, CommentSegmentToJSON, CommentSegmentToJSONTyped, CommentSegmentTypeEnum, ComponentSegmentFromJSON, ComponentSegmentFromJSONTyped, ComponentSegmentToJSON, ComponentSegmentToJSONTyped, ComponentSegmentTypeEnum, Configuration, CreatePolicyRequestFromJSON, CreatePolicyRequestFromJSONTyped, CreatePolicyRequestToJSON, CreatePolicyRequestToJSONTyped, DefaultConfig, DetectRuleFromJSON, DetectRuleFromJSONTyped, DetectRuleToJSON, DetectRuleToJSONTyped, DetectRuleTypeEnum, ElementSegmentFromJSON, ElementSegmentFromJSONTyped, ElementSegmentToJSON, ElementSegmentToJSONTyped, ElementSegmentTypeEnum, EncryptRuleFromJSON, EncryptRuleFromJSONTyped, EncryptRuleToJSON, EncryptRuleToJSONTyped, EncryptRuleTypeEnum, EndnoteSegmentFromJSON, EndnoteSegmentFromJSONTyped, EndnoteSegmentToJSON, EndnoteSegmentToJSONTyped, EndnoteSegmentTypeEnum, EntityBodyFromJSON, EntityBodyFromJSONTyped, EntityBodyToJSON, EntityBodyToJSONTyped, ErrorCode, ErrorCodeFromJSON, ErrorCodeFromJSONTyped, ErrorCodeToJSON, ErrorCodeToJSONTyped, ErrorInfoFromJSON, ErrorInfoFromJSONTyped, ErrorInfoToJSON, ErrorInfoToJSONTyped, FetchError, FieldErrorCode, FieldErrorCodeFromJSON, FieldErrorCodeFromJSONTyped, FieldErrorCodeToJSON, FieldErrorCodeToJSONTyped, FieldErrorFromJSON, FieldErrorFromJSONTyped, FieldErrorPathInnerFromJSON, FieldErrorPathInnerFromJSONTyped, FieldErrorPathInnerToJSON, FieldErrorPathInnerToJSONTyped, FieldErrorToJSON, FieldErrorToJSONTyped, FieldSegmentFromJSON, FieldSegmentFromJSONTyped, FieldSegmentToJSON, FieldSegmentToJSONTyped, FieldSegmentTypeEnum, FileAttributeResultFromJSON, FileAttributeResultFromJSONTyped, FileAttributeResultToJSON, FileAttributeResultToJSONTyped, FileAttributeResultTypeEnum, FileEmbeddedResultFromJSON, FileEmbeddedResultFromJSONTyped, FileEmbeddedResultToJSON, FileEmbeddedResultToJSONTyped, FileEmbeddedResultTypeEnum, FileModelResultFromJSON, FileModelResultFromJSONTyped, FileModelResultToJSON, FileModelResultToJSONTyped, FileModelResultTypeEnum, FileRegexResultFromJSON, FileRegexResultFromJSONTyped, FileRegexResultToJSON, FileRegexResultToJSONTyped, FileRegexResultTypeEnum, FileResultFromJSON, FileResultFromJSONTyped, FileResultToJSON, FileResultToJSONTyped, FootnoteSegmentFromJSON, FootnoteSegmentFromJSONTyped, FootnoteSegmentToJSON, FootnoteSegmentToJSONTyped, FootnoteSegmentTypeEnum, FrameSegmentFromJSON, FrameSegmentFromJSONTyped, FrameSegmentToJSON, FrameSegmentToJSONTyped, FrameSegmentTypeEnum, HMACRuleFromJSON, HMACRuleFromJSONTyped, HMACRuleToJSON, HMACRuleToJSONTyped, HMACRuleTypeEnum, HeaderFooterSegmentFromJSON, HeaderFooterSegmentFromJSONTyped, HeaderFooterSegmentToJSON, HeaderFooterSegmentToJSONTyped, HeaderFooterSegmentTypeEnum, IndexSegmentFromJSON, IndexSegmentFromJSONTyped, IndexSegmentToJSON, IndexSegmentToJSONTyped, IndexSegmentTypeEnum, ItemSegmentFromJSON, ItemSegmentFromJSONTyped, ItemSegmentToJSON, ItemSegmentToJSONTyped, ItemSegmentTypeEnum, JSONApiResponse, KeySegmentFromJSON, KeySegmentFromJSONTyped, KeySegmentToJSON, KeySegmentToJSONTyped, KeySegmentTypeEnum, KindFromJSON, KindFromJSONTyped, KindToJSON, KindToJSONTyped, LineSegmentFromJSON, LineSegmentFromJSONTyped, LineSegmentToJSON, LineSegmentToJSONTyped, LineSegmentTypeEnum, ListPolicies200ResponseFromJSON, ListPolicies200ResponseFromJSONTyped, ListPolicies200ResponseToJSON, ListPolicies200ResponseToJSONTyped, MaskRuleFromJSON, MaskRuleFromJSONTyped, MaskRuleToJSON, MaskRuleToJSONTyped, MaskRuleTypeEnum, ModelEntityFromJSON, ModelEntityFromJSONTyped, ModelEntityToJSON, ModelEntityToJSONTyped, ModelEntityTypeEnum, ModelErrorFromJSON, ModelErrorFromJSONTyped, ModelErrorToJSON, ModelErrorToJSONTyped, ModelResultFromJSON, ModelResultFromJSONTyped, ModelResultToJSON, ModelResultToJSONTyped, ModelResultTypeEnum, ModelStatusFromJSON, ModelStatusFromJSONTyped, ModelStatusToJSON, ModelStatusToJSONTyped, ModelTypeFromJSON, ModelTypeFromJSONTyped, ModelTypeToJSON, ModelTypeToJSONTyped, ParagraphKindFromJSON, ParagraphKindFromJSONTyped, ParagraphKindToJSON, ParagraphKindToJSONTyped, ParagraphSegmentFromJSON, ParagraphSegmentFromJSONTyped, ParagraphSegmentToJSON, ParagraphSegmentToJSONTyped, ParagraphSegmentTypeEnum, PartSegmentFromJSON, PartSegmentFromJSONTyped, PartSegmentToJSON, PartSegmentToJSONTyped, PartSegmentTypeEnum, PathSegmentFromJSON, PathSegmentFromJSONTyped, PathSegmentToJSON, PathSegmentToJSONTyped, PoliciesApi, PolicyDocumentFromJSON, PolicyDocumentFromJSONTyped, PolicyDocumentRulesInnerFromJSON, PolicyDocumentRulesInnerFromJSONTyped, PolicyDocumentRulesInnerToJSON, PolicyDocumentRulesInnerToJSONTyped, PolicyDocumentSchemaVersionEnum, PolicyDocumentToJSON, PolicyDocumentToJSONTyped, PolicyFromJSON, PolicyFromJSONTyped, PolicySummaryFromJSON, PolicySummaryFromJSONTyped, PolicySummaryToJSON, PolicySummaryToJSONTyped, PolicyToJSON, PolicyToJSONTyped, PropertySegmentFromJSON, PropertySegmentFromJSONTyped, PropertySegmentToJSON, PropertySegmentToJSONTyped, PropertySegmentTypeEnum, PseudonymizeRuleFromJSON, PseudonymizeRuleFromJSONTyped, PseudonymizeRuleToJSON, PseudonymizeRuleToJSONTyped, PseudonymizeRuleTypeEnum, RangeKind, RangeKindFromJSON, RangeKindFromJSONTyped, RangeKindToJSON, RangeKindToJSONTyped, RangeSegmentFromJSON, RangeSegmentFromJSONTyped, RangeSegmentToJSON, RangeSegmentToJSONTyped, RangeSegmentTypeEnum, RedactRuleFromJSON, RedactRuleFromJSONTyped, RedactRuleToJSON, RedactRuleToJSONTyped, RedactRuleTypeEnum, RefusalFromJSON, RefusalFromJSONTyped, RefusalToJSON, RefusalToJSONTyped, RegexEntityFromJSON, RegexEntityFromJSONTyped, RegexEntityToJSON, RegexEntityToJSONTyped, RegexEntityTypeEnum, RegexResultFromJSON, RegexResultFromJSONTyped, RegexResultToJSON, RegexResultToJSONTyped, RegexResultTypeEnum, RegionSegmentFromJSON, RegionSegmentFromJSONTyped, RegionSegmentToJSON, RegionSegmentToJSONTyped, RegionSegmentTypeEnum, ReplaceRuleFromJSON, ReplaceRuleFromJSONTyped, ReplaceRuleToJSON, ReplaceRuleToJSONTyped, ReplaceRuleTypeEnum, RequiredError, ResponseError, RuleBodyFromJSON, RuleBodyFromJSONTyped, RuleBodyToJSON, RuleBodyToJSONTyped, SHA256RuleFromJSON, SHA256RuleFromJSONTyped, SHA256RuleToJSON, SHA256RuleToJSONTyped, SHA256RuleTypeEnum, SHA512RuleFromJSON, SHA512RuleFromJSONTyped, SHA512RuleToJSON, SHA512RuleToJSONTyped, SHA512RuleTypeEnum, ScanRequestBodyFromJSON, ScanRequestBodyFromJSONTyped, ScanRequestBodyToJSON, ScanRequestBodyToJSONTyped, ScanResponseBodyFromJSON, ScanResponseBodyFromJSONTyped, ScanResponseBodyToJSON, ScanResponseBodyToJSONTyped, ScanResultFromJSON, ScanResultFromJSONTyped, ScanResultToJSON, ScanResultToJSONTyped, SegmentSegmentFromJSON, SegmentSegmentFromJSONTyped, SegmentSegmentToJSON, SegmentSegmentToJSONTyped, SegmentSegmentTypeEnum, SensitiveDataProtectionApi, ShapeKindFromJSON, ShapeKindFromJSONTyped, ShapeKindToJSON, ShapeKindToJSONTyped, ShapeSegmentFromJSON, ShapeSegmentFromJSONTyped, ShapeSegmentToJSON, ShapeSegmentToJSONTyped, ShapeSegmentTypeEnum, SheetSegmentFromJSON, SheetSegmentFromJSONTyped, SheetSegmentToJSON, SheetSegmentToJSONTyped, SheetSegmentTypeEnum, SlideSegmentFromJSON, SlideSegmentFromJSONTyped, SlideSegmentToJSON, SlideSegmentToJSONTyped, SlideSegmentTypeEnum, SpeakerNotesSegmentFromJSON, SpeakerNotesSegmentFromJSONTyped, SpeakerNotesSegmentToJSON, SpeakerNotesSegmentToJSONTyped, SpeakerNotesSegmentTypeEnum, TableSegmentFromJSON, TableSegmentFromJSONTyped, TableSegmentToJSON, TableSegmentToJSONTyped, TableSegmentTypeEnum, TagSegmentFromJSON, TagSegmentFromJSONTyped, TagSegmentToJSON, TagSegmentToJSONTyped, TagSegmentTypeEnum, TextApiResponse, TextRangeFromJSON, TextRangeFromJSONTyped, TextRangeToJSON, TextRangeToJSONTyped, TextSegmentFromJSON, TextSegmentFromJSONTyped, TextSegmentToJSON, TextSegmentToJSONTyped, TextSegmentTypeEnum, UpdatePolicyRequestFromJSON, UpdatePolicyRequestFromJSONTyped, UpdatePolicyRequestToJSON, UpdatePolicyRequestToJSONTyped, UsageFromJSON, UsageFromJSONTyped, UsageToJSON, UsageToJSONTyped, VoidApiResponse, canConsumeForm, exists, instanceOfAction, instanceOfAnonymizeFileResponseBody, instanceOfAnonymizeRequestBody, instanceOfAnonymizeResponseBody, instanceOfAt, instanceOfAttributeSegment, instanceOfCellNoteSegment, instanceOfCellSegment, instanceOfCommentKind, instanceOfCommentSegment, instanceOfComponentSegment, instanceOfCreatePolicyRequest, instanceOfDetectRule, instanceOfElementSegment, instanceOfEncryptRule, instanceOfEndnoteSegment, instanceOfErrorCode, instanceOfErrorInfo, instanceOfFieldError, instanceOfFieldErrorCode, instanceOfFieldErrorPathInner, instanceOfFieldSegment, instanceOfFileAttributeResult, instanceOfFileEmbeddedResult, instanceOfFileModelResult, instanceOfFileRegexResult, instanceOfFootnoteSegment, instanceOfFrameSegment, instanceOfHMACRule, instanceOfHeaderFooterSegment, instanceOfIndexSegment, instanceOfItemSegment, instanceOfKeySegment, instanceOfLineSegment, instanceOfListPolicies200Response, instanceOfMaskRule, instanceOfModelEntity, instanceOfModelError, instanceOfModelResult, instanceOfModelStatus, instanceOfParagraphSegment, instanceOfPartSegment, instanceOfPolicy, instanceOfPolicyDocument, instanceOfPolicySummary, instanceOfPropertySegment, instanceOfPseudonymizeRule, instanceOfRangeKind, instanceOfRangeSegment, instanceOfRedactRule, instanceOfRefusal, instanceOfRegexEntity, instanceOfRegexResult, instanceOfRegionSegment, instanceOfReplaceRule, instanceOfSHA256Rule, instanceOfSHA512Rule, instanceOfScanRequestBody, instanceOfScanResponseBody, instanceOfScanResult, instanceOfSegmentSegment, instanceOfShapeSegment, instanceOfSheetSegment, instanceOfSlideSegment, instanceOfSpeakerNotesSegment, instanceOfTableSegment, instanceOfTagSegment, instanceOfTextRange, instanceOfTextSegment, instanceOfUpdatePolicyRequest, instanceOfUsage, mapValues, querystring };