@azure/ai-text-analytics 5.1.1-alpha.20210716.1 → 5.1.1-alpha.20220901.1

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 (69) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +14 -13
  3. package/dist/index.js +758 -367
  4. package/dist/index.js.map +1 -1
  5. package/dist-esm/src/analyzeActionsResult.js +9 -9
  6. package/dist-esm/src/analyzeActionsResult.js.map +1 -1
  7. package/dist-esm/src/analyzeHealthcareEntitiesResult.js +4 -4
  8. package/dist-esm/src/analyzeHealthcareEntitiesResult.js.map +1 -1
  9. package/dist-esm/src/analyzeSentimentResult.js +5 -5
  10. package/dist-esm/src/analyzeSentimentResult.js.map +1 -1
  11. package/dist-esm/src/analyzeSentimentResultArray.js +1 -1
  12. package/dist-esm/src/analyzeSentimentResultArray.js.map +1 -1
  13. package/dist-esm/src/azureKeyCredentialPolicy.js +2 -2
  14. package/dist-esm/src/azureKeyCredentialPolicy.js.map +1 -1
  15. package/dist-esm/src/detectLanguageResult.js +1 -1
  16. package/dist-esm/src/detectLanguageResult.js.map +1 -1
  17. package/dist-esm/src/detectLanguageResultArray.js +1 -1
  18. package/dist-esm/src/detectLanguageResultArray.js.map +1 -1
  19. package/dist-esm/src/extractKeyPhrasesResult.js +1 -1
  20. package/dist-esm/src/extractKeyPhrasesResult.js.map +1 -1
  21. package/dist-esm/src/extractKeyPhrasesResultArray.js +1 -1
  22. package/dist-esm/src/extractKeyPhrasesResultArray.js.map +1 -1
  23. package/dist-esm/src/generated/generatedClient.js +41 -3
  24. package/dist-esm/src/generated/generatedClient.js.map +1 -1
  25. package/dist-esm/src/generated/index.js +0 -1
  26. package/dist-esm/src/generated/index.js.map +1 -1
  27. package/dist-esm/src/generated/models/index.js +514 -1
  28. package/dist-esm/src/generated/models/index.js.map +1 -1
  29. package/dist-esm/src/generated/models/mappers.js +5 -0
  30. package/dist-esm/src/generated/models/mappers.js.map +1 -1
  31. package/dist-esm/src/generated/models/parameters.js +1 -0
  32. package/dist-esm/src/generated/models/parameters.js.map +1 -1
  33. package/dist-esm/src/index.js +3 -3
  34. package/dist-esm/src/index.js.map +1 -1
  35. package/dist-esm/src/lro/analyze/operation.js +29 -71
  36. package/dist-esm/src/lro/analyze/operation.js.map +1 -1
  37. package/dist-esm/src/lro/analyze/poller.js +3 -3
  38. package/dist-esm/src/lro/analyze/poller.js.map +1 -1
  39. package/dist-esm/src/lro/health/operation.js +41 -82
  40. package/dist-esm/src/lro/health/operation.js.map +1 -1
  41. package/dist-esm/src/lro/health/poller.js +3 -3
  42. package/dist-esm/src/lro/health/poller.js.map +1 -1
  43. package/dist-esm/src/lro/poller.js +1 -1
  44. package/dist-esm/src/lro/poller.js.map +1 -1
  45. package/dist-esm/src/recognizeCategorizedEntitiesResult.js +1 -1
  46. package/dist-esm/src/recognizeCategorizedEntitiesResult.js.map +1 -1
  47. package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js +1 -1
  48. package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js.map +1 -1
  49. package/dist-esm/src/recognizeLinkedEntitiesResult.js +1 -1
  50. package/dist-esm/src/recognizeLinkedEntitiesResult.js.map +1 -1
  51. package/dist-esm/src/recognizeLinkedEntitiesResultArray.js +1 -1
  52. package/dist-esm/src/recognizeLinkedEntitiesResultArray.js.map +1 -1
  53. package/dist-esm/src/recognizePiiEntitiesResult.js +1 -1
  54. package/dist-esm/src/recognizePiiEntitiesResult.js.map +1 -1
  55. package/dist-esm/src/recognizePiiEntitiesResultArray.js +1 -1
  56. package/dist-esm/src/recognizePiiEntitiesResultArray.js.map +1 -1
  57. package/dist-esm/src/textAnalyticsClient.js +58 -149
  58. package/dist-esm/src/textAnalyticsClient.js.map +1 -1
  59. package/dist-esm/src/textAnalyticsResult.js +4 -14
  60. package/dist-esm/src/textAnalyticsResult.js.map +1 -1
  61. package/dist-esm/src/util.js +44 -29
  62. package/dist-esm/src/util.js.map +1 -1
  63. package/package.json +34 -36
  64. package/types/ai-text-analytics.d.ts +133 -32
  65. package/CHANGELOG.md +0 -144
  66. package/dist-esm/src/generated/generatedClientContext.js +0 -42
  67. package/dist-esm/src/generated/generatedClientContext.js.map +0 -1
  68. package/dist-esm/src/tracing.js +0 -12
  69. package/dist-esm/src/tracing.js.map +0 -1
package/dist/index.js CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- require('@azure/core-asynciterator-polyfill');
6
5
  var coreAuth = require('@azure/core-auth');
7
6
  var tslib = require('tslib');
8
7
  var coreRestPipeline = require('@azure/core-rest-pipeline');
@@ -12,6 +11,27 @@ var url = require('url');
12
11
  var coreTracing = require('@azure/core-tracing');
13
12
  var coreLro = require('@azure/core-lro');
14
13
 
14
+ function _interopNamespace(e) {
15
+ if (e && e.__esModule) return e;
16
+ var n = Object.create(null);
17
+ if (e) {
18
+ Object.keys(e).forEach(function (k) {
19
+ if (k !== 'default') {
20
+ var d = Object.getOwnPropertyDescriptor(e, k);
21
+ Object.defineProperty(n, k, d.get ? d : {
22
+ enumerable: true,
23
+ get: function () { return e[k]; }
24
+ });
25
+ }
26
+ });
27
+ }
28
+ n["default"] = e;
29
+ return Object.freeze(n);
30
+ }
31
+
32
+ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
33
+ var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
34
+
15
35
  // Copyright (c) Microsoft Corporation.
16
36
  // Licensed under the MIT license.
17
37
  /**
@@ -215,6 +235,7 @@ const EntitiesTaskParameters = {
215
235
  }
216
236
  },
217
237
  loggingOptOut: {
238
+ defaultValue: false,
218
239
  serializedName: "loggingOptOut",
219
240
  type: {
220
241
  name: "Boolean"
@@ -321,6 +342,7 @@ const KeyPhrasesTaskParameters = {
321
342
  }
322
343
  },
323
344
  loggingOptOut: {
345
+ defaultValue: false,
324
346
  serializedName: "loggingOptOut",
325
347
  type: {
326
348
  name: "Boolean"
@@ -357,6 +379,7 @@ const EntityLinkingTaskParameters = {
357
379
  }
358
380
  },
359
381
  loggingOptOut: {
382
+ defaultValue: false,
360
383
  serializedName: "loggingOptOut",
361
384
  type: {
362
385
  name: "Boolean"
@@ -399,12 +422,14 @@ const SentimentAnalysisTaskParameters = {
399
422
  }
400
423
  },
401
424
  loggingOptOut: {
425
+ defaultValue: false,
402
426
  serializedName: "loggingOptOut",
403
427
  type: {
404
428
  name: "Boolean"
405
429
  }
406
430
  },
407
431
  opinionMining: {
432
+ defaultValue: false,
408
433
  serializedName: "opinionMining",
409
434
  type: {
410
435
  name: "Boolean"
@@ -2628,6 +2653,7 @@ const top = {
2628
2653
  const skip = {
2629
2654
  parameterPath: ["options", "skip"],
2630
2655
  mapper: {
2656
+ defaultValue: 0,
2631
2657
  constraints: {
2632
2658
  InclusiveMinimum: 0
2633
2659
  },
@@ -2727,14 +2753,15 @@ const opinionMining = {
2727
2753
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
2728
2754
  */
2729
2755
  /** @internal */
2730
- class GeneratedClientContext extends coreClient.ServiceClient {
2756
+ class GeneratedClient extends coreClient__namespace.ServiceClient {
2731
2757
  /**
2732
- * Initializes a new instance of the GeneratedClientContext class.
2758
+ * Initializes a new instance of the GeneratedClient class.
2733
2759
  * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example:
2734
2760
  * https://westus.api.cognitive.microsoft.com).
2735
2761
  * @param options The parameter options
2736
2762
  */
2737
2763
  constructor(endpoint, options) {
2764
+ var _a, _b;
2738
2765
  if (endpoint === undefined) {
2739
2766
  throw new Error("'endpoint' cannot be null");
2740
2767
  }
@@ -2745,39 +2772,35 @@ class GeneratedClientContext extends coreClient.ServiceClient {
2745
2772
  const defaults = {
2746
2773
  requestContentType: "application/json; charset=utf-8"
2747
2774
  };
2748
- const packageDetails = `azsdk-js-ai-text-analytics/5.1.0`;
2775
+ const packageDetails = `azsdk-js-ai-text-analytics/5.1.1`;
2749
2776
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
2750
2777
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
2751
2778
  : `${packageDetails}`;
2752
2779
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
2753
2780
  userAgentPrefix
2754
- }, baseUri: options.endpoint || "{Endpoint}/text/analytics/{ApiVersion}" });
2781
+ }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{Endpoint}/text/analytics/{ApiVersion}" });
2755
2782
  super(optionsWithDefaults);
2783
+ if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
2784
+ const pipelinePolicies = options.pipeline.getOrderedPolicies();
2785
+ const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
2786
+ coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
2787
+ if (!bearerTokenAuthenticationPolicyFound) {
2788
+ this.pipeline.removePolicy({
2789
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
2790
+ });
2791
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
2792
+ scopes: `${optionsWithDefaults.baseUri}/.default`,
2793
+ challengeCallbacks: {
2794
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
2795
+ }
2796
+ }));
2797
+ }
2798
+ }
2756
2799
  // Parameter assignments
2757
2800
  this.endpoint = endpoint;
2758
2801
  // Assigning values to Constant parameters
2759
2802
  this.apiVersion = options.apiVersion || "v3.1";
2760
2803
  }
2761
- }
2762
-
2763
- /*
2764
- * Copyright (c) Microsoft Corporation.
2765
- * Licensed under the MIT License.
2766
- *
2767
- * Code generated by Microsoft (R) AutoRest Code Generator.
2768
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
2769
- */
2770
- /** @internal */
2771
- class GeneratedClient extends GeneratedClientContext {
2772
- /**
2773
- * Initializes a new instance of the GeneratedClient class.
2774
- * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example:
2775
- * https://westus.api.cognitive.microsoft.com).
2776
- * @param options The parameter options
2777
- */
2778
- constructor(endpoint, options) {
2779
- super(endpoint, options);
2780
- }
2781
2804
  /**
2782
2805
  * Submit a collection of text documents for analysis. Specify one or more unique tasks to be executed.
2783
2806
  * @param options The options parameters.
@@ -2886,7 +2909,7 @@ class GeneratedClient extends GeneratedClientContext {
2886
2909
  }
2887
2910
  }
2888
2911
  // Operation Specifications
2889
- const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
2912
+ const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
2890
2913
  const analyzeOperationSpec = {
2891
2914
  path: "/analyze",
2892
2915
  httpMethod: "POST",
@@ -3173,7 +3196,7 @@ function parseAssessmentIndex(pointer) {
3173
3196
  const assessmentIndex = {
3174
3197
  document: parseInt(res[1]),
3175
3198
  sentence: parseInt(res[2]),
3176
- assessment: parseInt(res[3])
3199
+ assessment: parseInt(res[3]),
3177
3200
  };
3178
3201
  return assessmentIndex;
3179
3202
  }
@@ -3257,7 +3280,7 @@ function nextLinkToTopAndSkip(nextLink) {
3257
3280
  }
3258
3281
  return {
3259
3282
  skip: skip,
3260
- top: top
3283
+ top: top,
3261
3284
  };
3262
3285
  }
3263
3286
  /**
@@ -3267,32 +3290,55 @@ function getOperationId(operationLocation) {
3267
3290
  const lastSlashIndex = operationLocation.lastIndexOf("/");
3268
3291
  return operationLocation.substring(lastSlashIndex + 1);
3269
3292
  }
3293
+ function appendReadableErrorMessage(currentMessage, innerMessage) {
3294
+ let message = currentMessage;
3295
+ if (message.slice(-1) !== ".") {
3296
+ message = message + ".";
3297
+ }
3298
+ return message + " " + innerMessage;
3299
+ }
3270
3300
  /**
3271
3301
  * @internal
3272
- * parses incoming errors from the service and if the inner error code is
3273
- * InvalidDocumentBatch, it exposes that as the statusCode instead.
3302
+ * parses incoming errors from the service/
3274
3303
  * @param error - the incoming error
3275
3304
  */
3276
- function handleInvalidDocumentBatch(error) {
3277
- var _a, _b, _c, _d, _e, _f, _g, _h;
3278
- const castError = error;
3279
- const innerCode = (_d = (_c = (_b = (_a = castError.response) === null || _a === void 0 ? void 0 : _a.parsedBody) === null || _b === void 0 ? void 0 : _b.error) === null || _c === void 0 ? void 0 : _c.innererror) === null || _d === void 0 ? void 0 : _d.code;
3280
- const innerMessage = (_h = (_g = (_f = (_e = castError.response) === null || _e === void 0 ? void 0 : _e.parsedBody) === null || _f === void 0 ? void 0 : _f.error) === null || _g === void 0 ? void 0 : _g.innererror) === null || _h === void 0 ? void 0 : _h.message;
3281
- if (innerMessage) {
3282
- return innerCode === "InvalidDocumentBatch"
3283
- ? new coreRestPipeline.RestError(innerMessage, { code: innerCode, statusCode: castError.statusCode })
3284
- : error;
3285
- }
3286
- else {
3287
- // unfortunately, the service currently does not follow the swagger definition
3288
- // for errors in some cases.
3289
- // Issue: https://msazure.visualstudio.com/Cognitive%20Services/_workitems/edit/8775003/?workitem=8972164
3290
- // throw new Error(
3291
- // `The error coming from the service does not follow the expected structure: ${error}`
3292
- // );
3293
- logger.warning(`The error coming from the service does not follow the expected structure: ${error}`);
3305
+ function transformError(errorResponse) {
3306
+ var _a;
3307
+ const strongErrorResponse = errorResponse;
3308
+ if (!strongErrorResponse.response) {
3309
+ throw errorResponse;
3310
+ }
3311
+ const topLevelError = (_a = strongErrorResponse.response.parsedBody) === null || _a === void 0 ? void 0 : _a.error;
3312
+ if (!topLevelError)
3313
+ return errorResponse;
3314
+ let errorMessage = topLevelError.message;
3315
+ let code = topLevelError.code;
3316
+ function unwrap(error) {
3317
+ const innerError = error.innererror;
3318
+ if (innerError) {
3319
+ if (innerError.message) {
3320
+ errorMessage = appendReadableErrorMessage(errorMessage, innerError.message);
3321
+ }
3322
+ if (innerError.code) {
3323
+ code = innerError.code;
3324
+ }
3325
+ return unwrap(innerError);
3326
+ }
3294
3327
  return error;
3295
3328
  }
3329
+ unwrap(topLevelError);
3330
+ return new coreRestPipeline.RestError(errorMessage, {
3331
+ code: code === "InvalidDocumentBatch" ? code : topLevelError.code,
3332
+ statusCode: strongErrorResponse.statusCode,
3333
+ });
3334
+ }
3335
+ async function throwError(p) {
3336
+ try {
3337
+ return await p;
3338
+ }
3339
+ catch (e) {
3340
+ throw transformError(e);
3341
+ }
3296
3342
  }
3297
3343
  /**
3298
3344
  * A wrapper for setTimeout that resolves a promise after t milliseconds.
@@ -3325,7 +3371,7 @@ function intoTextAnalyticsError(errorModel) {
3325
3371
  return {
3326
3372
  code: errorModel.code,
3327
3373
  message: errorModel.message,
3328
- target: errorModel.target
3374
+ target: errorModel.target,
3329
3375
  };
3330
3376
  }
3331
3377
  /**
@@ -3335,7 +3381,7 @@ function makeTextAnalyticsSuccessResult(id, warnings, statistics) {
3335
3381
  return {
3336
3382
  id,
3337
3383
  statistics,
3338
- warnings
3384
+ warnings,
3339
3385
  };
3340
3386
  }
3341
3387
  /**
@@ -3344,7 +3390,7 @@ function makeTextAnalyticsSuccessResult(id, warnings, statistics) {
3344
3390
  function makeTextAnalyticsErrorResult(id, error) {
3345
3391
  return {
3346
3392
  id,
3347
- error: intoTextAnalyticsError(error)
3393
+ error: intoTextAnalyticsError(error),
3348
3394
  };
3349
3395
  }
3350
3396
  /**
@@ -3372,7 +3418,7 @@ function combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion(inp
3372
3418
  const sorted = processAndCombineSuccessfulAndErroneousDocuments(input, response, processSuccess, processError);
3373
3419
  return Object.assign(sorted, {
3374
3420
  statistics: response.statistics,
3375
- modelVersion: response.modelVersion
3421
+ modelVersion: response.modelVersion,
3376
3422
  });
3377
3423
  }
3378
3424
 
@@ -3428,7 +3474,7 @@ function makeRecognizeCategorizedEntitiesResultArray(input, response) {
3428
3474
  * @internal
3429
3475
  */
3430
3476
  function makeAnalyzeSentimentResult(result) {
3431
- const { id, sentiment, confidenceScores, sentenceSentiments: sentences, warnings, statistics } = result;
3477
+ const { id, sentiment, confidenceScores, sentenceSentiments: sentences, warnings, statistics, } = result;
3432
3478
  return Object.assign(Object.assign({}, makeTextAnalyticsSuccessResult(id, warnings, statistics)), { sentiment,
3433
3479
  confidenceScores, sentences: sentences.map((sentence) => convertGeneratedSentenceSentiment(sentence, result)) });
3434
3480
  }
@@ -3461,13 +3507,13 @@ function convertGeneratedSentenceSentiment(sentence, result) {
3461
3507
  sentiment: target.sentiment,
3462
3508
  text: target.text,
3463
3509
  offset: target.offset,
3464
- length: target.length
3510
+ length: target.length,
3465
3511
  },
3466
3512
  assessments: target.relations
3467
3513
  .filter((relation) => relation.relationType === "assessment")
3468
- .map((relation) => convertTargetRelationToAssessmentSentiment(relation, result))
3514
+ .map((relation) => convertTargetRelationToAssessmentSentiment(relation, result)),
3469
3515
  }))
3470
- : []
3516
+ : [],
3471
3517
  };
3472
3518
  }
3473
3519
  /**
@@ -3571,16 +3617,6 @@ function makeRecognizeLinkedEntitiesResultArray(input, response) {
3571
3617
  return combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion(input, response, makeRecognizeLinkedEntitiesResult, makeRecognizeLinkedEntitiesErrorResult);
3572
3618
  }
3573
3619
 
3574
- // Copyright (c) Microsoft Corporation.
3575
- /**
3576
- * Creates a span using the global tracer.
3577
- * @internal
3578
- */
3579
- const createSpan = coreTracing.createSpanFunction({
3580
- packagePrefix: "Azure.CognitiveServices.TextAnalytics",
3581
- namespace: "Microsoft.CognitiveServices"
3582
- });
3583
-
3584
3620
  // Copyright (c) Microsoft Corporation.
3585
3621
  // Licensed under the MIT license.
3586
3622
  const API_KEY_HEADER_NAME = "Ocp-Apim-Subscription-Key";
@@ -3599,7 +3635,7 @@ function textAnalyticsAzureKeyCredentialPolicy(credential) {
3599
3635
  sendRequest(request, next) {
3600
3636
  request.headers.set(API_KEY_HEADER_NAME, credential.key);
3601
3637
  return next(request);
3602
- }
3638
+ },
3603
3639
  };
3604
3640
  }
3605
3641
 
@@ -3636,7 +3672,7 @@ class AnalysisPollOperation {
3636
3672
  */
3637
3673
  toString() {
3638
3674
  return JSON.stringify({
3639
- state: this.state
3675
+ state: this.state,
3640
3676
  });
3641
3677
  }
3642
3678
  }
@@ -3659,7 +3695,7 @@ function makeHealthcareEntitiesWithoutNeighbors(entity) {
3659
3695
  text,
3660
3696
  normalizedText: name,
3661
3697
  subCategory: subcategory,
3662
- dataSources: (_a = links === null || links === void 0 ? void 0 : links.map(({ dataSource, id }) => ({ name: dataSource, entityId: id }))) !== null && _a !== void 0 ? _a : []
3698
+ dataSources: (_a = links === null || links === void 0 ? void 0 : links.map(({ dataSource, id }) => ({ name: dataSource, entityId: id }))) !== null && _a !== void 0 ? _a : [],
3663
3699
  };
3664
3700
  }
3665
3701
  /**
@@ -3670,8 +3706,8 @@ function makeHealthcareRelations(entities, relations) {
3670
3706
  relationType: relation.relationType,
3671
3707
  roles: relation.entities.map((role) => ({
3672
3708
  entity: entities[parseHealthcareEntityIndex(role.ref)],
3673
- name: role.role
3674
- }))
3709
+ name: role.role,
3710
+ })),
3675
3711
  }));
3676
3712
  }
3677
3713
  /**
@@ -3695,12 +3731,12 @@ function makeHealthcareEntitiesErrorResult(id, error) {
3695
3731
  /**
3696
3732
  * @internal
3697
3733
  */
3698
- function getMetaInfoFromResponse(response) {
3734
+ function getMetaInfoFromResponse$1(response) {
3699
3735
  return {
3700
3736
  createdOn: response.createdDateTime,
3701
3737
  lastModifiedOn: response.lastUpdateDateTime,
3702
3738
  expiresOn: response.expirationDateTime,
3703
- status: response.status
3739
+ status: response.status,
3704
3740
  };
3705
3741
  }
3706
3742
  /**
@@ -3710,10 +3746,11 @@ function getMetaInfoFromResponse(response) {
3710
3746
  class BeginAnalyzeHealthcarePollerOperation extends AnalysisPollOperation {
3711
3747
  constructor(state,
3712
3748
  // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters
3713
- client, documents, options = {}) {
3749
+ client, tracing, documents, options = {}) {
3714
3750
  super(state);
3715
3751
  this.state = state;
3716
3752
  this.client = client;
3753
+ this.tracing = tracing;
3717
3754
  this.documents = documents;
3718
3755
  this.options = options;
3719
3756
  }
@@ -3734,7 +3771,7 @@ class BeginAnalyzeHealthcarePollerOperation extends AnalysisPollOperation {
3734
3771
  byPage: (settings) => {
3735
3772
  const pageOptions = Object.assign(Object.assign({}, options), { top: settings === null || settings === void 0 ? void 0 : settings.maxPageSize });
3736
3773
  return this._listHealthcareEntitiesPaged(operationId, pageOptions);
3737
- }
3774
+ },
3738
3775
  };
3739
3776
  }
3740
3777
  /**
@@ -3776,27 +3813,14 @@ class BeginAnalyzeHealthcarePollerOperation extends AnalysisPollOperation {
3776
3813
  * returns an iterator to arrays of the sorted results of a healthcare operation.
3777
3814
  */
3778
3815
  async _listHealthcareEntitiesSinglePage(operationId, options) {
3779
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-_listHealthcareEntitiesSinglePage", options || {});
3780
- try {
3781
- const response = await this.client.healthStatus(operationId, finalOptions);
3782
- if (response.results) {
3783
- const result = processAndCombineSuccessfulAndErroneousDocuments(this.documents, response.results, makeHealthcareEntitiesResult, makeHealthcareEntitiesErrorResult);
3784
- return response.nextLink
3785
- ? Object.assign({ result }, nextLinkToTopAndSkip(response.nextLink)) : { result };
3786
- }
3787
- else {
3788
- throw new Error("Healthcare action has succeeded but the there are no results!");
3789
- }
3790
- }
3791
- catch (e) {
3792
- span.setStatus({
3793
- code: coreTracing.SpanStatusCode.ERROR,
3794
- message: e.message
3795
- });
3796
- throw e;
3816
+ const response = await this.tracing.withSpan("TextAnalyticsClient-_listHealthcareEntitiesSinglePage", options || {}, (finalOptions) => this.client.healthStatus(operationId, finalOptions));
3817
+ if (response.results) {
3818
+ const result = processAndCombineSuccessfulAndErroneousDocuments(this.documents, response.results, makeHealthcareEntitiesResult, makeHealthcareEntitiesErrorResult);
3819
+ return response.nextLink
3820
+ ? Object.assign({ result }, nextLinkToTopAndSkip(response.nextLink)) : { result };
3797
3821
  }
3798
- finally {
3799
- span.end();
3822
+ else {
3823
+ throw new Error("Healthcare action has succeeded but the there are no results!");
3800
3824
  }
3801
3825
  }
3802
3826
  /**
@@ -3805,61 +3829,34 @@ class BeginAnalyzeHealthcarePollerOperation extends AnalysisPollOperation {
3805
3829
  */
3806
3830
  async getHealthStatus(operationId, options) {
3807
3831
  var _a;
3808
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-getHealthStatus", options || {});
3809
- try {
3810
- const response = await this.client.healthStatus(operationId, finalOptions);
3811
- switch (response.status) {
3812
- case "notStarted":
3813
- case "running":
3814
- break;
3815
- case "failed": {
3816
- const errors = (_a = response.errors) === null || _a === void 0 ? void 0 : _a.map((e) => ` code ${e.code}, message: '${e.message}'`).join("\n");
3817
- const message = `Healthcare analysis failed. Error(s): ${errors || ""}`;
3818
- throw new Error(message);
3819
- }
3820
- default: {
3821
- if (response.results) {
3822
- return {
3823
- done: true,
3824
- statistics: response.results.statistics,
3825
- modelVersion: response.results.modelVersion,
3826
- operationMetdata: getMetaInfoFromResponse(response)
3827
- };
3828
- }
3829
- else {
3830
- throw new Error("Healthcare action has finished but the there are no results!");
3831
- }
3832
+ const response = await this.tracing.withSpan("TextAnalyticsClient-getHealthStatus", options || {}, (finalOptions) => this.client.healthStatus(operationId, finalOptions));
3833
+ switch (response.status) {
3834
+ case "notStarted":
3835
+ case "running":
3836
+ break;
3837
+ case "failed": {
3838
+ const errors = (_a = response.errors) === null || _a === void 0 ? void 0 : _a.map((e) => ` code ${e.code}, message: '${e.message}'`).join("\n");
3839
+ const message = `Healthcare analysis failed. Error(s): ${errors || ""}`;
3840
+ throw new Error(message);
3841
+ }
3842
+ default: {
3843
+ if (response.results) {
3844
+ return {
3845
+ done: true,
3846
+ statistics: response.results.statistics,
3847
+ modelVersion: response.results.modelVersion,
3848
+ operationMetdata: getMetaInfoFromResponse$1(response),
3849
+ };
3850
+ }
3851
+ else {
3852
+ throw new Error("Healthcare action has finished but the there are no results!");
3832
3853
  }
3833
3854
  }
3834
- return { done: false, operationMetdata: getMetaInfoFromResponse(response) };
3835
- }
3836
- catch (e) {
3837
- span.setStatus({
3838
- code: coreTracing.SpanStatusCode.ERROR,
3839
- message: e.message
3840
- });
3841
- throw e;
3842
- }
3843
- finally {
3844
- span.end();
3845
3855
  }
3856
+ return { done: false, operationMetdata: getMetaInfoFromResponse$1(response) };
3846
3857
  }
3847
3858
  async beginAnalyzeHealthcare(documents, options) {
3848
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-beginAnalyzeHealthcare", addStrEncodingParam(options || {}));
3849
- try {
3850
- return await this.client.health({ documents: documents }, finalOptions);
3851
- }
3852
- catch (e) {
3853
- const exception = handleInvalidDocumentBatch(e);
3854
- span.setStatus({
3855
- code: coreTracing.SpanStatusCode.ERROR,
3856
- message: exception.message
3857
- });
3858
- throw exception;
3859
- }
3860
- finally {
3861
- span.end();
3862
- }
3859
+ return this.tracing.withSpan("TextAnalyticsClient-beginAnalyzeHealthcare", addStrEncodingParam(options || {}), (finalOptions) => throwError(this.client.health({ documents: documents }, finalOptions)));
3863
3860
  }
3864
3861
  async update(options = {}) {
3865
3862
  const state = this.state;
@@ -3872,7 +3869,7 @@ class BeginAnalyzeHealthcarePollerOperation extends AnalysisPollOperation {
3872
3869
  abortSignal: updatedAbortSignal ? updatedAbortSignal : options.abortSignal,
3873
3870
  modelVersion: this.options.modelVersion,
3874
3871
  stringIndexType: this.options.stringIndexType,
3875
- loggingOptOut: this.options.disableServiceLogs
3872
+ loggingOptOut: this.options.disableServiceLogs,
3876
3873
  });
3877
3874
  if (!response.operationLocation) {
3878
3875
  throw new Error("Expects a valid 'operationLocation' to retrieve health results but did not find any");
@@ -3884,7 +3881,7 @@ class BeginAnalyzeHealthcarePollerOperation extends AnalysisPollOperation {
3884
3881
  includeStatistics: this.options.includeStatistics,
3885
3882
  tracingOptions: this.options.tracingOptions,
3886
3883
  onResponse: this.options.onResponse,
3887
- serializerOptions: this.options.serializerOptions
3884
+ serializerOptions: this.options.serializerOptions,
3888
3885
  });
3889
3886
  state.createdOn = operationStatus.operationMetdata.createdOn;
3890
3887
  state.expiresOn = operationStatus.operationMetdata.expiresOn;
@@ -3893,11 +3890,11 @@ class BeginAnalyzeHealthcarePollerOperation extends AnalysisPollOperation {
3893
3890
  if (!state.isCompleted && operationStatus.done) {
3894
3891
  const pagedIterator = this.listHealthcareEntitiesByPage(state.operationId, {
3895
3892
  abortSignal: this.options.abortSignal,
3896
- tracingOptions: this.options.tracingOptions
3893
+ tracingOptions: this.options.tracingOptions,
3897
3894
  });
3898
3895
  state.result = Object.assign(pagedIterator, {
3899
3896
  statistics: operationStatus.statistics,
3900
- modelVersion: operationStatus.modelVersion
3897
+ modelVersion: operationStatus.modelVersion,
3901
3898
  });
3902
3899
  state.isCompleted = true;
3903
3900
  }
@@ -3911,7 +3908,7 @@ class BeginAnalyzeHealthcarePollerOperation extends AnalysisPollOperation {
3911
3908
  if (state.operationId) {
3912
3909
  await this.client.cancelHealthJob(state.operationId, {
3913
3910
  abortSignal: this.options.abortSignal,
3914
- tracingOptions: this.options.tracingOptions
3911
+ tracingOptions: this.options.tracingOptions,
3915
3912
  });
3916
3913
  }
3917
3914
  state.isCancelled = true;
@@ -3927,12 +3924,12 @@ class BeginAnalyzeHealthcarePollerOperation extends AnalysisPollOperation {
3927
3924
  class BeginAnalyzeHealthcarePoller extends AnalysisPoller {
3928
3925
  // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters
3929
3926
  constructor(inputs) {
3930
- const { client, documents, options, updateIntervalInMs = 5000, resumeFrom } = inputs;
3927
+ const { client, tracing, documents, options, updateIntervalInMs = 5000, resumeFrom } = inputs;
3931
3928
  let state;
3932
3929
  if (resumeFrom) {
3933
3930
  state = JSON.parse(resumeFrom).state;
3934
3931
  }
3935
- const operation = new BeginAnalyzeHealthcarePollerOperation((state || {}), client, documents, options);
3932
+ const operation = new BeginAnalyzeHealthcarePollerOperation((state || {}), client, tracing, documents, options);
3936
3933
  super(operation);
3937
3934
  this.updateIntervalInMs = updateIntervalInMs;
3938
3935
  }
@@ -3985,7 +3982,7 @@ function parseActionError(erredActions) {
3985
3982
  code: erredActions.code,
3986
3983
  message: erredActions.message,
3987
3984
  index: parseInt(result[2]),
3988
- type: convertTaskTypeToActionType(result[1])
3985
+ type: convertTaskTypeToActionType(result[1]),
3989
3986
  };
3990
3987
  }
3991
3988
  else {
@@ -4057,8 +4054,8 @@ function makeActionResult(documents, makeResultsArray, succeededTasks, erredActi
4057
4054
  ...actions,
4058
4055
  {
4059
4056
  results: recognizeEntitiesResults,
4060
- completedOn: lastUpdateDateTime
4061
- }
4057
+ completedOn: lastUpdateDateTime,
4058
+ },
4062
4059
  ];
4063
4060
  }
4064
4061
  else {
@@ -4087,7 +4084,7 @@ function createAnalyzeActionsResult(response, documents) {
4087
4084
  recognizePiiEntitiesResults: makeActionResult(documents, makeRecognizePiiEntitiesResultArray, (_c = response.tasks.entityRecognitionPiiTasks) !== null && _c !== void 0 ? _c : [], recognizePiiEntitiesActionErrors),
4088
4085
  extractKeyPhrasesResults: makeActionResult(documents, makeExtractKeyPhrasesResultArray, (_d = response.tasks.keyPhraseExtractionTasks) !== null && _d !== void 0 ? _d : [], extractKeyPhrasesActionErrors),
4089
4086
  recognizeLinkedEntitiesResults: makeActionResult(documents, makeRecognizeLinkedEntitiesResultArray, (_e = response.tasks.entityLinkingTasks) !== null && _e !== void 0 ? _e : [], recognizeLinkedEntitiesActionErrors),
4090
- analyzeSentimentResults: makeActionResult(documents, makeAnalyzeSentimentResultArray, (_f = response.tasks.sentimentAnalysisTasks) !== null && _f !== void 0 ? _f : [], analyzeSentimentActionErrors)
4087
+ analyzeSentimentResults: makeActionResult(documents, makeAnalyzeSentimentResultArray, (_f = response.tasks.sentimentAnalysisTasks) !== null && _f !== void 0 ? _f : [], analyzeSentimentActionErrors),
4091
4088
  };
4092
4089
  }
4093
4090
 
@@ -4095,7 +4092,7 @@ function createAnalyzeActionsResult(response, documents) {
4095
4092
  /**
4096
4093
  * @internal
4097
4094
  */
4098
- function getMetaInfoFromResponse$1(response) {
4095
+ function getMetaInfoFromResponse(response) {
4099
4096
  return {
4100
4097
  createdOn: response.createdDateTime,
4101
4098
  lastModifiedOn: response.lastUpdateDateTime,
@@ -4104,7 +4101,7 @@ function getMetaInfoFromResponse$1(response) {
4104
4101
  actionsSucceededCount: response.tasks.completed,
4105
4102
  actionsFailedCount: response.tasks.failed,
4106
4103
  actionsInProgressCount: response.tasks.inProgress,
4107
- displayName: response.displayName
4104
+ displayName: response.displayName,
4108
4105
  };
4109
4106
  }
4110
4107
  /**
@@ -4115,10 +4112,11 @@ function getMetaInfoFromResponse$1(response) {
4115
4112
  class BeginAnalyzeActionsPollerOperation extends AnalysisPollOperation {
4116
4113
  constructor(state,
4117
4114
  // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters
4118
- client, documents, actions, options = {}) {
4115
+ client, tracing, documents, actions, options = {}) {
4119
4116
  super(state);
4120
4117
  this.state = state;
4121
4118
  this.client = client;
4119
+ this.tracing = tracing;
4122
4120
  this.documents = documents;
4123
4121
  this.actions = actions;
4124
4122
  this.options = options;
@@ -4140,7 +4138,7 @@ class BeginAnalyzeActionsPollerOperation extends AnalysisPollOperation {
4140
4138
  byPage: (settings) => {
4141
4139
  const pageOptions = Object.assign(Object.assign({}, options), { top: settings === null || settings === void 0 ? void 0 : settings.maxPageSize });
4142
4140
  return this._listAnalyzeActionsResultsPaged(operationId, pageOptions);
4143
- }
4141
+ },
4144
4142
  };
4145
4143
  }
4146
4144
  /**
@@ -4161,77 +4159,36 @@ class BeginAnalyzeActionsPollerOperation extends AnalysisPollOperation {
4161
4159
  * returns an iterator to arrays of the sorted results of an analyze actions operation.
4162
4160
  */
4163
4161
  async _listAnalyzeActionsResultsSinglePage(operationId, options) {
4164
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-_listAnalyzeActionsResultsSinglePage", options || {});
4165
- try {
4166
- const response = await this.client.analyzeStatus(operationId, finalOptions);
4167
- const result = createAnalyzeActionsResult(response, this.documents);
4168
- return response.nextLink
4169
- ? Object.assign({ result }, nextLinkToTopAndSkip(response.nextLink)) : { result };
4170
- }
4171
- catch (e) {
4172
- span.setStatus({
4173
- code: coreTracing.SpanStatusCode.ERROR,
4174
- message: e.message
4175
- });
4176
- throw e;
4177
- }
4178
- finally {
4179
- span.end();
4180
- }
4162
+ const response = await this.tracing.withSpan("TextAnalyticsClient-_listAnalyzeActionsResultsSinglePage", options || {}, (finalOptions) => this.client.analyzeStatus(operationId, finalOptions));
4163
+ const result = createAnalyzeActionsResult(response, this.documents);
4164
+ return response.nextLink ? Object.assign({ result }, nextLinkToTopAndSkip(response.nextLink)) : { result };
4181
4165
  }
4182
4166
  /**
4183
4167
  * returns whether the analyze actions operation is done and if so returns also
4184
4168
  * statistics.
4185
4169
  */
4186
4170
  async getAnalyzeActionsOperationStatus(operationId, options) {
4187
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-getAnalyzeActionsOperationStatus", options || {});
4188
- try {
4189
- const response = await this.client.analyzeStatus(operationId, finalOptions);
4190
- switch (response.status) {
4191
- case "notStarted":
4192
- case "running":
4193
- break;
4194
- default: {
4195
- return {
4196
- done: true,
4197
- statistics: response.statistics,
4198
- operationMetdata: getMetaInfoFromResponse$1(response)
4199
- };
4200
- }
4171
+ const response = await this.tracing.withSpan("TextAnalyticsClient-getAnalyzeActionsOperationStatus", options || {}, (finalOptions) => this.client.analyzeStatus(operationId, finalOptions));
4172
+ switch (response.status) {
4173
+ case "notStarted":
4174
+ case "running":
4175
+ break;
4176
+ default: {
4177
+ return {
4178
+ done: true,
4179
+ statistics: response.statistics,
4180
+ operationMetdata: getMetaInfoFromResponse(response),
4181
+ };
4201
4182
  }
4202
- return { done: false, operationMetdata: getMetaInfoFromResponse$1(response) };
4203
- }
4204
- catch (e) {
4205
- span.setStatus({
4206
- code: coreTracing.SpanStatusCode.ERROR,
4207
- message: e.message
4208
- });
4209
- throw e;
4210
- }
4211
- finally {
4212
- span.end();
4213
4183
  }
4184
+ return { done: false, operationMetdata: getMetaInfoFromResponse(response) };
4214
4185
  }
4215
4186
  async beginAnalyzeActions(documents, actions, options) {
4216
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-beginAnalyze", options || {});
4217
- try {
4218
- return await this.client.analyze(Object.assign({ body: {
4219
- analysisInput: { documents: documents },
4220
- tasks: actions,
4221
- displayName: options === null || options === void 0 ? void 0 : options.displayName
4222
- } }, finalOptions));
4223
- }
4224
- catch (e) {
4225
- const exception = handleInvalidDocumentBatch(e);
4226
- span.setStatus({
4227
- code: coreTracing.SpanStatusCode.ERROR,
4228
- message: exception.message
4229
- });
4230
- throw exception;
4231
- }
4232
- finally {
4233
- span.end();
4234
- }
4187
+ return this.tracing.withSpan("TextAnalyticsClient-beginAnalyze", options || {}, (finalOptions) => throwError(this.client.analyze(Object.assign({ body: {
4188
+ analysisInput: { documents: documents },
4189
+ tasks: actions,
4190
+ displayName: options === null || options === void 0 ? void 0 : options.displayName,
4191
+ } }, finalOptions))));
4235
4192
  }
4236
4193
  async update(options = {}) {
4237
4194
  var _a;
@@ -4243,7 +4200,7 @@ class BeginAnalyzeActionsPollerOperation extends AnalysisPollOperation {
4243
4200
  displayName: this.options.displayName,
4244
4201
  tracingOptions: this.options.tracingOptions,
4245
4202
  requestOptions: this.options.requestOptions,
4246
- abortSignal: updatedAbortSignal ? updatedAbortSignal : this.options.abortSignal
4203
+ abortSignal: updatedAbortSignal ? updatedAbortSignal : this.options.abortSignal,
4247
4204
  });
4248
4205
  if (!response.operationLocation) {
4249
4206
  throw new Error("Expects a valid 'operationLocation' to retrieve analyze results but did not find any");
@@ -4253,7 +4210,7 @@ class BeginAnalyzeActionsPollerOperation extends AnalysisPollOperation {
4253
4210
  const operationStatus = await this.getAnalyzeActionsOperationStatus(state.operationId, {
4254
4211
  abortSignal: updatedAbortSignal ? updatedAbortSignal : options.abortSignal,
4255
4212
  includeStatistics: this.options.includeStatistics,
4256
- tracingOptions: this.options.tracingOptions
4213
+ tracingOptions: this.options.tracingOptions,
4257
4214
  });
4258
4215
  state.createdOn = operationStatus.operationMetdata.createdOn;
4259
4216
  state.expiresOn = operationStatus.operationMetdata.expiresOn;
@@ -4269,7 +4226,7 @@ class BeginAnalyzeActionsPollerOperation extends AnalysisPollOperation {
4269
4226
  tracingOptions: this.options.tracingOptions,
4270
4227
  includeStatistics: this.options.includeStatistics,
4271
4228
  onResponse: this.options.onResponse,
4272
- serializerOptions: this.options.serializerOptions
4229
+ serializerOptions: this.options.serializerOptions,
4273
4230
  });
4274
4231
  // Attach stats if the service starts to return them
4275
4232
  // https://github.com/Azure/azure-sdk-for-js/issues/14139
@@ -4300,12 +4257,12 @@ class BeginAnalyzeActionsPollerOperation extends AnalysisPollOperation {
4300
4257
  class BeginAnalyzeActionsPoller extends AnalysisPoller {
4301
4258
  // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters
4302
4259
  constructor(pollerOptions) {
4303
- const { client, documents, actions, options, updateIntervalInMs = 5000, resumeFrom } = pollerOptions;
4260
+ const { client, tracing, documents, actions, options, updateIntervalInMs = 5000, resumeFrom, } = pollerOptions;
4304
4261
  let state;
4305
4262
  if (resumeFrom) {
4306
4263
  state = JSON.parse(resumeFrom).state;
4307
4264
  }
4308
- const operation = new BeginAnalyzeActionsPollerOperation((state || {}), client, documents, actions, options);
4265
+ const operation = new BeginAnalyzeActionsPollerOperation((state || {}), client, tracing, documents, actions, options);
4309
4266
  super(operation);
4310
4267
  this.updateIntervalInMs = updateIntervalInMs;
4311
4268
  }
@@ -4316,6 +4273,10 @@ class BeginAnalyzeActionsPoller extends AnalysisPoller {
4316
4273
 
4317
4274
  // Copyright (c) Microsoft Corporation.
4318
4275
  const DEFAULT_COGNITIVE_SCOPE = "https://cognitiveservices.azure.com/.default";
4276
+ /**
4277
+ * The types of PII domains the user can choose from.
4278
+ */
4279
+ exports.PiiEntityDomain = void 0;
4319
4280
  (function (PiiEntityDomain) {
4320
4281
  /**
4321
4282
  * @see {@link https://aka.ms/tanerpii} for more information.
@@ -4360,14 +4321,19 @@ class TextAnalyticsClient {
4360
4321
  const internalPipelineOptions = Object.assign(Object.assign({}, pipelineOptions), {
4361
4322
  loggingOptions: {
4362
4323
  logger: logger.info,
4363
- additionalAllowedHeaderNames: ["x-ms-correlation-request-id", "x-ms-request-id"]
4364
- }
4324
+ additionalAllowedHeaderNames: ["x-ms-correlation-request-id", "x-ms-request-id"],
4325
+ },
4365
4326
  });
4366
4327
  this.client = new GeneratedClient(this.endpointUrl, internalPipelineOptions);
4367
4328
  const authPolicy = coreAuth.isTokenCredential(credential)
4368
4329
  ? coreRestPipeline.bearerTokenAuthenticationPolicy({ credential, scopes: DEFAULT_COGNITIVE_SCOPE })
4369
4330
  : textAnalyticsAzureKeyCredentialPolicy(credential);
4370
4331
  this.client.pipeline.addPolicy(authPolicy);
4332
+ this._tracing = coreTracing.createTracingClient({
4333
+ packageName: "@azure/ai-text-analytics",
4334
+ packageVersion: SDK_VERSION,
4335
+ namespace: "Microsoft.CognitiveServices",
4336
+ });
4371
4337
  }
4372
4338
  async detectLanguage(documents, countryHintOrOptions, options) {
4373
4339
  let realOptions;
@@ -4385,23 +4351,11 @@ class TextAnalyticsClient {
4385
4351
  realInputs = documents.map((input) => (Object.assign(Object.assign({}, input), { countryHint: input.countryHint === "none" ? "" : input.countryHint })));
4386
4352
  realOptions = countryHintOrOptions || {};
4387
4353
  }
4388
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-detectLanguages", makeGeneratedDetectLanguageOptions(realOptions));
4389
- try {
4390
- const result = await this.client.languages({
4391
- documents: realInputs
4392
- }, finalOptions);
4393
- return makeDetectLanguageResultArray(realInputs, result);
4394
- }
4395
- catch (e) {
4396
- span.setStatus({
4397
- code: coreTracing.SpanStatusCode.ERROR,
4398
- message: e.message
4399
- });
4400
- throw e;
4401
- }
4402
- finally {
4403
- span.end();
4404
- }
4354
+ return this._tracing.withSpan("TextAnalyticsClient-detectLanguages", makeGeneratedDetectLanguageOptions(realOptions), (finalOptions) => this.client
4355
+ .languages({
4356
+ documents: realInputs,
4357
+ }, finalOptions)
4358
+ .then((result) => makeDetectLanguageResultArray(realInputs, result)));
4405
4359
  }
4406
4360
  async recognizeEntities(documents, languageOrOptions,
4407
4361
  // eslint-disable-next-line @azure/azure-sdk/ts-naming-options
@@ -4420,32 +4374,9 @@ class TextAnalyticsClient {
4420
4374
  realInputs = documents;
4421
4375
  realOptions = languageOrOptions || {};
4422
4376
  }
4423
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-recognizeEntities", makeGeneratedRecognizeCategorizedEntitiesOptions(realOptions));
4424
- try {
4425
- const result = await this.client.entitiesRecognitionGeneral({
4426
- documents: realInputs
4427
- }, finalOptions);
4428
- return makeRecognizeCategorizedEntitiesResultArray(realInputs, result);
4429
- }
4430
- catch (e) {
4431
- /**
4432
- * This special logic handles REST exception with code
4433
- * InvalidDocumentBatch and is needed to maintain backward compatability
4434
- * with sdk v5.0.0 and earlier. In general, REST exceptions are thrown as
4435
- * is and include both outer and inner exception codes. However, the
4436
- * earlier versions were throwing an exception that included the inner
4437
- * code only.
4438
- */
4439
- const backwardCompatibleException = handleInvalidDocumentBatch(e);
4440
- span.setStatus({
4441
- code: coreTracing.SpanStatusCode.ERROR,
4442
- message: backwardCompatibleException.message
4443
- });
4444
- throw backwardCompatibleException;
4445
- }
4446
- finally {
4447
- span.end();
4448
- }
4377
+ return this._tracing.withSpan("TextAnalyticsClient-recognizeEntities", makeGeneratedRecognizeCategorizedEntitiesOptions(realOptions), (finalOptions) => throwError(this.client.entitiesRecognitionGeneral({
4378
+ documents: realInputs,
4379
+ }, finalOptions)).then((result) => makeRecognizeCategorizedEntitiesResultArray(realInputs, result)));
4449
4380
  }
4450
4381
  async analyzeSentiment(documents, languageOrOptions, options) {
4451
4382
  let realOptions;
@@ -4462,23 +4393,11 @@ class TextAnalyticsClient {
4462
4393
  realInputs = documents;
4463
4394
  realOptions = languageOrOptions || {};
4464
4395
  }
4465
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-analyzeSentiment", makeGeneratedAnalyzeSentimentOptions(realOptions));
4466
- try {
4467
- const result = await this.client.sentiment({
4468
- documents: realInputs
4469
- }, finalOptions);
4470
- return makeAnalyzeSentimentResultArray(realInputs, result);
4471
- }
4472
- catch (e) {
4473
- span.setStatus({
4474
- code: coreTracing.SpanStatusCode.ERROR,
4475
- message: e.message
4476
- });
4477
- throw e;
4478
- }
4479
- finally {
4480
- span.end();
4481
- }
4396
+ return this._tracing.withSpan("TextAnalyticsClient-analyzeSentiment", makeGeneratedAnalyzeSentimentOptions(realOptions), (finalOptions) => this.client
4397
+ .sentiment({
4398
+ documents: realInputs,
4399
+ }, finalOptions)
4400
+ .then((result) => makeAnalyzeSentimentResultArray(realInputs, result)));
4482
4401
  }
4483
4402
  async extractKeyPhrases(documents, languageOrOptions, options) {
4484
4403
  let realOptions;
@@ -4495,23 +4414,11 @@ class TextAnalyticsClient {
4495
4414
  realInputs = documents;
4496
4415
  realOptions = languageOrOptions || {};
4497
4416
  }
4498
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-extractKeyPhrases", makeGeneratedExtractKeyPhrasesOptions(realOptions));
4499
- try {
4500
- const result = await this.client.keyPhrases({
4501
- documents: realInputs
4502
- }, finalOptions);
4503
- return makeExtractKeyPhrasesResultArray(realInputs, result);
4504
- }
4505
- catch (e) {
4506
- span.setStatus({
4507
- code: coreTracing.SpanStatusCode.ERROR,
4508
- message: e.message
4509
- });
4510
- throw e;
4511
- }
4512
- finally {
4513
- span.end();
4514
- }
4417
+ return this._tracing.withSpan("TextAnalyticsClient-extractKeyPhrases", makeGeneratedExtractKeyPhrasesOptions(realOptions), (finalOptions) => this.client
4418
+ .keyPhrases({
4419
+ documents: realInputs,
4420
+ }, finalOptions)
4421
+ .then((result) => makeExtractKeyPhrasesResultArray(realInputs, result)));
4515
4422
  }
4516
4423
  async recognizePiiEntities(inputs, languageOrOptions, options) {
4517
4424
  let realOptions;
@@ -4525,23 +4432,11 @@ class TextAnalyticsClient {
4525
4432
  realInputs = inputs;
4526
4433
  realOptions = languageOrOptions || {};
4527
4434
  }
4528
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-recognizePiiEntities", makeGeneratedRecognizePiiEntitiesOptions(realOptions));
4529
- try {
4530
- const result = await this.client.entitiesRecognitionPii({
4531
- documents: realInputs
4532
- }, finalOptions);
4533
- return makeRecognizePiiEntitiesResultArray(realInputs, result);
4534
- }
4535
- catch (e) {
4536
- span.setStatus({
4537
- code: coreTracing.SpanStatusCode.ERROR,
4538
- message: e.message
4539
- });
4540
- throw e;
4541
- }
4542
- finally {
4543
- span.end();
4544
- }
4435
+ return this._tracing.withSpan("TextAnalyticsClient-recognizePiiEntities", makeGeneratedRecognizePiiEntitiesOptions(realOptions), (finalOptions) => this.client
4436
+ .entitiesRecognitionPii({
4437
+ documents: realInputs,
4438
+ }, finalOptions)
4439
+ .then((result) => makeRecognizePiiEntitiesResultArray(realInputs, result)));
4545
4440
  }
4546
4441
  async recognizeLinkedEntities(documents, languageOrOptions, options) {
4547
4442
  let realOptions;
@@ -4558,23 +4453,11 @@ class TextAnalyticsClient {
4558
4453
  realInputs = documents;
4559
4454
  realOptions = languageOrOptions || {};
4560
4455
  }
4561
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-recognizeLinkedEntities", makeGeneratedRecognizeLinkingEntitiesOptions(realOptions));
4562
- try {
4563
- const result = await this.client.entitiesLinking({
4564
- documents: realInputs
4565
- }, finalOptions);
4566
- return makeRecognizeLinkedEntitiesResultArray(realInputs, result);
4567
- }
4568
- catch (e) {
4569
- span.setStatus({
4570
- code: coreTracing.SpanStatusCode.ERROR,
4571
- message: e.message
4572
- });
4573
- throw e;
4574
- }
4575
- finally {
4576
- span.end();
4577
- }
4456
+ return this._tracing.withSpan("TextAnalyticsClient-recognizeLinkedEntities", makeGeneratedRecognizeLinkingEntitiesOptions(realOptions), (finalOptions) => this.client
4457
+ .entitiesLinking({
4458
+ documents: realInputs,
4459
+ }, finalOptions)
4460
+ .then((result) => makeRecognizeLinkedEntitiesResultArray(realInputs, result)));
4578
4461
  }
4579
4462
  async beginAnalyzeHealthcareEntities(documents, languageOrOptions, options) {
4580
4463
  let realOptions;
@@ -4591,10 +4474,11 @@ class TextAnalyticsClient {
4591
4474
  const { updateIntervalInMs, resumeFrom } = realOptions, restOptions = tslib.__rest(realOptions, ["updateIntervalInMs", "resumeFrom"]);
4592
4475
  const poller = new BeginAnalyzeHealthcarePoller({
4593
4476
  client: this.client,
4477
+ tracing: this._tracing,
4594
4478
  documents: realInputs,
4595
4479
  options: restOptions,
4596
4480
  updateIntervalInMs: updateIntervalInMs,
4597
- resumeFrom: resumeFrom
4481
+ resumeFrom: resumeFrom,
4598
4482
  });
4599
4483
  await poller.poll();
4600
4484
  return poller;
@@ -4614,34 +4498,21 @@ class TextAnalyticsClient {
4614
4498
  realInputs = documents;
4615
4499
  realOptions = languageOrOptions || {};
4616
4500
  }
4617
- validateActions(actions);
4618
4501
  const compiledActions = compileAnalyzeInput(actions);
4619
4502
  const { updateIntervalInMs, resumeFrom } = realOptions, restOptions = tslib.__rest(realOptions, ["updateIntervalInMs", "resumeFrom"]);
4620
4503
  const poller = new BeginAnalyzeActionsPoller({
4621
4504
  client: this.client,
4505
+ tracing: this._tracing,
4622
4506
  documents: realInputs,
4623
4507
  actions: compiledActions,
4624
4508
  options: restOptions,
4625
4509
  resumeFrom: resumeFrom,
4626
- updateIntervalInMs: updateIntervalInMs
4510
+ updateIntervalInMs: updateIntervalInMs,
4627
4511
  });
4628
4512
  await poller.poll();
4629
4513
  return poller;
4630
4514
  }
4631
4515
  }
4632
- function validateActions(actions) {
4633
- function validateActionType(actionList, actionType) {
4634
- var _a;
4635
- if (((_a = actionList === null || actionList === void 0 ? void 0 : actionList.length) !== null && _a !== void 0 ? _a : 0) > 1) {
4636
- throw new Error(`beginAnalyzeActions: Currently, the service can accept up to one action only for ${actionType} actions.`);
4637
- }
4638
- }
4639
- validateActionType(actions.analyzeSentimentActions, `analyzeSentiment`);
4640
- validateActionType(actions.extractKeyPhrasesActions, `extractKeyPhrases`);
4641
- validateActionType(actions.recognizeEntitiesActions, `recognizeEntities`);
4642
- validateActionType(actions.recognizeLinkedEntitiesActions, `recognizeLinkedEntities`);
4643
- validateActionType(actions.recognizePiiEntitiesActions, `recognizePiiEntities`);
4644
- }
4645
4516
  /**
4646
4517
  * @internal
4647
4518
  */
@@ -4652,7 +4523,7 @@ function compileAnalyzeInput(actions) {
4652
4523
  entityRecognitionTasks: (_b = actions.recognizeEntitiesActions) === null || _b === void 0 ? void 0 : _b.map(compose(setStrEncodingParam, addParamsToTask)),
4653
4524
  keyPhraseExtractionTasks: (_c = actions.extractKeyPhrasesActions) === null || _c === void 0 ? void 0 : _c.map(addParamsToTask),
4654
4525
  entityLinkingTasks: (_d = actions.recognizeLinkedEntitiesActions) === null || _d === void 0 ? void 0 : _d.map(compose(setStrEncodingParam, addParamsToTask)),
4655
- sentimentAnalysisTasks: (_e = actions.analyzeSentimentActions) === null || _e === void 0 ? void 0 : _e.map(compose(setStrEncodingParam, compose(setOpinionMining, addParamsToTask)))
4526
+ sentimentAnalysisTasks: (_e = actions.analyzeSentimentActions) === null || _e === void 0 ? void 0 : _e.map(compose(setStrEncodingParam, compose(setOpinionMining, addParamsToTask))),
4656
4527
  };
4657
4528
  }
4658
4529
  function isStringArray(documents) {
@@ -4669,7 +4540,7 @@ function convertToDetectLanguageInput(inputs, countryHint) {
4669
4540
  return {
4670
4541
  id: String(index),
4671
4542
  countryHint,
4672
- text
4543
+ text,
4673
4544
  };
4674
4545
  });
4675
4546
  }
@@ -4681,7 +4552,7 @@ function convertToTextDocumentInput(inputs, language) {
4681
4552
  return {
4682
4553
  id: String(index),
4683
4554
  language,
4684
- text
4555
+ text,
4685
4556
  };
4686
4557
  });
4687
4558
  }
@@ -4701,7 +4572,7 @@ function makeGeneratedAnalyzeSentimentOptions(params) {
4701
4572
  tracingOptions: params.tracingOptions,
4702
4573
  onResponse: params.onResponse,
4703
4574
  serializerOptions: params.serializerOptions,
4704
- loggingOptOut: params.disableServiceLogs
4575
+ loggingOptOut: params.disableServiceLogs,
4705
4576
  };
4706
4577
  }
4707
4578
  /**
@@ -4721,7 +4592,7 @@ function makeGeneratedRecognizePiiEntitiesOptions(params) {
4721
4592
  piiCategories: params.categoriesFilter,
4722
4593
  onResponse: params.onResponse,
4723
4594
  serializerOptions: params.serializerOptions,
4724
- loggingOptOut: params.disableServiceLogs
4595
+ loggingOptOut: params.disableServiceLogs,
4725
4596
  };
4726
4597
  }
4727
4598
  /**
@@ -4739,7 +4610,7 @@ function makeGeneratedRecognizeCategorizedEntitiesOptions(params) {
4739
4610
  tracingOptions: params.tracingOptions,
4740
4611
  onResponse: params.onResponse,
4741
4612
  serializerOptions: params.serializerOptions,
4742
- loggingOptOut: params.disableServiceLogs
4613
+ loggingOptOut: params.disableServiceLogs,
4743
4614
  };
4744
4615
  }
4745
4616
  /**
@@ -4756,7 +4627,7 @@ function makeGeneratedDetectLanguageOptions(params) {
4756
4627
  tracingOptions: params.tracingOptions,
4757
4628
  onResponse: params.onResponse,
4758
4629
  serializerOptions: params.serializerOptions,
4759
- loggingOptOut: params.disableServiceLogs
4630
+ loggingOptOut: params.disableServiceLogs,
4760
4631
  };
4761
4632
  }
4762
4633
  /**
@@ -4773,7 +4644,7 @@ function makeGeneratedExtractKeyPhrasesOptions(params) {
4773
4644
  tracingOptions: params.tracingOptions,
4774
4645
  onResponse: params.onResponse,
4775
4646
  serializerOptions: params.serializerOptions,
4776
- loggingOptOut: params.disableServiceLogs
4647
+ loggingOptOut: params.disableServiceLogs,
4777
4648
  };
4778
4649
  }
4779
4650
  /**
@@ -4791,15 +4662,535 @@ function makeGeneratedRecognizeLinkingEntitiesOptions(params) {
4791
4662
  onResponse: params.onResponse,
4792
4663
  serializerOptions: params.serializerOptions,
4793
4664
  loggingOptOut: params.disableServiceLogs,
4794
- stringIndexType: setStrEncodingParamValue(params.stringIndexType)
4665
+ stringIndexType: setStrEncodingParamValue(params.stringIndexType),
4795
4666
  };
4796
4667
  }
4797
4668
 
4669
+ /*
4670
+ * Copyright (c) Microsoft Corporation.
4671
+ * Licensed under the MIT License.
4672
+ *
4673
+ * Code generated by Microsoft (R) AutoRest Code Generator.
4674
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
4675
+ */
4676
+ /** Known values of {@link StringIndexType} that the service accepts. */
4677
+ var KnownStringIndexType;
4678
+ (function (KnownStringIndexType) {
4679
+ /** Returned offset and length values will correspond to TextElements (Graphemes and Grapheme clusters) confirming to the Unicode 8.0.0 standard. Use this option if your application is written in .Net Framework or .Net Core and you will be using StringInfo. */
4680
+ KnownStringIndexType["TextElementV8"] = "TextElement_v8";
4681
+ /** Returned offset and length values will correspond to Unicode code points. Use this option if your application is written in a language that support Unicode, for example Python. */
4682
+ KnownStringIndexType["UnicodeCodePoint"] = "UnicodeCodePoint";
4683
+ /** Returned offset and length values will correspond to UTF-16 code units. Use this option if your application is written in a language that support Unicode, for example Java, JavaScript. */
4684
+ KnownStringIndexType["Utf16CodeUnit"] = "Utf16CodeUnit";
4685
+ })(KnownStringIndexType || (KnownStringIndexType = {}));
4686
+ /** Known values of {@link PiiTaskParametersDomain} that the service accepts. */
4687
+ var KnownPiiTaskParametersDomain;
4688
+ (function (KnownPiiTaskParametersDomain) {
4689
+ /** Phi */
4690
+ KnownPiiTaskParametersDomain["Phi"] = "phi";
4691
+ /** None */
4692
+ KnownPiiTaskParametersDomain["None"] = "none";
4693
+ })(KnownPiiTaskParametersDomain || (KnownPiiTaskParametersDomain = {}));
4694
+ /** Known values of {@link PiiCategory} that the service accepts. */
4695
+ var KnownPiiCategory;
4696
+ (function (KnownPiiCategory) {
4697
+ /** ABARoutingNumber */
4698
+ KnownPiiCategory["ABARoutingNumber"] = "ABARoutingNumber";
4699
+ /** ARNationalIdentityNumber */
4700
+ KnownPiiCategory["ARNationalIdentityNumber"] = "ARNationalIdentityNumber";
4701
+ /** AUBankAccountNumber */
4702
+ KnownPiiCategory["AUBankAccountNumber"] = "AUBankAccountNumber";
4703
+ /** AUDriversLicenseNumber */
4704
+ KnownPiiCategory["AUDriversLicenseNumber"] = "AUDriversLicenseNumber";
4705
+ /** AUMedicalAccountNumber */
4706
+ KnownPiiCategory["AUMedicalAccountNumber"] = "AUMedicalAccountNumber";
4707
+ /** AUPassportNumber */
4708
+ KnownPiiCategory["AUPassportNumber"] = "AUPassportNumber";
4709
+ /** AUTaxFileNumber */
4710
+ KnownPiiCategory["AUTaxFileNumber"] = "AUTaxFileNumber";
4711
+ /** AUBusinessNumber */
4712
+ KnownPiiCategory["AUBusinessNumber"] = "AUBusinessNumber";
4713
+ /** AUCompanyNumber */
4714
+ KnownPiiCategory["AUCompanyNumber"] = "AUCompanyNumber";
4715
+ /** ATIdentityCard */
4716
+ KnownPiiCategory["ATIdentityCard"] = "ATIdentityCard";
4717
+ /** ATTaxIdentificationNumber */
4718
+ KnownPiiCategory["ATTaxIdentificationNumber"] = "ATTaxIdentificationNumber";
4719
+ /** ATValueAddedTaxNumber */
4720
+ KnownPiiCategory["ATValueAddedTaxNumber"] = "ATValueAddedTaxNumber";
4721
+ /** AzureDocumentDBAuthKey */
4722
+ KnownPiiCategory["AzureDocumentDBAuthKey"] = "AzureDocumentDBAuthKey";
4723
+ /** AzureIaasDatabaseConnectionAndSQLString */
4724
+ KnownPiiCategory["AzureIaasDatabaseConnectionAndSQLString"] = "AzureIAASDatabaseConnectionAndSQLString";
4725
+ /** AzureIoTConnectionString */
4726
+ KnownPiiCategory["AzureIoTConnectionString"] = "AzureIoTConnectionString";
4727
+ /** AzurePublishSettingPassword */
4728
+ KnownPiiCategory["AzurePublishSettingPassword"] = "AzurePublishSettingPassword";
4729
+ /** AzureRedisCacheString */
4730
+ KnownPiiCategory["AzureRedisCacheString"] = "AzureRedisCacheString";
4731
+ /** AzureSAS */
4732
+ KnownPiiCategory["AzureSAS"] = "AzureSAS";
4733
+ /** AzureServiceBusString */
4734
+ KnownPiiCategory["AzureServiceBusString"] = "AzureServiceBusString";
4735
+ /** AzureStorageAccountKey */
4736
+ KnownPiiCategory["AzureStorageAccountKey"] = "AzureStorageAccountKey";
4737
+ /** AzureStorageAccountGeneric */
4738
+ KnownPiiCategory["AzureStorageAccountGeneric"] = "AzureStorageAccountGeneric";
4739
+ /** BENationalNumber */
4740
+ KnownPiiCategory["BENationalNumber"] = "BENationalNumber";
4741
+ /** BENationalNumberV2 */
4742
+ KnownPiiCategory["BENationalNumberV2"] = "BENationalNumberV2";
4743
+ /** BEValueAddedTaxNumber */
4744
+ KnownPiiCategory["BEValueAddedTaxNumber"] = "BEValueAddedTaxNumber";
4745
+ /** BrcpfNumber */
4746
+ KnownPiiCategory["BrcpfNumber"] = "BRCPFNumber";
4747
+ /** BRLegalEntityNumber */
4748
+ KnownPiiCategory["BRLegalEntityNumber"] = "BRLegalEntityNumber";
4749
+ /** BRNationalIdrg */
4750
+ KnownPiiCategory["BRNationalIdrg"] = "BRNationalIDRG";
4751
+ /** BGUniformCivilNumber */
4752
+ KnownPiiCategory["BGUniformCivilNumber"] = "BGUniformCivilNumber";
4753
+ /** CABankAccountNumber */
4754
+ KnownPiiCategory["CABankAccountNumber"] = "CABankAccountNumber";
4755
+ /** CADriversLicenseNumber */
4756
+ KnownPiiCategory["CADriversLicenseNumber"] = "CADriversLicenseNumber";
4757
+ /** CAHealthServiceNumber */
4758
+ KnownPiiCategory["CAHealthServiceNumber"] = "CAHealthServiceNumber";
4759
+ /** CAPassportNumber */
4760
+ KnownPiiCategory["CAPassportNumber"] = "CAPassportNumber";
4761
+ /** CAPersonalHealthIdentification */
4762
+ KnownPiiCategory["CAPersonalHealthIdentification"] = "CAPersonalHealthIdentification";
4763
+ /** CASocialInsuranceNumber */
4764
+ KnownPiiCategory["CASocialInsuranceNumber"] = "CASocialInsuranceNumber";
4765
+ /** CLIdentityCardNumber */
4766
+ KnownPiiCategory["CLIdentityCardNumber"] = "CLIdentityCardNumber";
4767
+ /** CNResidentIdentityCardNumber */
4768
+ KnownPiiCategory["CNResidentIdentityCardNumber"] = "CNResidentIdentityCardNumber";
4769
+ /** CreditCardNumber */
4770
+ KnownPiiCategory["CreditCardNumber"] = "CreditCardNumber";
4771
+ /** HRIdentityCardNumber */
4772
+ KnownPiiCategory["HRIdentityCardNumber"] = "HRIdentityCardNumber";
4773
+ /** HRNationalIDNumber */
4774
+ KnownPiiCategory["HRNationalIDNumber"] = "HRNationalIDNumber";
4775
+ /** HRPersonalIdentificationNumber */
4776
+ KnownPiiCategory["HRPersonalIdentificationNumber"] = "HRPersonalIdentificationNumber";
4777
+ /** HRPersonalIdentificationOIBNumberV2 */
4778
+ KnownPiiCategory["HRPersonalIdentificationOIBNumberV2"] = "HRPersonalIdentificationOIBNumberV2";
4779
+ /** CYIdentityCard */
4780
+ KnownPiiCategory["CYIdentityCard"] = "CYIdentityCard";
4781
+ /** CYTaxIdentificationNumber */
4782
+ KnownPiiCategory["CYTaxIdentificationNumber"] = "CYTaxIdentificationNumber";
4783
+ /** CZPersonalIdentityNumber */
4784
+ KnownPiiCategory["CZPersonalIdentityNumber"] = "CZPersonalIdentityNumber";
4785
+ /** CZPersonalIdentityV2 */
4786
+ KnownPiiCategory["CZPersonalIdentityV2"] = "CZPersonalIdentityV2";
4787
+ /** DKPersonalIdentificationNumber */
4788
+ KnownPiiCategory["DKPersonalIdentificationNumber"] = "DKPersonalIdentificationNumber";
4789
+ /** DKPersonalIdentificationV2 */
4790
+ KnownPiiCategory["DKPersonalIdentificationV2"] = "DKPersonalIdentificationV2";
4791
+ /** DrugEnforcementAgencyNumber */
4792
+ KnownPiiCategory["DrugEnforcementAgencyNumber"] = "DrugEnforcementAgencyNumber";
4793
+ /** EEPersonalIdentificationCode */
4794
+ KnownPiiCategory["EEPersonalIdentificationCode"] = "EEPersonalIdentificationCode";
4795
+ /** EUDebitCardNumber */
4796
+ KnownPiiCategory["EUDebitCardNumber"] = "EUDebitCardNumber";
4797
+ /** EUDriversLicenseNumber */
4798
+ KnownPiiCategory["EUDriversLicenseNumber"] = "EUDriversLicenseNumber";
4799
+ /** EugpsCoordinates */
4800
+ KnownPiiCategory["EugpsCoordinates"] = "EUGPSCoordinates";
4801
+ /** EUNationalIdentificationNumber */
4802
+ KnownPiiCategory["EUNationalIdentificationNumber"] = "EUNationalIdentificationNumber";
4803
+ /** EUPassportNumber */
4804
+ KnownPiiCategory["EUPassportNumber"] = "EUPassportNumber";
4805
+ /** EUSocialSecurityNumber */
4806
+ KnownPiiCategory["EUSocialSecurityNumber"] = "EUSocialSecurityNumber";
4807
+ /** EUTaxIdentificationNumber */
4808
+ KnownPiiCategory["EUTaxIdentificationNumber"] = "EUTaxIdentificationNumber";
4809
+ /** FIEuropeanHealthNumber */
4810
+ KnownPiiCategory["FIEuropeanHealthNumber"] = "FIEuropeanHealthNumber";
4811
+ /** FINationalID */
4812
+ KnownPiiCategory["FINationalID"] = "FINationalID";
4813
+ /** FINationalIDV2 */
4814
+ KnownPiiCategory["FINationalIDV2"] = "FINationalIDV2";
4815
+ /** FIPassportNumber */
4816
+ KnownPiiCategory["FIPassportNumber"] = "FIPassportNumber";
4817
+ /** FRDriversLicenseNumber */
4818
+ KnownPiiCategory["FRDriversLicenseNumber"] = "FRDriversLicenseNumber";
4819
+ /** FRHealthInsuranceNumber */
4820
+ KnownPiiCategory["FRHealthInsuranceNumber"] = "FRHealthInsuranceNumber";
4821
+ /** FRNationalID */
4822
+ KnownPiiCategory["FRNationalID"] = "FRNationalID";
4823
+ /** FRPassportNumber */
4824
+ KnownPiiCategory["FRPassportNumber"] = "FRPassportNumber";
4825
+ /** FRSocialSecurityNumber */
4826
+ KnownPiiCategory["FRSocialSecurityNumber"] = "FRSocialSecurityNumber";
4827
+ /** FRTaxIdentificationNumber */
4828
+ KnownPiiCategory["FRTaxIdentificationNumber"] = "FRTaxIdentificationNumber";
4829
+ /** FRValueAddedTaxNumber */
4830
+ KnownPiiCategory["FRValueAddedTaxNumber"] = "FRValueAddedTaxNumber";
4831
+ /** DEDriversLicenseNumber */
4832
+ KnownPiiCategory["DEDriversLicenseNumber"] = "DEDriversLicenseNumber";
4833
+ /** DEPassportNumber */
4834
+ KnownPiiCategory["DEPassportNumber"] = "DEPassportNumber";
4835
+ /** DEIdentityCardNumber */
4836
+ KnownPiiCategory["DEIdentityCardNumber"] = "DEIdentityCardNumber";
4837
+ /** DETaxIdentificationNumber */
4838
+ KnownPiiCategory["DETaxIdentificationNumber"] = "DETaxIdentificationNumber";
4839
+ /** DEValueAddedNumber */
4840
+ KnownPiiCategory["DEValueAddedNumber"] = "DEValueAddedNumber";
4841
+ /** GRNationalIDCard */
4842
+ KnownPiiCategory["GRNationalIDCard"] = "GRNationalIDCard";
4843
+ /** GRNationalIDV2 */
4844
+ KnownPiiCategory["GRNationalIDV2"] = "GRNationalIDV2";
4845
+ /** GRTaxIdentificationNumber */
4846
+ KnownPiiCategory["GRTaxIdentificationNumber"] = "GRTaxIdentificationNumber";
4847
+ /** HKIdentityCardNumber */
4848
+ KnownPiiCategory["HKIdentityCardNumber"] = "HKIdentityCardNumber";
4849
+ /** HUValueAddedNumber */
4850
+ KnownPiiCategory["HUValueAddedNumber"] = "HUValueAddedNumber";
4851
+ /** HUPersonalIdentificationNumber */
4852
+ KnownPiiCategory["HUPersonalIdentificationNumber"] = "HUPersonalIdentificationNumber";
4853
+ /** HUTaxIdentificationNumber */
4854
+ KnownPiiCategory["HUTaxIdentificationNumber"] = "HUTaxIdentificationNumber";
4855
+ /** INPermanentAccount */
4856
+ KnownPiiCategory["INPermanentAccount"] = "INPermanentAccount";
4857
+ /** INUniqueIdentificationNumber */
4858
+ KnownPiiCategory["INUniqueIdentificationNumber"] = "INUniqueIdentificationNumber";
4859
+ /** IDIdentityCardNumber */
4860
+ KnownPiiCategory["IDIdentityCardNumber"] = "IDIdentityCardNumber";
4861
+ /** InternationalBankingAccountNumber */
4862
+ KnownPiiCategory["InternationalBankingAccountNumber"] = "InternationalBankingAccountNumber";
4863
+ /** IEPersonalPublicServiceNumber */
4864
+ KnownPiiCategory["IEPersonalPublicServiceNumber"] = "IEPersonalPublicServiceNumber";
4865
+ /** IEPersonalPublicServiceNumberV2 */
4866
+ KnownPiiCategory["IEPersonalPublicServiceNumberV2"] = "IEPersonalPublicServiceNumberV2";
4867
+ /** ILBankAccountNumber */
4868
+ KnownPiiCategory["ILBankAccountNumber"] = "ILBankAccountNumber";
4869
+ /** ILNationalID */
4870
+ KnownPiiCategory["ILNationalID"] = "ILNationalID";
4871
+ /** ITDriversLicenseNumber */
4872
+ KnownPiiCategory["ITDriversLicenseNumber"] = "ITDriversLicenseNumber";
4873
+ /** ITFiscalCode */
4874
+ KnownPiiCategory["ITFiscalCode"] = "ITFiscalCode";
4875
+ /** ITValueAddedTaxNumber */
4876
+ KnownPiiCategory["ITValueAddedTaxNumber"] = "ITValueAddedTaxNumber";
4877
+ /** JPBankAccountNumber */
4878
+ KnownPiiCategory["JPBankAccountNumber"] = "JPBankAccountNumber";
4879
+ /** JPDriversLicenseNumber */
4880
+ KnownPiiCategory["JPDriversLicenseNumber"] = "JPDriversLicenseNumber";
4881
+ /** JPPassportNumber */
4882
+ KnownPiiCategory["JPPassportNumber"] = "JPPassportNumber";
4883
+ /** JPResidentRegistrationNumber */
4884
+ KnownPiiCategory["JPResidentRegistrationNumber"] = "JPResidentRegistrationNumber";
4885
+ /** JPSocialInsuranceNumber */
4886
+ KnownPiiCategory["JPSocialInsuranceNumber"] = "JPSocialInsuranceNumber";
4887
+ /** JPMyNumberCorporate */
4888
+ KnownPiiCategory["JPMyNumberCorporate"] = "JPMyNumberCorporate";
4889
+ /** JPMyNumberPersonal */
4890
+ KnownPiiCategory["JPMyNumberPersonal"] = "JPMyNumberPersonal";
4891
+ /** JPResidenceCardNumber */
4892
+ KnownPiiCategory["JPResidenceCardNumber"] = "JPResidenceCardNumber";
4893
+ /** LVPersonalCode */
4894
+ KnownPiiCategory["LVPersonalCode"] = "LVPersonalCode";
4895
+ /** LTPersonalCode */
4896
+ KnownPiiCategory["LTPersonalCode"] = "LTPersonalCode";
4897
+ /** LUNationalIdentificationNumberNatural */
4898
+ KnownPiiCategory["LUNationalIdentificationNumberNatural"] = "LUNationalIdentificationNumberNatural";
4899
+ /** LUNationalIdentificationNumberNonNatural */
4900
+ KnownPiiCategory["LUNationalIdentificationNumberNonNatural"] = "LUNationalIdentificationNumberNonNatural";
4901
+ /** MYIdentityCardNumber */
4902
+ KnownPiiCategory["MYIdentityCardNumber"] = "MYIdentityCardNumber";
4903
+ /** MTIdentityCardNumber */
4904
+ KnownPiiCategory["MTIdentityCardNumber"] = "MTIdentityCardNumber";
4905
+ /** MTTaxIDNumber */
4906
+ KnownPiiCategory["MTTaxIDNumber"] = "MTTaxIDNumber";
4907
+ /** NLCitizensServiceNumber */
4908
+ KnownPiiCategory["NLCitizensServiceNumber"] = "NLCitizensServiceNumber";
4909
+ /** NLCitizensServiceNumberV2 */
4910
+ KnownPiiCategory["NLCitizensServiceNumberV2"] = "NLCitizensServiceNumberV2";
4911
+ /** NLTaxIdentificationNumber */
4912
+ KnownPiiCategory["NLTaxIdentificationNumber"] = "NLTaxIdentificationNumber";
4913
+ /** NLValueAddedTaxNumber */
4914
+ KnownPiiCategory["NLValueAddedTaxNumber"] = "NLValueAddedTaxNumber";
4915
+ /** NZBankAccountNumber */
4916
+ KnownPiiCategory["NZBankAccountNumber"] = "NZBankAccountNumber";
4917
+ /** NZDriversLicenseNumber */
4918
+ KnownPiiCategory["NZDriversLicenseNumber"] = "NZDriversLicenseNumber";
4919
+ /** NZInlandRevenueNumber */
4920
+ KnownPiiCategory["NZInlandRevenueNumber"] = "NZInlandRevenueNumber";
4921
+ /** NZMinistryOfHealthNumber */
4922
+ KnownPiiCategory["NZMinistryOfHealthNumber"] = "NZMinistryOfHealthNumber";
4923
+ /** NZSocialWelfareNumber */
4924
+ KnownPiiCategory["NZSocialWelfareNumber"] = "NZSocialWelfareNumber";
4925
+ /** NOIdentityNumber */
4926
+ KnownPiiCategory["NOIdentityNumber"] = "NOIdentityNumber";
4927
+ /** PHUnifiedMultiPurposeIDNumber */
4928
+ KnownPiiCategory["PHUnifiedMultiPurposeIDNumber"] = "PHUnifiedMultiPurposeIDNumber";
4929
+ /** PLIdentityCard */
4930
+ KnownPiiCategory["PLIdentityCard"] = "PLIdentityCard";
4931
+ /** PLNationalID */
4932
+ KnownPiiCategory["PLNationalID"] = "PLNationalID";
4933
+ /** PLNationalIDV2 */
4934
+ KnownPiiCategory["PLNationalIDV2"] = "PLNationalIDV2";
4935
+ /** PLPassportNumber */
4936
+ KnownPiiCategory["PLPassportNumber"] = "PLPassportNumber";
4937
+ /** PLTaxIdentificationNumber */
4938
+ KnownPiiCategory["PLTaxIdentificationNumber"] = "PLTaxIdentificationNumber";
4939
+ /** PlregonNumber */
4940
+ KnownPiiCategory["PlregonNumber"] = "PLREGONNumber";
4941
+ /** PTCitizenCardNumber */
4942
+ KnownPiiCategory["PTCitizenCardNumber"] = "PTCitizenCardNumber";
4943
+ /** PTCitizenCardNumberV2 */
4944
+ KnownPiiCategory["PTCitizenCardNumberV2"] = "PTCitizenCardNumberV2";
4945
+ /** PTTaxIdentificationNumber */
4946
+ KnownPiiCategory["PTTaxIdentificationNumber"] = "PTTaxIdentificationNumber";
4947
+ /** ROPersonalNumericalCode */
4948
+ KnownPiiCategory["ROPersonalNumericalCode"] = "ROPersonalNumericalCode";
4949
+ /** RUPassportNumberDomestic */
4950
+ KnownPiiCategory["RUPassportNumberDomestic"] = "RUPassportNumberDomestic";
4951
+ /** RUPassportNumberInternational */
4952
+ KnownPiiCategory["RUPassportNumberInternational"] = "RUPassportNumberInternational";
4953
+ /** SANationalID */
4954
+ KnownPiiCategory["SANationalID"] = "SANationalID";
4955
+ /** SGNationalRegistrationIdentityCardNumber */
4956
+ KnownPiiCategory["SGNationalRegistrationIdentityCardNumber"] = "SGNationalRegistrationIdentityCardNumber";
4957
+ /** SKPersonalNumber */
4958
+ KnownPiiCategory["SKPersonalNumber"] = "SKPersonalNumber";
4959
+ /** SITaxIdentificationNumber */
4960
+ KnownPiiCategory["SITaxIdentificationNumber"] = "SITaxIdentificationNumber";
4961
+ /** SIUniqueMasterCitizenNumber */
4962
+ KnownPiiCategory["SIUniqueMasterCitizenNumber"] = "SIUniqueMasterCitizenNumber";
4963
+ /** ZAIdentificationNumber */
4964
+ KnownPiiCategory["ZAIdentificationNumber"] = "ZAIdentificationNumber";
4965
+ /** KRResidentRegistrationNumber */
4966
+ KnownPiiCategory["KRResidentRegistrationNumber"] = "KRResidentRegistrationNumber";
4967
+ /** Esdni */
4968
+ KnownPiiCategory["Esdni"] = "ESDNI";
4969
+ /** ESSocialSecurityNumber */
4970
+ KnownPiiCategory["ESSocialSecurityNumber"] = "ESSocialSecurityNumber";
4971
+ /** ESTaxIdentificationNumber */
4972
+ KnownPiiCategory["ESTaxIdentificationNumber"] = "ESTaxIdentificationNumber";
4973
+ /** SQLServerConnectionString */
4974
+ KnownPiiCategory["SQLServerConnectionString"] = "SQLServerConnectionString";
4975
+ /** SENationalID */
4976
+ KnownPiiCategory["SENationalID"] = "SENationalID";
4977
+ /** SENationalIDV2 */
4978
+ KnownPiiCategory["SENationalIDV2"] = "SENationalIDV2";
4979
+ /** SEPassportNumber */
4980
+ KnownPiiCategory["SEPassportNumber"] = "SEPassportNumber";
4981
+ /** SETaxIdentificationNumber */
4982
+ KnownPiiCategory["SETaxIdentificationNumber"] = "SETaxIdentificationNumber";
4983
+ /** SwiftCode */
4984
+ KnownPiiCategory["SwiftCode"] = "SWIFTCode";
4985
+ /** CHSocialSecurityNumber */
4986
+ KnownPiiCategory["CHSocialSecurityNumber"] = "CHSocialSecurityNumber";
4987
+ /** TWNationalID */
4988
+ KnownPiiCategory["TWNationalID"] = "TWNationalID";
4989
+ /** TWPassportNumber */
4990
+ KnownPiiCategory["TWPassportNumber"] = "TWPassportNumber";
4991
+ /** TWResidentCertificate */
4992
+ KnownPiiCategory["TWResidentCertificate"] = "TWResidentCertificate";
4993
+ /** THPopulationIdentificationCode */
4994
+ KnownPiiCategory["THPopulationIdentificationCode"] = "THPopulationIdentificationCode";
4995
+ /** TRNationalIdentificationNumber */
4996
+ KnownPiiCategory["TRNationalIdentificationNumber"] = "TRNationalIdentificationNumber";
4997
+ /** UKDriversLicenseNumber */
4998
+ KnownPiiCategory["UKDriversLicenseNumber"] = "UKDriversLicenseNumber";
4999
+ /** UKElectoralRollNumber */
5000
+ KnownPiiCategory["UKElectoralRollNumber"] = "UKElectoralRollNumber";
5001
+ /** UKNationalHealthNumber */
5002
+ KnownPiiCategory["UKNationalHealthNumber"] = "UKNationalHealthNumber";
5003
+ /** UKNationalInsuranceNumber */
5004
+ KnownPiiCategory["UKNationalInsuranceNumber"] = "UKNationalInsuranceNumber";
5005
+ /** UKUniqueTaxpayerNumber */
5006
+ KnownPiiCategory["UKUniqueTaxpayerNumber"] = "UKUniqueTaxpayerNumber";
5007
+ /** UsukPassportNumber */
5008
+ KnownPiiCategory["UsukPassportNumber"] = "USUKPassportNumber";
5009
+ /** USBankAccountNumber */
5010
+ KnownPiiCategory["USBankAccountNumber"] = "USBankAccountNumber";
5011
+ /** USDriversLicenseNumber */
5012
+ KnownPiiCategory["USDriversLicenseNumber"] = "USDriversLicenseNumber";
5013
+ /** USIndividualTaxpayerIdentification */
5014
+ KnownPiiCategory["USIndividualTaxpayerIdentification"] = "USIndividualTaxpayerIdentification";
5015
+ /** USSocialSecurityNumber */
5016
+ KnownPiiCategory["USSocialSecurityNumber"] = "USSocialSecurityNumber";
5017
+ /** UAPassportNumberDomestic */
5018
+ KnownPiiCategory["UAPassportNumberDomestic"] = "UAPassportNumberDomestic";
5019
+ /** UAPassportNumberInternational */
5020
+ KnownPiiCategory["UAPassportNumberInternational"] = "UAPassportNumberInternational";
5021
+ /** Organization */
5022
+ KnownPiiCategory["Organization"] = "Organization";
5023
+ /** Email */
5024
+ KnownPiiCategory["Email"] = "Email";
5025
+ /** URL */
5026
+ KnownPiiCategory["URL"] = "URL";
5027
+ /** Age */
5028
+ KnownPiiCategory["Age"] = "Age";
5029
+ /** PhoneNumber */
5030
+ KnownPiiCategory["PhoneNumber"] = "PhoneNumber";
5031
+ /** IPAddress */
5032
+ KnownPiiCategory["IPAddress"] = "IPAddress";
5033
+ /** Date */
5034
+ KnownPiiCategory["Date"] = "Date";
5035
+ /** Person */
5036
+ KnownPiiCategory["Person"] = "Person";
5037
+ /** Address */
5038
+ KnownPiiCategory["Address"] = "Address";
5039
+ /** All */
5040
+ KnownPiiCategory["All"] = "All";
5041
+ /** Default */
5042
+ KnownPiiCategory["Default"] = "Default";
5043
+ })(KnownPiiCategory || (KnownPiiCategory = {}));
5044
+ /** Known values of {@link ErrorCodeValue} that the service accepts. */
5045
+ var KnownErrorCodeValue;
5046
+ (function (KnownErrorCodeValue) {
5047
+ /** InvalidRequest */
5048
+ KnownErrorCodeValue["InvalidRequest"] = "InvalidRequest";
5049
+ /** InvalidArgument */
5050
+ KnownErrorCodeValue["InvalidArgument"] = "InvalidArgument";
5051
+ /** InternalServerError */
5052
+ KnownErrorCodeValue["InternalServerError"] = "InternalServerError";
5053
+ /** ServiceUnavailable */
5054
+ KnownErrorCodeValue["ServiceUnavailable"] = "ServiceUnavailable";
5055
+ /** NotFound */
5056
+ KnownErrorCodeValue["NotFound"] = "NotFound";
5057
+ })(KnownErrorCodeValue || (KnownErrorCodeValue = {}));
5058
+ /** Known values of {@link InnerErrorCodeValue} that the service accepts. */
5059
+ exports.KnownInnerErrorCodeValue = void 0;
5060
+ (function (KnownInnerErrorCodeValue) {
5061
+ /** InvalidParameterValue */
5062
+ KnownInnerErrorCodeValue["InvalidParameterValue"] = "InvalidParameterValue";
5063
+ /** InvalidRequestBodyFormat */
5064
+ KnownInnerErrorCodeValue["InvalidRequestBodyFormat"] = "InvalidRequestBodyFormat";
5065
+ /** EmptyRequest */
5066
+ KnownInnerErrorCodeValue["EmptyRequest"] = "EmptyRequest";
5067
+ /** MissingInputRecords */
5068
+ KnownInnerErrorCodeValue["MissingInputRecords"] = "MissingInputRecords";
5069
+ /** InvalidDocument */
5070
+ KnownInnerErrorCodeValue["InvalidDocument"] = "InvalidDocument";
5071
+ /** ModelVersionIncorrect */
5072
+ KnownInnerErrorCodeValue["ModelVersionIncorrect"] = "ModelVersionIncorrect";
5073
+ /** InvalidDocumentBatch */
5074
+ KnownInnerErrorCodeValue["InvalidDocumentBatch"] = "InvalidDocumentBatch";
5075
+ /** UnsupportedLanguageCode */
5076
+ KnownInnerErrorCodeValue["UnsupportedLanguageCode"] = "UnsupportedLanguageCode";
5077
+ /** InvalidCountryHint */
5078
+ KnownInnerErrorCodeValue["InvalidCountryHint"] = "InvalidCountryHint";
5079
+ })(exports.KnownInnerErrorCodeValue || (exports.KnownInnerErrorCodeValue = {}));
5080
+ /** Known values of {@link WarningCode} that the service accepts. */
5081
+ exports.KnownWarningCode = void 0;
5082
+ (function (KnownWarningCode) {
5083
+ /** LongWordsInDocument */
5084
+ KnownWarningCode["LongWordsInDocument"] = "LongWordsInDocument";
5085
+ /** DocumentTruncated */
5086
+ KnownWarningCode["DocumentTruncated"] = "DocumentTruncated";
5087
+ })(exports.KnownWarningCode || (exports.KnownWarningCode = {}));
5088
+ /** Known values of {@link HealthcareEntityCategory} that the service accepts. */
5089
+ exports.KnownHealthcareEntityCategory = void 0;
5090
+ (function (KnownHealthcareEntityCategory) {
5091
+ /** BodyStructure */
5092
+ KnownHealthcareEntityCategory["BodyStructure"] = "BODY_STRUCTURE";
5093
+ /** AGE */
5094
+ KnownHealthcareEntityCategory["AGE"] = "AGE";
5095
+ /** Gender */
5096
+ KnownHealthcareEntityCategory["Gender"] = "GENDER";
5097
+ /** ExaminationName */
5098
+ KnownHealthcareEntityCategory["ExaminationName"] = "EXAMINATION_NAME";
5099
+ /** Date */
5100
+ KnownHealthcareEntityCategory["Date"] = "DATE";
5101
+ /** Direction */
5102
+ KnownHealthcareEntityCategory["Direction"] = "DIRECTION";
5103
+ /** Frequency */
5104
+ KnownHealthcareEntityCategory["Frequency"] = "FREQUENCY";
5105
+ /** MeasurementValue */
5106
+ KnownHealthcareEntityCategory["MeasurementValue"] = "MEASUREMENT_VALUE";
5107
+ /** MeasurementUnit */
5108
+ KnownHealthcareEntityCategory["MeasurementUnit"] = "MEASUREMENT_UNIT";
5109
+ /** RelationalOperator */
5110
+ KnownHealthcareEntityCategory["RelationalOperator"] = "RELATIONAL_OPERATOR";
5111
+ /** Time */
5112
+ KnownHealthcareEntityCategory["Time"] = "TIME";
5113
+ /** GeneORProtein */
5114
+ KnownHealthcareEntityCategory["GeneORProtein"] = "GENE_OR_PROTEIN";
5115
+ /** Variant */
5116
+ KnownHealthcareEntityCategory["Variant"] = "VARIANT";
5117
+ /** AdministrativeEvent */
5118
+ KnownHealthcareEntityCategory["AdministrativeEvent"] = "ADMINISTRATIVE_EVENT";
5119
+ /** CareEnvironment */
5120
+ KnownHealthcareEntityCategory["CareEnvironment"] = "CARE_ENVIRONMENT";
5121
+ /** HealthcareProfession */
5122
+ KnownHealthcareEntityCategory["HealthcareProfession"] = "HEALTHCARE_PROFESSION";
5123
+ /** Diagnosis */
5124
+ KnownHealthcareEntityCategory["Diagnosis"] = "DIAGNOSIS";
5125
+ /** SymptomORSign */
5126
+ KnownHealthcareEntityCategory["SymptomORSign"] = "SYMPTOM_OR_SIGN";
5127
+ /** ConditionQualifier */
5128
+ KnownHealthcareEntityCategory["ConditionQualifier"] = "CONDITION_QUALIFIER";
5129
+ /** MedicationClass */
5130
+ KnownHealthcareEntityCategory["MedicationClass"] = "MEDICATION_CLASS";
5131
+ /** MedicationName */
5132
+ KnownHealthcareEntityCategory["MedicationName"] = "MEDICATION_NAME";
5133
+ /** Dosage */
5134
+ KnownHealthcareEntityCategory["Dosage"] = "DOSAGE";
5135
+ /** MedicationForm */
5136
+ KnownHealthcareEntityCategory["MedicationForm"] = "MEDICATION_FORM";
5137
+ /** MedicationRoute */
5138
+ KnownHealthcareEntityCategory["MedicationRoute"] = "MEDICATION_ROUTE";
5139
+ /** FamilyRelation */
5140
+ KnownHealthcareEntityCategory["FamilyRelation"] = "FAMILY_RELATION";
5141
+ /** TreatmentName */
5142
+ KnownHealthcareEntityCategory["TreatmentName"] = "TREATMENT_NAME";
5143
+ })(exports.KnownHealthcareEntityCategory || (exports.KnownHealthcareEntityCategory = {}));
5144
+ /** Known values of {@link RelationType} that the service accepts. */
5145
+ var KnownRelationType;
5146
+ (function (KnownRelationType) {
5147
+ /** Abbreviation */
5148
+ KnownRelationType["Abbreviation"] = "Abbreviation";
5149
+ /** DirectionOfBodyStructure */
5150
+ KnownRelationType["DirectionOfBodyStructure"] = "DirectionOfBodyStructure";
5151
+ /** DirectionOfCondition */
5152
+ KnownRelationType["DirectionOfCondition"] = "DirectionOfCondition";
5153
+ /** DirectionOfExamination */
5154
+ KnownRelationType["DirectionOfExamination"] = "DirectionOfExamination";
5155
+ /** DirectionOfTreatment */
5156
+ KnownRelationType["DirectionOfTreatment"] = "DirectionOfTreatment";
5157
+ /** DosageOfMedication */
5158
+ KnownRelationType["DosageOfMedication"] = "DosageOfMedication";
5159
+ /** FormOfMedication */
5160
+ KnownRelationType["FormOfMedication"] = "FormOfMedication";
5161
+ /** FrequencyOfMedication */
5162
+ KnownRelationType["FrequencyOfMedication"] = "FrequencyOfMedication";
5163
+ /** FrequencyOfTreatment */
5164
+ KnownRelationType["FrequencyOfTreatment"] = "FrequencyOfTreatment";
5165
+ /** QualifierOfCondition */
5166
+ KnownRelationType["QualifierOfCondition"] = "QualifierOfCondition";
5167
+ /** RelationOfExamination */
5168
+ KnownRelationType["RelationOfExamination"] = "RelationOfExamination";
5169
+ /** RouteOfMedication */
5170
+ KnownRelationType["RouteOfMedication"] = "RouteOfMedication";
5171
+ /** TimeOfCondition */
5172
+ KnownRelationType["TimeOfCondition"] = "TimeOfCondition";
5173
+ /** TimeOfEvent */
5174
+ KnownRelationType["TimeOfEvent"] = "TimeOfEvent";
5175
+ /** TimeOfExamination */
5176
+ KnownRelationType["TimeOfExamination"] = "TimeOfExamination";
5177
+ /** TimeOfMedication */
5178
+ KnownRelationType["TimeOfMedication"] = "TimeOfMedication";
5179
+ /** TimeOfTreatment */
5180
+ KnownRelationType["TimeOfTreatment"] = "TimeOfTreatment";
5181
+ /** UnitOfCondition */
5182
+ KnownRelationType["UnitOfCondition"] = "UnitOfCondition";
5183
+ /** UnitOfExamination */
5184
+ KnownRelationType["UnitOfExamination"] = "UnitOfExamination";
5185
+ /** ValueOfCondition */
5186
+ KnownRelationType["ValueOfCondition"] = "ValueOfCondition";
5187
+ /** ValueOfExamination */
5188
+ KnownRelationType["ValueOfExamination"] = "ValueOfExamination";
5189
+ })(KnownRelationType || (KnownRelationType = {}));
5190
+
4798
5191
  Object.defineProperty(exports, 'AzureKeyCredential', {
4799
5192
  enumerable: true,
4800
- get: function () {
4801
- return coreAuth.AzureKeyCredential;
4802
- }
5193
+ get: function () { return coreAuth.AzureKeyCredential; }
4803
5194
  });
4804
5195
  exports.TextAnalyticsClient = TextAnalyticsClient;
4805
5196
  //# sourceMappingURL=index.js.map